* The Authenticator interface allows us to implement different * authenticators based on the scheme (e.g. Basic, Digest, SPNEGO). */
| 101 | * authenticators based on the scheme (e.g. Basic, Digest, SPNEGO). |
| 102 | */ |
| 103 | class Authenticator |
| 104 | { |
| 105 | public: |
| 106 | virtual ~Authenticator() {} |
| 107 | |
| 108 | /** |
| 109 | * Authenticates the given HTTP request. |
| 110 | * |
| 111 | * NOTE: Libprocess does not perform any timeout handling of |
| 112 | * the returned future, it is thus required that this future |
| 113 | * is satisfied within a finite amount of time! Otherwise, |
| 114 | * the socket will be remain open indefinitely! |
| 115 | */ |
| 116 | // TODO(arojas): Add support for per-connection authentication. |
| 117 | // Note that passing the socket is dangerous here because the |
| 118 | // authenticator may hold a copy preventing the reference |
| 119 | // counted socket from being closed. |
| 120 | virtual Future<AuthenticationResult> authenticate( |
| 121 | const Request& request) = 0; |
| 122 | |
| 123 | /** |
| 124 | * Returns the name of the authentication scheme implemented. |
| 125 | */ |
| 126 | virtual std::string scheme() const = 0; |
| 127 | }; |
| 128 | |
| 129 | |
| 130 | /** |
nothing calls this directly
no outgoing calls
no test coverage detected