Manages the realm -> Authenticator mapping for HTTP authentication in libprocess. Endpoints may map to a realm. Each realm may have an authenticator set here, through which all requests to matching endpoints will be authenticated.
| 36 | // here, through which all requests to matching |
| 37 | // endpoints will be authenticated. |
| 38 | class AuthenticatorManager |
| 39 | { |
| 40 | public: |
| 41 | AuthenticatorManager(); |
| 42 | ~AuthenticatorManager(); |
| 43 | |
| 44 | // Sets the authenticator for the realm; this will |
| 45 | // overwrite any previous authenticator for the realm. |
| 46 | Future<Nothing> setAuthenticator( |
| 47 | const std::string& realm, |
| 48 | Owned<Authenticator> authenticator); |
| 49 | |
| 50 | // Unsets the authenticator for the realm. |
| 51 | Future<Nothing> unsetAuthenticator(const std::string& realm); |
| 52 | |
| 53 | // Authenticates the request, will return None if no |
| 54 | // authentication is required because there is no |
| 55 | // authenticator for the realm. |
| 56 | Future<Option<AuthenticationResult>> authenticate( |
| 57 | const Request& request, |
| 58 | const std::string& realm); |
| 59 | |
| 60 | private: |
| 61 | Owned<AuthenticatorManagerProcess> process; |
| 62 | }; |
| 63 | |
| 64 | } // namespace authentication { |
| 65 | } // namespace http { |
nothing calls this directly
no outgoing calls
no test coverage detected