Package org.apache.iceberg.gcp.auth
Class GoogleAuthManager
java.lang.Object
org.apache.iceberg.gcp.auth.GoogleAuthManager
- All Implemented Interfaces:
- AutoCloseable,- AuthManager
An authentication manager that uses Google Credentials (typically Application Default
 Credentials) to create 
GoogleAuthSession instances.
 This manager can be configured with properties such as:
- gcp.auth.credentials-path: Path to a service account JSON key file. If not set, Application Default Credentials will be used.
- gcp.auth.scopes: Comma-separated list of OAuth scopes to request. Defaults to "https://www.googleapis.com/auth/cloud-platform".
- 
Field SummaryFields
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptioncatalogSession(RESTClient sharedClient, Map<String, String> properties) Returns a long-lived session tied to the catalog's lifecycle.voidclose()Closes the manager.contextualSession(SessionCatalog.SessionContext context, AuthSession parent) Returns a session for a specific context.initSession(RESTClient initClient, Map<String, String> properties) Initializes and returns a short-lived session, typically for fetching configuration.name()tableSession(TableIdentifier table, Map<String, String> properties, AuthSession parent) Returns a session for a specific table or view.Methods inherited from class java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.iceberg.rest.auth.AuthManagertableSession
- 
Field Details- 
DEFAULT_SCOPES- See Also:
 
- 
GCP_CREDENTIALS_PATH_PROPERTY- See Also:
 
- 
GCP_SCOPES_PROPERTY- See Also:
 
 
- 
- 
Constructor Details- 
GoogleAuthManager
 
- 
- 
Method Details- 
name
- 
initSessionInitializes and returns a short-lived session, typically for fetching configuration. This implementation reuses the long-lived catalog session logic.- Specified by:
- initSessionin interface- AuthManager
 
- 
catalogSessionReturns a long-lived session tied to the catalog's lifecycle. This session uses Google Application Default Credentials or a specified service account.- Specified by:
- catalogSessionin interface- AuthManager
- Parameters:
- sharedClient- The long-lived RESTClient (not used by this implementation for credential fetching).
- properties- Configuration properties for the auth manager.
- Returns:
- A GoogleAuthSession.
- Throws:
- UncheckedIOException- if credential loading fails.
 
- 
contextualSessionReturns a session for a specific context. Defaults to the catalog session. For GCP, tokens are typically not context-specific in this manner.- Specified by:
- contextualSessionin interface- AuthManager
 
- 
tableSessionpublic AuthSession tableSession(TableIdentifier table, Map<String, String> properties, AuthSession parent) Returns a session for a specific table or view. Defaults to the catalog session.- Specified by:
- tableSessionin interface- AuthManager
 
- 
closepublic void close()Closes the manager. This is a no-op for GoogleAuthManager.- Specified by:
- closein interface- AuthManager
- Specified by:
- closein interface- AutoCloseable
 
 
-