Documentation ¶
Index ¶
Constants ¶
const ( // EksctlGlobalEnableCachingEnvName defines an environment property to enable the cache globally. EksctlGlobalEnableCachingEnvName = "EKSCTL_ENABLE_CREDENTIAL_CACHE" // EksctlCacheFilenameEnvName defines an environment property to configure where the cache file should live. EksctlCacheFilenameEnvName = "EKSCTL_CREDENTIAL_CACHE_FILENAME" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileCacheProvider ¶
type FileCacheProvider struct {
// contains filtered or unexported fields
}
FileCacheProvider is a file based AWS Credentials Provider implementing expiry and retrieve.
func NewFileCacheProvider ¶
func NewFileCacheProvider(profile string, creds *credentials.Credentials, clock Clock) (FileCacheProvider, error)
NewFileCacheProvider creates a new filesystem based AWS credential cache. The cache uses Expiry provided by the AWS Go SDK for providers. It wraps the configured credential provider into a file based cache provider. If the provider does not support caching ( I.e.: it doesn't implement IsExpired ) then this file based caching system is ignored and the default credential provider is used. Caches are per profile.
func (*FileCacheProvider) ExpiresAt ¶
func (f *FileCacheProvider) ExpiresAt() time.Time
ExpiresAt implements the Expirer interface, and gives access to the expiration time of the credential
func (*FileCacheProvider) IsExpired ¶
func (f *FileCacheProvider) IsExpired() bool
IsExpired implements the Provider interface, deferring to the cached credential first, but fall back to the underlying Provider if it is expired.
func (*FileCacheProvider) Retrieve ¶
func (f *FileCacheProvider) Retrieve() (credentials.Value, error)
Retrieve implements the Provider interface, returning the cached credential if is not expired, otherwise fetching the credential from the underlying Provider and caching the results on disk with an expiration time.