iceberg-cpp
Loading...
Searching...
No Matches
Public Member Functions | List of all members
iceberg::rest::auth::AuthManager Class Referenceabstract

Produces authentication sessions for catalog and table requests. More...

#include <auth_manager.h>

Inheritance diagram for iceberg::rest::auth::AuthManager:
iceberg::rest::auth::BasicAuthManager iceberg::rest::auth::NoopAuthManager iceberg::rest::auth::OAuth2Manager

Public Member Functions

virtual Result< std::shared_ptr< AuthSession > > InitSession (HttpClient &init_client, const std::unordered_map< std::string, std::string > &properties)
 Create a short-lived session used to contact the configuration endpoint.
 
virtual Result< std::shared_ptr< AuthSession > > CatalogSession (HttpClient &shared_client, const std::unordered_map< std::string, std::string > &properties)=0
 Create the long-lived catalog session that acts as the parent session.
 
virtual Result< std::shared_ptr< AuthSession > > ContextualSession (const std::unordered_map< std::string, std::string > &context, std::shared_ptr< AuthSession > parent)
 Create or reuse a session for a specific context.
 
virtual Result< std::shared_ptr< AuthSession > > TableSession (const TableIdentifier &table, const std::unordered_map< std::string, std::string > &properties, std::shared_ptr< AuthSession > parent)
 Create or reuse a session scoped to a single table/view.
 
virtual Status Close ()
 Release resources held by the manager.
 

Detailed Description

Produces authentication sessions for catalog and table requests.

Member Function Documentation

◆ CatalogSession()

virtual Result< std::shared_ptr< AuthSession > > iceberg::rest::auth::AuthManager::CatalogSession ( HttpClient shared_client,
const std::unordered_map< std::string, std::string > &  properties 
)
pure virtual

Create the long-lived catalog session that acts as the parent session.

This session is used for all catalog-level operations (list namespaces, list tables, etc.) and serves as the parent session for contextual and table-specific sessions. It is owned by the catalog and reused throughout the catalog's lifetime.

Parameters
shared_clientHTTP client owned by the catalog and reused for auth calls.
propertiesCatalog properties (client config + server defaults).
Returns
Session for catalog operations or an error if authentication cannot be set up.

Implemented in iceberg::rest::auth::NoopAuthManager, iceberg::rest::auth::BasicAuthManager, and iceberg::rest::auth::OAuth2Manager.

◆ Close()

virtual Status iceberg::rest::auth::AuthManager::Close ( )
inlinevirtual

Release resources held by the manager.

Returns
Status of the close operation.

◆ ContextualSession()

Result< std::shared_ptr< AuthSession > > iceberg::rest::auth::AuthManager::ContextualSession ( const std::unordered_map< std::string, std::string > &  context,
std::shared_ptr< AuthSession parent 
)
virtual

Create or reuse a session for a specific context.

This method is used by SessionCatalog to create sessions for different contexts (e.g., different users or tenants).

Parameters
contextContext properties (e.g., user credentials, tenant info).
parentCatalog session to inherit from or return as-is.
Returns
A context-specific session, or the parent session if no context-specific session is needed, or an error if session creation fails.

◆ InitSession()

Result< std::shared_ptr< AuthSession > > iceberg::rest::auth::AuthManager::InitSession ( HttpClient init_client,
const std::unordered_map< std::string, std::string > &  properties 
)
virtual

Create a short-lived session used to contact the configuration endpoint.

This session is used only during catalog initialization to fetch server configuration and perform initial authentication. It is typically discarded after initialization.

Parameters
init_clientHTTP client used for initialization requests.
propertiesClient configuration supplied by the catalog.
Returns
Session for initialization or an error if credentials cannot be acquired.

Reimplemented in iceberg::rest::auth::OAuth2Manager.

◆ TableSession()

Result< std::shared_ptr< AuthSession > > iceberg::rest::auth::AuthManager::TableSession ( const TableIdentifier table,
const std::unordered_map< std::string, std::string > &  properties,
std::shared_ptr< AuthSession parent 
)
virtual

Create or reuse a session scoped to a single table/view.

This method is called when loading a table that may have table-specific auth properties returned by the server.

Parameters
tableTarget table identifier.
propertiesTable-specific auth properties returned by the server.
parentCatalog or contextual session to inherit from or return as-is.
Returns
A table-specific session, or the parent session if no table-specific session is needed, or an error if session creation fails.

The documentation for this class was generated from the following files: