public class GcsDelegationTokens extends Object
Constructor and Description |
---|
GcsDelegationTokens() |
Modifier and Type | Method and Description |
---|---|
void |
bindToAnyDelegationToken()
Attempt to bind to any existing DT, including unmarshalling its contents and creating the GCP
credential provider used to authenticate the client.
|
void |
bindToDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token)
Bind to a delegation token retrieved for this filesystem.
|
void |
bindToFileSystem(GoogleHadoopFileSystemBase fs,
org.apache.hadoop.io.Text service)
Bind to the filesystem.
|
AccessTokenProvider |
deployUnbonded()
Perform the unbonded deployment operations.
|
static org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier |
extractIdentifier(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token)
From a token, get the session token identifier.
|
AccessTokenProvider |
getAccessTokenProvider() |
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
getBoundDT()
Get any bound DT.
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
getBoundOrNewDT(String renewer)
Get any bound DT or create a new one.
|
org.apache.hadoop.io.Text |
getService() |
void |
init(org.apache.hadoop.conf.Configuration conf) |
boolean |
isBoundToDT()
Predicate: is there a bound DT?
|
org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> |
selectTokenFromFsOwner()
Find a token for the FS user and service name.
|
public GcsDelegationTokens() throws IOException
IOException
public void init(org.apache.hadoop.conf.Configuration conf)
public org.apache.hadoop.io.Text getService()
public AccessTokenProvider getAccessTokenProvider()
public AccessTokenProvider deployUnbonded() throws IOException
accessTokenProvider
IOException
- any failure.public void bindToAnyDelegationToken() throws IOException
If successful:
boundDT
is set to the retrieved token.
accessTokenProvider
is set to the credential provider(s) returned by the token
binding.
deployUnbonded()
is called for the unbonded codepath instead, which
will set accessTokenProvider
to its value.
This means after this call (and only after) the token operations can be invoked.
IOException
- selection/extraction/validation failure.public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> selectTokenFromFsOwner() throws IOException
IOException
- on a failure to unmarshall the token.public void bindToFileSystem(GoogleHadoopFileSystemBase fs, org.apache.hadoop.io.Text service) throws IOException
init()
.
Important: This binding will happen during FileSystem.initialize(); the FS is not live for actual use and will not yet have interacted with GCS services.
fs
- owning FS.IOException
- failure.public void bindToDelegationToken(org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token) throws IOException
boundDT
is set to token
.
accessTokenProvider
is set to the credential provider(s) returned by the token
binding.
token
- token to decode and bind to.IOException
- selection/extraction/validation failure.public boolean isBoundToDT()
boundDT
.public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> getBoundDT()
public org.apache.hadoop.security.token.Token<org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> getBoundOrNewDT(String renewer) throws IOException
IOException
- if one cannot be createdpublic static org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier extractIdentifier(org.apache.hadoop.security.token.Token<? extends org.apache.hadoop.security.token.delegation.web.DelegationTokenIdentifier> token) throws IOException
token
- token to processIOException
- failure to validate/read data encoded in identifier.IllegalArgumentException
- if the token isn't an GCP session tokenCopyright © 2022. All rights reserved.