Class RoleTokenBinding
java.lang.Object
org.apache.hadoop.service.AbstractService
org.apache.hadoop.fs.s3a.auth.delegation.AbstractDTService
org.apache.hadoop.fs.s3a.auth.delegation.AbstractDelegationTokenBinding
org.apache.hadoop.fs.s3a.auth.delegation.SessionTokenBinding
org.apache.hadoop.fs.s3a.auth.delegation.RoleTokenBinding
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.hadoop.service.Service
Role Token support requests an explicit role and automatically restricts
that role to the given policy of the binding.
The session is locked down as much as possible.
-
Nested Class Summary
Nested classes/interfaces inherited from class org.apache.hadoop.fs.s3a.auth.delegation.AbstractDelegationTokenBinding
AbstractDelegationTokenBinding.TokenSecretManagerNested classes/interfaces inherited from interface org.apache.hadoop.service.Service
org.apache.hadoop.service.Service.STATE -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final StringError message when there is no Role ARN.Fields inherited from class org.apache.hadoop.fs.s3a.auth.delegation.SessionTokenBinding
CREDENTIALS_CONVERTED_TO_DELEGATION_TOKEN, LOG_EVENT, SESSION_TOKEN -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected StringGet the role of this token; subclasses should override this for better logging.bindToTokenIdentifier(AbstractS3ATokenIdentifier retrievedIdentifier) Returns a (wrapped)MarshalledCredentialProviderwhich requires the marshalled credentials to contain session secrets.Create a new subclass ofAbstractS3ATokenIdentifier.createTokenIdentifier(Optional<RoleModel.Policy> policy, EncryptionSecrets encryptionSecrets, org.apache.hadoop.io.Text renewer) Create the Token Identifier.Return a description.protected voidserviceInit(org.apache.hadoop.conf.Configuration conf) Methods inherited from class org.apache.hadoop.fs.s3a.auth.delegation.SessionTokenBinding
deployUnbonded, getDuration, getExpirationDateTime, getInvoker, getParentAuthChain, getTokenIdentifier, getUserAgentField, prepareSTSClient, serviceStart, serviceStop, setExpirationDateTime, setParentAuthChain, setTokenIdentifierMethods inherited from class org.apache.hadoop.fs.s3a.auth.delegation.AbstractDelegationTokenBinding
convertTokenIdentifier, createDelegationToken, createSecretMananger, deploy, getKind, getOwnerText, getSecretManagerPasssword, getTokenIssuingPolicy, toStringMethods inherited from class org.apache.hadoop.fs.s3a.auth.delegation.AbstractDTService
bindToFileSystem, getCanonicalUri, getOwner, getPolicyProvider, getStoreContext, requireServiceStarted, requireServiceStateMethods inherited from class org.apache.hadoop.service.AbstractService
close, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStop
-
Field Details
-
E_NO_ARN
Error message when there is no Role ARN.- See Also:
-
COMPONENT
- See Also:
-
-
Constructor Details
-
RoleTokenBinding
public RoleTokenBinding()Constructor. Name isNAME; token kind isDelegationConstants.ROLE_TOKEN_KIND.
-
-
Method Details
-
serviceInit
- Overrides:
serviceInitin classAbstractDTService- Throws:
Exception
-
bindToTokenIdentifier
public AWSCredentialProviderList bindToTokenIdentifier(AbstractS3ATokenIdentifier retrievedIdentifier) throws IOException Returns a (wrapped)MarshalledCredentialProviderwhich requires the marshalled credentials to contain session secrets.- Overrides:
bindToTokenIdentifierin classSessionTokenBinding- Parameters:
retrievedIdentifier- the incoming identifier.- Returns:
- the provider chain.
- Throws:
IOException- on failure
-
createTokenIdentifier
@RetryTranslated public RoleTokenIdentifier createTokenIdentifier(Optional<RoleModel.Policy> policy, EncryptionSecrets encryptionSecrets, org.apache.hadoop.io.Text renewer) throws IOException Create the Token Identifier. Looks for the optionDelegationConstants.DELEGATION_TOKEN_ROLE_ARNin the config and fail if it is not set.- Overrides:
createTokenIdentifierin classSessionTokenBinding- Parameters:
policy- the policy which will be used for the requested token.encryptionSecrets- encryption secrets.renewer- the principal permitted to renew the token.- Returns:
- the token.
- Throws:
IllegalArgumentException- if there is no role defined.IOException- any problem acquiring the role.
-
createEmptyIdentifier
Description copied from class:AbstractDelegationTokenBindingCreate a new subclass ofAbstractS3ATokenIdentifier. This is used in the secret manager.- Overrides:
createEmptyIdentifierin classSessionTokenBinding- Returns:
- an empty identifier.
-
getDescription
Description copied from class:AbstractDelegationTokenBindingReturn a description. This is logged during after service start and binding: it should be as informative as possible.- Overrides:
getDescriptionin classSessionTokenBinding- Returns:
- a description to log.
-
bindingName
Description copied from class:SessionTokenBindingGet the role of this token; subclasses should override this for better logging.- Overrides:
bindingNamein classSessionTokenBinding- Returns:
- the role of this token
-