auth
AuthManager
¶
Bases: ABC
Abstract base class for Authentication Managers used to supply authorization headers to HTTP clients (e.g. requests.Session).
Subclasses must implement the auth_header
method to return an Authorization header value.
Source code in pyiceberg/catalog/rest/auth.py
AuthManagerAdapter
¶
Bases: AuthBase
A requests.auth.AuthBase
adapter that integrates an AuthManager
into a requests.Session
to automatically attach the appropriate Authorization header to every request.
This adapter is useful when working with requests.Session.auth
and allows reuse of authentication strategies defined by AuthManager
.
This AuthManagerAdapter is only intended to be used against the REST Catalog
Server that expects the Authorization Header.
Source code in pyiceberg/catalog/rest/auth.py
__call__(request)
¶
Modify the outgoing request to include the Authorization header.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
request
|
PreparedRequest
|
The HTTP request being prepared. |
required |
Returns:
Type | Description |
---|---|
PreparedRequest
|
requests.PreparedRequest: The modified request with Authorization header. |
Source code in pyiceberg/catalog/rest/auth.py
__init__(auth_manager)
¶
Initialize AuthManagerAdapter.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
auth_manager
|
AuthManager
|
An instance of an AuthManager subclass. |
required |
AuthManagerFactory
¶
Source code in pyiceberg/catalog/rest/auth.py
create(class_or_name, config)
classmethod
¶
Create an AuthManager by name or fully-qualified class path.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
class_or_name
|
str
|
Either a name like 'oauth2' or a full class path like 'my.module.CustomAuthManager' |
required |
config
|
Dict[str, Any]
|
Configuration passed to the AuthManager constructor |
required |
Returns:
Name | Type | Description |
---|---|---|
AuthManager |
AuthManager
|
An instantiated AuthManager subclass |
Source code in pyiceberg/catalog/rest/auth.py
register(name, auth_manager_class)
classmethod
¶
Register a string name to a known AuthManager class.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
name
|
str
|
unique name like 'oauth2' to register the AuthManager with |
required |
auth_manager_class
|
Type[AuthManager]
|
Implementation of AuthManager |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Source code in pyiceberg/catalog/rest/auth.py
BasicAuthManager
¶
Bases: AuthManager
AuthManager implementation that supports basic password auth.
Source code in pyiceberg/catalog/rest/auth.py
GoogleAuthManager
¶
Bases: AuthManager
An auth manager that is responsible for handling Google credentials.
Source code in pyiceberg/catalog/rest/auth.py
__init__(credentials_path=None, scopes=None)
¶
Initialize GoogleAuthManager.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
credentials_path
|
Optional[str]
|
Optional path to Google credentials JSON file. |
None
|
scopes
|
Optional[List[str]]
|
Optional list of OAuth2 scopes. |
None
|
Source code in pyiceberg/catalog/rest/auth.py
LegacyOAuth2AuthManager
¶
Bases: AuthManager
Legacy OAuth2 AuthManager implementation.
This class exists for backward compatibility, and will be removed in PyIceberg 1.0.0 in favor of OAuth2AuthManager.
Source code in pyiceberg/catalog/rest/auth.py
NoopAuthManager
¶
OAuth2AuthManager
¶
Bases: AuthManager
Auth Manager implementation that supports OAuth2 as defined in IETF RFC6749.
Source code in pyiceberg/catalog/rest/auth.py
OAuth2TokenProvider
¶
Thread-safe OAuth2 token provider with token refresh support.