class RateLimitedAuthenticationStrategy implements AuthenticationStrategy {

    @Override
    public AuthenticationResult authenticate( User user, byte[] password )
    {
        AuthenticationMetadata authMetadata = authMetadataFor( user.name() );

        if ( !authMetadata.authenticationPermitted() )
        {
            return AuthenticationResult.TOO_MANY_ATTEMPTS;
        }

        if ( user.credentials().matchesPassword( password ) )
        {
            authMetadata.authSuccess();
            return AuthenticationResult.SUCCESS;
        }
        else
        {
            authMetadata.authFailed();
            return AuthenticationResult.FAILURE;
        }
    }

    public  RateLimitedAuthenticationStrategy( Clock clock, Config config );
      RateLimitedAuthenticationStrategy( Clock clock, Duration lockDuration, int maxFailedAttempts );

}