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(software.amazon.awssdk.auth.credentials.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(software.amazon.awssdk.services.sts.model.Credentials credentials)
Create a set of marshalled credentials from a set of credentials
issued by an STS call.
|
static MarshalledCredentials |
requestSessionCredentials(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider parentCredentials,
org.apache.hadoop.conf.Configuration configuration,
String stsEndpoint,
String stsRegion,
int duration,
Invoker invoker,
String bucket)
Request a set of credentials from an STS endpoint.
|
static software.amazon.awssdk.auth.credentials.AwsCredentials |
toAWSCredentials(MarshalledCredentials marshalled,
MarshalledCredentials.CredentialTypeRequired typeRequired,
String component)
Create an AWS credential set from a set of marshalled credentials.
|
@VisibleForTesting public static final String NO_AWS_CREDENTIALS
public static MarshalledCredentials fromSTSCredentials(software.amazon.awssdk.services.sts.model.Credentials credentials)
credentials - AWS-provided session credentialspublic static MarshalledCredentials fromAWSCredentials(software.amazon.awssdk.auth.credentials.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 software.amazon.awssdk.auth.credentials.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(software.amazon.awssdk.auth.credentials.AwsCredentialsProvider parentCredentials, org.apache.hadoop.conf.Configuration configuration, String stsEndpoint, String stsRegion, int duration, Invoker invoker, String bucket) throws IOException
parentCredentials - the parent credentials needed to talk to STSconfiguration - 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.bucket - bucket name.IOException - on a failure of the requestCopyright © 2008–2024 Apache Software Foundation. All rights reserved.