Class AwsIrsaCredential

java.lang.Object
org.apache.gravitino.credential.AwsIrsaCredential
All Implemented Interfaces:
Credential

public class AwsIrsaCredential extends Object implements Credential
Generic AWS IRSA credential.
  • Field Details

    • AWS_IRSA_CREDENTIAL_TYPE

      public static final String AWS_IRSA_CREDENTIAL_TYPE
      The credential type for AWS IRSA credentials.
      See Also:
    • ACCESS_KEY_ID

      public static final String ACCESS_KEY_ID
      The key for AWS access key ID in credential info.
      See Also:
    • SECRET_ACCESS_KEY

      public static final String SECRET_ACCESS_KEY
      The key for AWS secret access key in credential info.
      See Also:
    • SESSION_TOKEN

      public static final String SESSION_TOKEN
      The key for AWS session token in credential info.
      See Also:
  • Constructor Details

    • AwsIrsaCredential

      public AwsIrsaCredential(String accessKeyId, String secretAccessKey, String sessionToken, long expireTimeInMs)
      Constructs an AWS IRSA credential with the specified parameters.
      Parameters:
      accessKeyId - the AWS access key ID
      secretAccessKey - the AWS secret access key
      sessionToken - the AWS session token
      expireTimeInMs - the expiration time in milliseconds
    • AwsIrsaCredential

      public AwsIrsaCredential()
      Default constructor for AWS IRSA credential.
  • Method Details

    • credentialType

      public String credentialType()
      Description copied from interface: Credential
      Returns the type of the credential. It should be the same as the credential type of the credential provider.
      Specified by:
      credentialType in interface Credential
      Returns:
      the credential type as a String.
    • expireTimeInMs

      public long expireTimeInMs()
      Description copied from interface: Credential
      Returns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.
      Specified by:
      expireTimeInMs in interface Credential
      Returns:
      the expiration time as a long.
    • credentialInfo

      public Map<String,String> credentialInfo()
      Description copied from interface: Credential
      Returns credential information.
      Specified by:
      credentialInfo in interface Credential
      Returns:
      a map of credential information.
    • initialize

      public void initialize(Map<String,String> credentialInfo, long expireTimeInMs)
      Description copied from interface: Credential
      Initialize the credential with the credential information.

      This method is invoked to deserialize the credential in client side.

      Specified by:
      initialize in interface Credential
      Parameters:
      credentialInfo - The credential information from Credential.credentialInfo().
      expireTimeInMs - The expire-time from Credential.expireTimeInMs().
    • accessKeyId

      public String accessKeyId()
      Returns the AWS access key ID.
      Returns:
      the access key ID
    • secretAccessKey

      public String secretAccessKey()
      Returns the AWS secret access key.
      Returns:
      the secret access key
    • sessionToken

      public String sessionToken()
      Returns the AWS session token.
      Returns:
      the session token