24#include <unordered_map>
28#include "iceberg/catalog/rest/iceberg_rest_export.h"
29#include "iceberg/result.h"
32class AWSCredentialsProvider;
35namespace Aws::Client {
39namespace iceberg::rest::auth {
46ICEBERG_REST_EXPORT Status InitializeAwsSdk();
51ICEBERG_REST_EXPORT Status FinalizeAwsSdk();
53ICEBERG_REST_EXPORT
bool IsAwsSdkInitialized();
54ICEBERG_REST_EXPORT
bool IsAwsSdkFinalized();
70 static constexpr std::string_view kEmptyBodySha256 =
71 "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";
74 static constexpr std::string_view kRelocatedHeaderPrefix =
"Original-";
80 static Result<std::shared_ptr<SigV4AuthSession>>
Make(
81 std::shared_ptr<AuthSession> delegate, std::string signing_region,
82 std::string signing_name,
83 std::shared_ptr<Aws::Auth::AWSCredentialsProvider> credentials_provider);
91 const std::shared_ptr<AuthSession>& delegate()
const {
return delegate_; }
96 return credentials_provider_;
101 std::shared_ptr<AuthSession> delegate, std::string signing_region,
102 std::string signing_name,
103 std::shared_ptr<Aws::Auth::AWSCredentialsProvider> credentials_provider);
105 std::shared_ptr<AuthSession> delegate_;
106 std::string signing_region_;
107 std::string signing_name_;
108 std::shared_ptr<Aws::Auth::AWSCredentialsProvider> credentials_provider_;
109 std::unique_ptr<Aws::Client::AWSAuthV4Signer> signer_;
122 const std::unordered_map<std::string, std::string>& properties)
override;
126 const std::unordered_map<std::string, std::string>& properties)
override;
129 const SessionContext& context, std::shared_ptr<AuthSession> parent)
override;
133 const std::unordered_map<std::string, std::string>& properties,
134 std::shared_ptr<AuthSession> parent)
override;
139 Result<std::shared_ptr<AuthSession>> WrapSession(
140 std::shared_ptr<AuthSession> delegate_session,
141 const std::unordered_map<std::string, std::string>& properties,
142 std::shared_ptr<Aws::Auth::AWSCredentialsProvider> credentials_provider);
144 std::unique_ptr<AuthManager> delegate_;
145 std::unordered_map<std::string, std::string> catalog_properties_;
Authentication manager interface for REST catalog.
Authentication session interface for REST catalog.
HTTP client for making requests to Iceberg REST Catalog API.
Definition http_client.h:71
Produces authentication sessions for catalog and table requests.
Definition auth_manager.h:37
An authentication session that can authenticate outgoing HTTP requests.
Definition auth_session.h:37
An AuthManager that produces SigV4AuthSession instances.
Definition sigv4_auth_manager_internal.h:115
Result< std::shared_ptr< AuthSession > > InitSession(HttpClient &init_client, const std::unordered_map< std::string, std::string > &properties) override
Create a short-lived session used to contact the configuration endpoint.
Result< std::shared_ptr< AuthSession > > CatalogSession(HttpClient &shared_client, const std::unordered_map< std::string, std::string > &properties) override
Create the long-lived catalog session that acts as the parent session.
Status Close() override
Release resources held by the manager.
Result< std::shared_ptr< AuthSession > > TableSession(const TableIdentifier &table, const std::unordered_map< std::string, std::string > &properties, std::shared_ptr< AuthSession > parent) override
Create or reuse a session scoped to a single table/view.
Result< std::shared_ptr< AuthSession > > ContextualSession(const SessionContext &context, std::shared_ptr< AuthSession > parent) override
Create or reuse a session for a specific context.
An AuthSession that signs requests with AWS SigV4.
Definition sigv4_auth_manager_internal.h:67
Result< HttpRequest > Authenticate(HttpRequest request) override
Authenticate an outgoing HTTP request.
const std::shared_ptr< Aws::Auth::AWSCredentialsProvider > & credentials_provider() const
Definition sigv4_auth_manager_internal.h:95
Status Close() override
Close the session and release any resources.
static Result< std::shared_ptr< SigV4AuthSession > > Make(std::shared_ptr< AuthSession > delegate, std::string signing_region, std::string signing_name, std::shared_ptr< Aws::Auth::AWSCredentialsProvider > credentials_provider)
Creates a session registered with the AWS SDK lifecycle.
Session state used to bind catalog operations to a caller context.
Definition session_context.h:39
Identifies a table in iceberg catalog.
Definition table_identifier.h:46
An outgoing HTTP request. Mirrors Java's HttpRequest so signing implementations like SigV4 see method...
Definition http_request.h:86