Class GoogleAuthManager

java.lang.Object
org.apache.iceberg.gcp.auth.GoogleAuthManager
All Implemented Interfaces:
AutoCloseable, org.apache.iceberg.rest.auth.AuthManager

public class GoogleAuthManager extends Object implements org.apache.iceberg.rest.auth.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 neither this property nor gcp.auth.credentials-json is set, Application Default Credentials will be used.
  • gcp.auth.credentials-json: JSON string of a service account credential. If neither this property nor gcp.auth.credentials-path is 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 Details

  • Constructor Details

    • GoogleAuthManager

      public GoogleAuthManager(String managerName)
  • Method Details

    • name

      public String name()
    • initSession

      public org.apache.iceberg.rest.auth.AuthSession initSession(org.apache.iceberg.rest.RESTClient initClient, Map<String,String> properties)
      Initializes and returns a short-lived session, typically for fetching configuration. This implementation reuses the long-lived catalog session logic.
      Specified by:
      initSession in interface org.apache.iceberg.rest.auth.AuthManager
    • catalogSession

      public org.apache.iceberg.rest.auth.AuthSession catalogSession(org.apache.iceberg.rest.RESTClient sharedClient, Map<String,String> properties)
      Returns a long-lived session tied to the catalog's lifecycle. This session uses Google Application Default Credentials or a specified service account.
      Specified by:
      catalogSession in interface org.apache.iceberg.rest.auth.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.
    • contextualSession

      public org.apache.iceberg.rest.auth.AuthSession contextualSession(org.apache.iceberg.catalog.SessionCatalog.SessionContext context, org.apache.iceberg.rest.auth.AuthSession parent)
      Returns a session for a specific context. Defaults to the catalog session. For GCP, tokens are typically not context-specific in this manner.
      Specified by:
      contextualSession in interface org.apache.iceberg.rest.auth.AuthManager
    • tableSession

      public org.apache.iceberg.rest.auth.AuthSession tableSession(org.apache.iceberg.catalog.TableIdentifier table, Map<String,String> properties, org.apache.iceberg.rest.auth.AuthSession parent)
      Returns a session for a specific table or view. Defaults to the catalog session.
      Specified by:
      tableSession in interface org.apache.iceberg.rest.auth.AuthManager
    • close

      public void close()
      Closes the manager. This is a no-op for GoogleAuthManager.
      Specified by:
      close in interface org.apache.iceberg.rest.auth.AuthManager
      Specified by:
      close in interface AutoCloseable