class Authenticator {

  public boolean isAuthenticated(Request request) {
    requireNonNull(request, "request");

    String requestAccessKey = request.headers(HttpConstants.HEADER_NAME_ACCESS_KEY);
    LOG.debug("Provided access key in header is '{}', required value is '{}'",
              requestAccessKey,
              configuration.accessKey());

    // Any empty access key indicates authentication is not required.
    if (Strings.isNullOrEmpty(configuration.accessKey())) {
      LOG.debug("No access key, authentication not required.");
      return true;
    }

    return Objects.equals(requestAccessKey, configuration.accessKey());
  }

  @Inject public  Authenticator(ServiceWebApiConfiguration configuration);

}