13 #ifndef __PROCESS_AUTHENTICATOR_HPP__ 14 #define __PROCESS_AUTHENTICATOR_HPP__ 27 namespace authentication {
29 class BasicAuthenticatorProcess;
31 class JWTAuthenticatorProcess;
32 #endif // USE_SSL_SOCKET 60 return this->
value == that;
65 return !(*
this == that);
126 virtual std::string scheme()
const = 0;
138 const std::string& realm,
146 std::string scheme()
const override;
153 #ifdef USE_SSL_SOCKET 167 JWTAuthenticator(
const std::string& realm,
const std::string& secret);
169 ~JWTAuthenticator()
override;
174 std::string scheme()
const override;
179 #endif // USE_SSL_SOCKET 185 #endif // __PROCESS_AUTHENTICATOR_HPP__ virtual ~Authenticator()
Definition: authenticator.hpp:106
Future< Response > request(const Request &request, bool streamedResponse=false)
Asynchronously sends an HTTP request to the process and returns the HTTP response once the entire res...
Principal(const Option< std::string > &_value, const hashmap< std::string, std::string > &_claims)
Definition: authenticator.hpp:48
bool operator==(const std::string &that) const
Definition: authenticator.hpp:58
Option< std::string > value
Definition: authenticator.hpp:68
Option< Principal > principal
Definition: authenticator.hpp:93
Represents the result of authenticating a request.
Definition: authenticator.hpp:91
Option< Forbidden > forbidden
Definition: authenticator.hpp:95
The Authenticator interface allows us to implement different authenticators based on the scheme (e...
Definition: authenticator.hpp:103
Implements the "Basic" authentication scheme using a fixed set of credentials.
Definition: authenticator.hpp:134
Principal(const Option< std::string > &_value)
Definition: authenticator.hpp:45
bool operator!=(const std::string &that) const
Definition: authenticator.hpp:63
bool operator==(const Principal &that) const
Definition: authenticator.hpp:53
Option< Unauthorized > unauthorized
Definition: authenticator.hpp:94
Contains information associated with an authenticated principal.
Definition: authenticator.hpp:41
Definition: executor.hpp:48
URI http(const std::string &host, const std::string &path="/", const Option< int > &port=None(), const Option< std::string > &query=None(), const Option< std::string > &fragment=None(), const Option< std::string > &user=None(), const Option< std::string > &password=None())
Creates an http URI with the given parameters.
Definition: http.hpp:35
hashmap< std::string, std::string > claims
Definition: authenticator.hpp:69
std::ostream & operator<<(std::ostream &stream, const Principal &principal)
Definition: future.hpp:58