25#include <unordered_map>
40 std::string issued_token_type;
41 std::string credential;
43 std::string oauth2_server_uri;
44 std::unordered_map<std::string, std::string> optional_oauth_params;
69 virtual std::optional<OAuth2SessionInfo>
OAuth2Info()
const {
return std::nullopt; }
78 virtual Status
Close() {
return {}; }
89 std::unordered_map<std::string, std::string> headers);
110 const std::string& client_id,
const std::string& client_secret,
111 const std::string& scope,
bool keep_refreshed,
112 const std::unordered_map<std::string, std::string>& optional_oauth_params,
113 std::shared_ptr<HttpClient> client);
An authentication session that can authenticate outgoing HTTP requests.
Definition auth_session.h:48
virtual Result< HttpRequest > Authenticate(HttpRequest request)=0
Authenticate an outgoing HTTP request.
static std::shared_ptr< AuthSession > MakeDefault(std::unordered_map< std::string, std::string > headers)
Create a session with static headers.
virtual std::optional< OAuth2SessionInfo > OAuth2Info() const
Return OAuth2 metadata when this is an OAuth2 session.
Definition auth_session.h:69
static Result< std::shared_ptr< AuthSession > > MakeOAuth2(const OAuthTokenResponse &initial_token, const std::string &token_endpoint, const std::string &client_id, const std::string &client_secret, const std::string &scope, bool keep_refreshed, const std::unordered_map< std::string, std::string > &optional_oauth_params, std::shared_ptr< HttpClient > client)
Create an OAuth2 session with automatic token refresh.
virtual Status Close()
Close the session and release any resources.
Definition auth_session.h:78
Define REST HTTP request types.
Define symbol visibility macros for the REST catalog library.
REST catalog authentication APIs.
Definition auth_manager.h:34
std::expected< T, E > Result
Result alias.
Definition result.h:88
Define Result, Status, and error helpers.
An outgoing HTTP request. Mirrors Java's HttpRequest so signing implementations like SigV4 see method...
Definition http_request.h:89
Response from an OAuth2 token endpoint.
Definition types.h:300
OAuth2 metadata used to derive child authentication sessions.
Definition auth_session.h:38