public abstract class SystemSettingsCredentialsProvider extends Object implements AwsCredentialsProvider
SdkSystemSetting.AWS_ACCESS_KEY_ID
,
SdkSystemSetting.AWS_SECRET_ACCESS_KEY
, and SdkSystemSetting.AWS_SESSION_TOKEN
system settings.
This does not load the credentials directly. Instead, the actual mapping of setting to credentials is done by child classes.
This allows us to separately load the credentials from system properties and environment variables so that customers can
remove one or the other from their credential chain, or build a different chain with these pieces of functionality separated.Constructor and Description |
---|
SystemSettingsCredentialsProvider() |
Modifier and Type | Method and Description |
---|---|
protected abstract Optional<String> |
loadSetting(SystemSetting setting)
Implemented by child classes to load the requested setting.
|
AwsCredentials |
resolveCredentials()
Returns
AwsCredentials that can be used to authorize an AWS request. |
public AwsCredentials resolveCredentials()
AwsCredentialsProvider
AwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider
can chose its own strategy for loading credentials. For example, an implementation might load credentials from an existing
key management system, or load new credentials when credentials are rotated.
If an error occurs during the loading of credentials or credentials could not be found, a runtime exception will be raised.
resolveCredentials
in interface AwsCredentialsProvider
protected abstract Optional<String> loadSetting(SystemSetting setting)
Copyright © 2019. All rights reserved.