public class SessionTokenBinding extends AbstractDelegationTokenBinding
AbstractDelegationTokenBinding.TokenSecretManager| Modifier and Type | Field and Description |
|---|---|
static String |
CREDENTIALS_CONVERTED_TO_DELEGATION_TOKEN
A message added to the standard origin string when the DT is
built from session credentials passed in.
|
static Invoker.Retried |
LOG_EVENT
Log retries at debug.
|
static String |
SESSION_TOKEN |
| Modifier | Constructor and Description |
|---|---|
|
SessionTokenBinding()
Constructor for reflection.
|
protected |
SessionTokenBinding(String name,
org.apache.hadoop.io.Text kind)
Constructor for subclasses.
|
| Modifier and Type | Method and Description |
|---|---|
protected String |
bindingName()
Get the role of this token; subclasses should override this
for better logging.
|
AWSCredentialProviderList |
bindToTokenIdentifier(AbstractS3ATokenIdentifier retrievedIdentifier)
Sets the field
tokenIdentifier to the extracted/cast
session token identifier, and expirationDateTime to
any expiration passed in. |
SessionTokenIdentifier |
createEmptyIdentifier()
Create a new subclass of
AbstractS3ATokenIdentifier. |
SessionTokenIdentifier |
createTokenIdentifier(Optional<RoleModel.Policy> policy,
EncryptionSecrets encryptionSecrets,
org.apache.hadoop.io.Text renewer)
Create a token identifier with all the information needed
to be included in a delegation token.
|
AWSCredentialProviderList |
deployUnbonded()
Return an unbonded provider chain.
|
String |
getDescription()
Return a description.
|
long |
getDuration()
Duration of sessions.
|
protected Optional<OffsetDateTime> |
getExpirationDateTime()
Expiration date time as passed in from source.
|
protected Invoker |
getInvoker()
Get the invoker for STS calls.
|
protected Optional<SessionTokenIdentifier> |
getTokenIdentifier()
Token identifier bound to.
|
String |
getUserAgentField()
UA field contains the UUID of the token if present.
|
protected Optional<STSClientFactory.STSClient> |
prepareSTSClient()
Get the client to AWS STS.
|
protected void |
serviceStart()
Service start will read in all configuration options
then build that client.
|
protected void |
serviceStop() |
protected void |
setExpirationDateTime(Optional<OffsetDateTime> expirationDateTime) |
protected void |
setTokenIdentifier(Optional<SessionTokenIdentifier> tokenIdentifier) |
convertTokenIdentifier, createDelegationToken, createSecretMananger, getKind, getOwnerText, getSecretManagerPasssword, getTokenIssuingPolicy, toStringbindToFileSystem, getCanonicalUri, getOwner, getPolicyProvider, getStoreContext, requireServiceStarted, requireServiceState, serviceInitclose, getBlockers, getConfig, getFailureCause, getFailureState, getLifecycleHistory, getName, getServiceState, getStartTime, init, isInState, noteFailure, putBlocker, registerGlobalListener, registerServiceListener, removeBlocker, setConfig, start, stop, unregisterGlobalListener, unregisterServiceListener, waitForServiceToStoppublic static final String CREDENTIALS_CONVERTED_TO_DELEGATION_TOKEN
public static final String SESSION_TOKEN
public static final Invoker.Retried LOG_EVENT
public SessionTokenBinding()
protected SessionTokenBinding(String name, org.apache.hadoop.io.Text kind)
name - binding name.kind - token kind.protected void serviceStart()
throws Exception
serviceStart in class AbstractDelegationTokenBindingException - failure.protected void serviceStop()
throws Exception
serviceStop in class org.apache.hadoop.service.AbstractServiceExceptionpublic AWSCredentialProviderList deployUnbonded() throws IOException
deployUnbonded in class AbstractDelegationTokenBindingIOException - any failure.protected Invoker getInvoker()
public AWSCredentialProviderList bindToTokenIdentifier(AbstractS3ATokenIdentifier retrievedIdentifier) throws IOException
tokenIdentifier to the extracted/cast
session token identifier, and expirationDateTime to
any expiration passed in.bindToTokenIdentifier in class AbstractDelegationTokenBindingretrievedIdentifier - the unmarshalled dataIOException - failurepublic String getDescription()
AbstractDelegationTokenBindinggetDescription in class AbstractDelegationTokenBindingprotected String bindingName()
public String getUserAgentField()
getUserAgentField in class AbstractDelegationTokenBindingprotected Optional<STSClientFactory.STSClient> prepareSTSClient() throws IOException
IOException - any failure to bind to STS.public long getDuration()
@Retries.RetryTranslated public SessionTokenIdentifier createTokenIdentifier(Optional<RoleModel.Policy> policy, EncryptionSecrets encryptionSecrets, org.apache.hadoop.io.Text renewer) throws IOException
AbstractDelegationTokenBindingAbstractDelegationTokenBinding.createDelegationToken(Optional, EncryptionSecrets, Text)
is overridden, this method can be replaced with a stub.createTokenIdentifier in class AbstractDelegationTokenBindingpolicy - minimum policy to use, if known.encryptionSecrets - encryption secrets for the token.renewer - the principal permitted to renew the token.IOException - failure creating the token data.public SessionTokenIdentifier createEmptyIdentifier()
AbstractDelegationTokenBindingAbstractS3ATokenIdentifier.
This is used in the secret manager.createEmptyIdentifier in class AbstractDelegationTokenBindingprotected Optional<OffsetDateTime> getExpirationDateTime()
protected void setExpirationDateTime(Optional<OffsetDateTime> expirationDateTime)
protected Optional<SessionTokenIdentifier> getTokenIdentifier()
protected void setTokenIdentifier(Optional<SessionTokenIdentifier> tokenIdentifier)
Copyright © 2008–2022 Apache Software Foundation. All rights reserved.