Package org.apache.gravitino.credential
Class AwsIrsaCredential
java.lang.Object
org.apache.gravitino.credential.AwsIrsaCredential
- All Implemented Interfaces:
Credential
Generic AWS IRSA credential.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final String
The key for AWS access key ID in credential info.static final String
The credential type for AWS IRSA credentials.static final String
The key for AWS secret access key in credential info.static final String
The key for AWS session token in credential info.Fields inherited from interface org.apache.gravitino.credential.Credential
CREDENTIAL_TYPE, EXPIRE_TIME_IN_MS
-
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for AWS IRSA credential.AwsIrsaCredential
(String accessKeyId, String secretAccessKey, String sessionToken, long expireTimeInMs) Constructs an AWS IRSA credential with the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionReturns the AWS access key ID.Returns credential information.Returns the type of the credential.long
Returns the expiration time of the credential in milliseconds since the epoch, 0 means not expire.void
initialize
(Map<String, String> credentialInfo, long expireTimeInMs) Initialize the credential with the credential information.Returns the AWS secret access key.Returns the AWS session token.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.gravitino.credential.Credential
toProperties
-
Field Details
-
AWS_IRSA_CREDENTIAL_TYPE
The credential type for AWS IRSA credentials.- See Also:
-
ACCESS_KEY_ID
The key for AWS access key ID in credential info.- See Also:
-
SECRET_ACCESS_KEY
The key for AWS secret access key in credential info.- See Also:
-
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 IDsecretAccessKey
- the AWS secret access keysessionToken
- the AWS session tokenexpireTimeInMs
- the expiration time in milliseconds
-
AwsIrsaCredential
public AwsIrsaCredential()Default constructor for AWS IRSA credential.
-
-
Method Details
-
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 interfaceCredential
- 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 interfaceCredential
- Returns:
- the expiration time as a long.
-
credentialInfo
Description copied from interface:Credential
Returns credential information.- Specified by:
credentialInfo
in interfaceCredential
- Returns:
- a map of credential information.
-
initialize
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 interfaceCredential
- Parameters:
credentialInfo
- The credential information fromCredential.credentialInfo()
.expireTimeInMs
- The expire-time fromCredential.expireTimeInMs()
.
-
accessKeyId
Returns the AWS access key ID.- Returns:
- the access key ID
-
secretAccessKey
Returns the AWS secret access key.- Returns:
- the secret access key
-
sessionToken
Returns the AWS session token.- Returns:
- the session token
-