public final class MarshalledCredentialBinding extends Object
MarshalledCredentialBinding class to/from AWS classes.
This is to keep that class isolated and not dependent on aws-sdk JARs
to load.| Modifier and Type | Field and Description |
|---|---|
static String |
NO_AWS_CREDENTIALS
Error text on empty credentials: "No AWS credentials".
|
| Modifier and Type | Method and Description |
|---|---|
static MarshalledCredentials |
fromAWSCredentials(com.amazonaws.auth.AWSSessionCredentials credentials)
Create from a set of AWS credentials.
|
static MarshalledCredentials |
fromEnvironment(Map<String,String> env)
Build a set of credentials from the environment.
|
static MarshalledCredentials |
fromFileSystem(URI uri,
org.apache.hadoop.conf.Configuration conf)
Loads the credentials from the owning S3A FS, including
from Hadoop credential providers.
|
static MarshalledCredentials |
fromSTSCredentials(com.amazonaws.services.securitytoken.model.Credentials credentials)
Create a set of marshalled credentials from a set of credentials
issued by an STS call.
|
static MarshalledCredentials |
requestSessionCredentials(com.amazonaws.auth.AWSCredentialsProvider parentCredentials,
com.amazonaws.ClientConfiguration awsConf,
String stsEndpoint,
String stsRegion,
int duration,
Invoker invoker)
Request a set of credentials from an STS endpoint.
|
static com.amazonaws.auth.AWSCredentials |
toAWSCredentials(MarshalledCredentials marshalled,
MarshalledCredentials.CredentialTypeRequired typeRequired,
String component)
Create an AWS credential set from a set of marshalled credentials.
|
public static final String NO_AWS_CREDENTIALS
public static MarshalledCredentials fromSTSCredentials(com.amazonaws.services.securitytoken.model.Credentials credentials)
credentials - AWS-provided session credentialspublic static MarshalledCredentials fromAWSCredentials(com.amazonaws.auth.AWSSessionCredentials credentials)
credentials - source credential.public static MarshalledCredentials fromEnvironment(Map<String,String> env)
env - environment.public static MarshalledCredentials fromFileSystem(URI uri, org.apache.hadoop.conf.Configuration conf) throws IOException
uri - binding URIconf - configuration to load fromIOException - on any load failurepublic static com.amazonaws.auth.AWSCredentials toAWSCredentials(MarshalledCredentials marshalled, MarshalledCredentials.CredentialTypeRequired typeRequired, String component) throws NoAuthWithAWSException, NoAwsCredentialsException
marshalled - marshalled credentialstypeRequired - type of credentials requiredcomponent - component name for exception messages.NoAuthWithAWSException - validation failureNoAwsCredentialsException - the credentials are actually empty.@Retries.RetryTranslated public static MarshalledCredentials requestSessionCredentials(com.amazonaws.auth.AWSCredentialsProvider parentCredentials, com.amazonaws.ClientConfiguration awsConf, String stsEndpoint, String stsRegion, int duration, Invoker invoker) throws IOException
parentCredentials - the parent credentials needed to talk to STSawsConf - AWS client configurationstsEndpoint - an endpoint, use "" for nonestsRegion - region; use if the endpoint isn't the AWS default.duration - duration of the credentials in seconds. Minimum value: 900.invoker - invoker to use for retrying the call.IOException - on a failure of the requestCopyright © 2008–2022 Apache Software Foundation. All rights reserved.