Package com.yahoo.athenz.zts
Class AWSCredentialsProviderImplV2
- java.lang.Object
-
- com.yahoo.athenz.zts.AWSCredentialsProviderImplV2
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,software.amazon.awssdk.auth.credentials.AwsCredentialsProvider
,software.amazon.awssdk.identity.spi.IdentityProvider<software.amazon.awssdk.identity.spi.AwsCredentialsIdentity>
public class AWSCredentialsProviderImplV2 extends Object implements software.amazon.awssdk.auth.credentials.AwsCredentialsProvider, Closeable
-
-
Constructor Summary
Constructors Constructor Description AWSCredentialsProviderImplV2(ZTSClient ztsClient, String domainName, String roleName)
Constructs a new AWSCredentialsProvider object with the given zts client object, Athenz domain name and AWS Role Name to retrieve temporary credentials for.AWSCredentialsProviderImplV2(ZTSClient ztsClient, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime)
Constructs a new AWSCredentialsProvider object with the given zts client object, Athenz domain name and AWS Role Name to retrieve temporary credentials for.AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName)
Constructs a new AWSCredentialsProvider object with the given SSLContext object, ZTS Server Url, Athenz domain name and AWS Role Name to retrieve temporary credentials for.AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime)
Constructs a new AWSCredentialsProvider object with the given SSLContext object, ZTS Server Url, Athenz domain name and AWS Role Name to retrieve temporary credentials for.AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime, ZTSClientNotificationSender ztsClientNotificationSender)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
void
refresh()
software.amazon.awssdk.auth.credentials.AwsCredentials
resolveCredentials()
static void
setAwsAutoRefreshEnable(boolean state)
Configure whether or not to auto refresh the credentials when the credentials provider object is created-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
-
-
-
Constructor Detail
-
AWSCredentialsProviderImplV2
public AWSCredentialsProviderImplV2(ZTSClient ztsClient, String domainName, String roleName)
Constructs a new AWSCredentialsProvider object with the given zts client object, Athenz domain name and AWS Role Name to retrieve temporary credentials for.- Parameters:
ztsClient
- ZTS Client objectdomainName
- name of the Athenz domainroleName
- is the name of the IAM role
-
AWSCredentialsProviderImplV2
public AWSCredentialsProviderImplV2(ZTSClient ztsClient, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime)
Constructs a new AWSCredentialsProvider object with the given zts client object, Athenz domain name and AWS Role Name to retrieve temporary credentials for.- Parameters:
ztsClient
- ZTS Client objectdomainName
- name of the Athenz domainroleName
- is the name of the IAM roleminExpiryTime
- (optional) specifies that the returned creds must be at least valid (min/lower bound) for specified number of seconds,maxExpiryTime
- (optional) specifies that the returned creds must be at most valid (max/upper bound) for specified number of seconds.externalId
- (optional) external id to satisfy configured assume role condition
-
AWSCredentialsProviderImplV2
public AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime)
Constructs a new AWSCredentialsProvider object with the given SSLContext object, ZTS Server Url, Athenz domain name and AWS Role Name to retrieve temporary credentials for. The constructor will automatically create and use the ZTS client object for retrieving credentials. This object must be closed so the ZTS client object is closed as well.- Parameters:
ztsUrl
- ZTS Server's URLsslContext
- SSLContext that includes service's private key and x.509 certificate for authenticating requestsdomainName
- name of the Athenz domainroleName
- is the name of the IAM roleminExpiryTime
- (optional) specifies that the returned creds must be at least valid (min/lower bound) for specified number of seconds,maxExpiryTime
- (optional) specifies that the returned creds must be at most valid (max/upper bound) for specified number of seconds.externalId
- (optional) external id to satisfy configured assume role condition
-
AWSCredentialsProviderImplV2
public AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName, String externalId, Integer minExpiryTime, Integer maxExpiryTime, ZTSClientNotificationSender ztsClientNotificationSender)
-
AWSCredentialsProviderImplV2
public AWSCredentialsProviderImplV2(String ztsUrl, SSLContext sslContext, String domainName, String roleName)
Constructs a new AWSCredentialsProvider object with the given SSLContext object, ZTS Server Url, Athenz domain name and AWS Role Name to retrieve temporary credentials for. The constructor will automatically create and use the ZTS client object for retrieving credentials. This object must be closed so the ZTS client object is closed as well.- Parameters:
ztsUrl
- ZTS Server's URLsslContext
- SSLContext that includes service's private key and x.509 certificate for authenticating requestsdomainName
- name of the domainroleName
- is the name of the role
-
-
Method Detail
-
setAwsAutoRefreshEnable
public static void setAwsAutoRefreshEnable(boolean state)
Configure whether or not to auto refresh the credentials when the credentials provider object is created- Parameters:
state
- boolean state to enable call to refresh credentials
-
close
public void close() throws IOException
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Throws:
IOException
-
refresh
public void refresh()
-
resolveCredentials
public software.amazon.awssdk.auth.credentials.AwsCredentials resolveCredentials()
- Specified by:
resolveCredentials
in interfacesoftware.amazon.awssdk.auth.credentials.AwsCredentialsProvider
-
-