Package org.apache.gravitino.credential
Class CredentialPropertyUtils
java.lang.Object
org.apache.gravitino.credential.CredentialPropertyUtils
Helper class to generate specific credential properties for different table format and engine.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidapplyIcebergCredentials(Credential[] credentials, Map<String, String> props) Injects vended credentials into Iceberg catalog properties.static voidapplyPaimonCredentials(Credential[] credentials, Map<String, String> props) Injects vended credentials into Paimon catalog properties.buildRefreshProps(String encodedCatalogName, String encodedNamespace, String encodedTableName, Map<String, String> credentialProperties) Builds refresh credential endpoint properties for Iceberg credential properties.filterCredentialProperties(Map<String, String> properties) Filters a property map down to only Iceberg credential-related keys.static Credential[]getCredentials(Catalog catalog) Returns credentials from the given catalog, or an empty array if the catalog does not support credential vending.toIcebergProperties(Credential credential) Transforms a specific credential into a map of Iceberg properties.
-
Constructor Details
-
CredentialPropertyUtils
public CredentialPropertyUtils()
-
-
Method Details
-
getCredentials
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
Injects vended credentials into Iceberg catalog properties. JDBC credentials are applied directly; all other credential types are converted viatoIcebergProperties(Credential).- Parameters:
credentials- the credentials to applyprops- the mutable properties map to update
-
applyPaimonCredentials
Injects vended credentials into Paimon catalog properties. Supports JDBC, S3, and OSS credential types.- Parameters:
credentials- the credentials to applyprops- the mutable properties map to update
-
toIcebergProperties
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
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 nameencodedNamespace- Iceberg REST encoded namespaceencodedTableName- Iceberg REST encoded table namecredentialProperties- Iceberg credential properties used to determine refresh keys- Returns:
- refresh endpoint properties keyed by Iceberg client config names
-