class NpmWhoamiHandler implements Handler {

  @Nonnull
  @Override
  public Response handle(@Nonnull final Context context) throws Exception
  {
    User user = securitySystem.currentUser();

    Username username = new Username(user == null ? "anonymous" : user.getUserId());

    StringPayload payload = new StringPayload(objectMapper.writeValueAsString(username), APPLICATION_JSON);

    return HttpResponses.ok(payload);
  }

  @Inject public  NpmWhoamiHandler(final SecuritySystem securitySystem, final ObjectMapper objectMapper);

}