Class CredentialPropertyUtils

java.lang.Object
org.apache.gravitino.credential.CredentialPropertyUtils

public class CredentialPropertyUtils extends Object
Helper class to generate specific credential properties for different table format and engine.
  • Constructor Details

    • CredentialPropertyUtils

      public CredentialPropertyUtils()
  • Method Details

    • getCredentials

      public static Credential[] getCredentials(Catalog catalog)
      Returns credentials from the given catalog, or an empty array if the catalog does not support credential vending.
      Parameters:
      catalog - the Gravitino catalog client
      Returns:
      credentials, never null
    • applyIcebergCredentials

      public static void applyIcebergCredentials(Credential[] credentials, Map<String,String> props)
      Injects vended credentials into Iceberg catalog properties. JDBC credentials are applied directly; all other credential types are converted via toIcebergProperties(Credential).
      Parameters:
      credentials - the credentials to apply
      props - the mutable properties map to update
    • applyPaimonCredentials

      public static void applyPaimonCredentials(Credential[] credentials, Map<String,String> props)
      Injects vended credentials into Paimon catalog properties. Supports JDBC, S3, and OSS credential types.
      Parameters:
      credentials - the credentials to apply
      props - the mutable properties map to update
    • toIcebergProperties

      public static Map<String,String> toIcebergProperties(Credential credential)
      Transforms a specific credential into a map of Iceberg properties.
      Parameters:
      credential - the credential to be transformed into Iceberg properties
      Returns:
      a map of Iceberg properties derived from the credential
    • filterCredentialProperties

      public static Map<String,String> filterCredentialProperties(Map<String,String> properties)
      Filters a property map down to only Iceberg credential-related keys.

      This is used when an Iceberg table load response contains many table and catalog properties, but the caller only needs the temporary credential properties that should be forwarded to the Iceberg client.

      Parameters:
      properties - the source properties to filter
      Returns:
      a map containing only credential properties recognized by Iceberg
    • buildRefreshProps

      public static Map<String,String> buildRefreshProps(String encodedCatalogName, String encodedNamespace, String encodedTableName, Map<String,String> credentialProperties)
      Builds refresh credential endpoint properties for Iceberg credential properties.
      Parameters:
      encodedCatalogName - Iceberg REST encoded catalog name
      encodedNamespace - Iceberg REST encoded namespace
      encodedTableName - Iceberg REST encoded table name
      credentialProperties - Iceberg credential properties used to determine refresh keys
      Returns:
      refresh endpoint properties keyed by Iceberg client config names