Class SystemSettingsCredentialsProvider
- java.lang.Object
-
- software.amazon.awssdk.auth.credentials.internal.SystemSettingsCredentialsProvider
-
- All Implemented Interfaces:
AwsCredentialsProvider
,IdentityProvider<AwsCredentialsIdentity>
- Direct Known Subclasses:
EnvironmentVariableCredentialsProvider
,SystemPropertyCredentialsProvider
public abstract class SystemSettingsCredentialsProvider extends Object implements AwsCredentialsProvider
Loads credentials providers from theSdkSystemSetting.AWS_ACCESS_KEY_ID
,SdkSystemSetting.AWS_SECRET_ACCESS_KEY
, andSdkSystemSetting.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 Summary
Constructors Constructor Description SystemSettingsCredentialsProvider()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Optional<String>
loadSetting(SystemSetting setting)
Implemented by child classes to load the requested setting.AwsCredentials
resolveCredentials()
ReturnsAwsCredentials
that can be used to authorize an AWS request.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
identityType, resolveIdentity
-
Methods inherited from interface software.amazon.awssdk.identity.spi.IdentityProvider
resolveIdentity, resolveIdentity
-
-
-
-
Method Detail
-
resolveCredentials
public AwsCredentials resolveCredentials()
Description copied from interface:AwsCredentialsProvider
ReturnsAwsCredentials
that can be used to authorize an AWS request. Each implementation of AWSCredentialsProvider can choose 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.
- Specified by:
resolveCredentials
in interfaceAwsCredentialsProvider
- Returns:
- AwsCredentials which the caller can use to authorize an AWS request.
-
loadSetting
protected abstract Optional<String> loadSetting(SystemSetting setting)
Implemented by child classes to load the requested setting.
-
-