Table of Contents

Class RefreshingAWSCredentials

Namespace
Amazon.Runtime
Assembly
AWSSDK.Core.dll

Abstract class for automatically refreshing AWS credentials

public abstract class RefreshingAWSCredentials : AWSCredentials, IDisposable
Inheritance
RefreshingAWSCredentials
Implements
Derived
Inherited Members

Constructors

RefreshingAWSCredentials()

protected RefreshingAWSCredentials()

Fields

currentState

Represents the current state of the Credentials.

protected RefreshingAWSCredentials.CredentialsRefreshState currentState

Field Value

RefreshingAWSCredentials.CredentialsRefreshState

Remarks

This can be cleared without synchronization.

Properties

PreemptExpiryTime

The time before actual expiration to expire the credentials. Property cannot be set to a negative TimeSpan.

public TimeSpan PreemptExpiryTime { get; set; }

Property Value

TimeSpan

ShouldUpdate

Test credentials existence and expiration time should update if: credentials have not been loaded yet it's past the expiration time. At this point currentState.Expiration may have the PreemptExpiryTime baked into to the expiration from a call to UpdateToGeneratedCredentials but it may not if this is new application load.

protected bool ShouldUpdate { get; }

Property Value

bool

Methods

ClearCredentials()

Clears currently-stored credentials, forcing the next GetCredentials call to generate new credentials.

public virtual void ClearCredentials()

Dispose()

public void Dispose()

Dispose(bool)

protected virtual void Dispose(bool disposing)

Parameters

disposing bool

GenerateNewCredentials()

When overridden in a derived class, generates new credentials and new expiration date.

Called on first credentials request and when expiration date is in the past.

protected virtual RefreshingAWSCredentials.CredentialsRefreshState GenerateNewCredentials()

Returns

RefreshingAWSCredentials.CredentialsRefreshState

GenerateNewCredentialsAsync()

When overridden in a derived class, generates new credentials and new expiration date.

Called on first credentials request and when expiration date is in the past.

protected virtual Task<RefreshingAWSCredentials.CredentialsRefreshState> GenerateNewCredentialsAsync()

Returns

Task<RefreshingAWSCredentials.CredentialsRefreshState>

GetCredentials()

Returns an instance of ImmutableCredentials for this instance

public override ImmutableCredentials GetCredentials()

Returns

ImmutableCredentials

GetCredentialsAsync()

public override Task<ImmutableCredentials> GetCredentialsAsync()

Returns

Task<ImmutableCredentials>