Struct: plugincreds.Provider

import "../ibm-cos-sdk-go/aws/credentials/plugincreds"

Overview

Provider is the credentials provider that will use the plugin provided Retrieve and IsExpired functions to retrieve credentials.

Implemented Interfaces

s3crypto.Cipher, credentials.Provider, s3manager.ReadSeekerWriteTo, s3manager.WriterReadFrom

Method Summary collapse

Method Details

func (p Provider) IsExpired() bool

IsExpired will return the expired state of the underlying plugin provider.



170
171
172
// File 'aws/credentials/plugincreds/provider.go', line 170

func (p Provider) IsExpired() bool { return p.IsExpiredFn() }

func (p Provider) Retrieve() (credentials.Value, error)

Retrieve will return the credentials Value if they were successfully retrieved from the underlying plugin provider. An error will be returned otherwise.



151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
// File 'aws/credentials/plugincreds/provider.go', line 151

func (p Provider) Retrieve() (credentials.Value, error) { creds := credentials.Value{ ProviderName: ProviderName, } k, s, t, err := p.RetrieveFn() if err != nil { return creds, awserr.New(ErrCodePluginProviderRetrieve, "failed to retrieve credentials with plugin provider", err) } creds.AccessKeyID = k creds.SecretAccessKey = s creds.SessionToken = t return creds, nil }