Interface BlueMindAuthenticator

All Known Implementing Classes:
BlueMindRestClient

public interface BlueMindAuthenticator
BlueMind's two authentication doors, /api/auth/login and /api/auth/_su, as BlueMindSessionStorage spends them. BlueMindRestClient is the one implementation; the interface exists so that the storage's single-flight and retry rules are tested against a hand-written double rather than a server.
  • Method Summary

    Modifier and Type
    Method
    Description
    Opens a session for an account, from its own password.
    sudo(URI apiRoot, String technicalAuthKey, String targetLogin)
    Opens a session in the name of another account, from a technical account's own session.
  • Method Details

    • login

      Opens a session for an account, from its own password.
      Parameters:
      account - the server, the login, the password and the origin
      Returns:
      the session BlueMind opened
      Throws:
      BlueMindAuthenticationException - when BlueMind refuses the credentials
      BlueMindUnreachableException - when BlueMind cannot be reached or does not answer in time
      BlueMindException - on any other failure, including a missing piece of configuration
    • sudo

      BlueMindLogin sudo(URI apiRoot, String technicalAuthKey, String targetLogin)
      Opens a session in the name of another account, from a technical account's own session.
      Parameters:
      apiRoot - any address on the server
      technicalAuthKey - the technical account's session key
      targetLogin - the account to act as
      Returns:
      the session BlueMind opened for that account
      Throws:
      BlueMindSessionRefusedException - when BlueMind refuses the technical session itself (HTTP 401)
      BlueMindAuthenticationException - when BlueMind refuses the sudo in its answer (status: Bad)
      BlueMindException - on any other failure