Package: processcreds

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

Constants

const ProviderName = readonly

ProviderName is the name this credentials provider will label any returned credentials Value with.

Value:

const ErrCodeProcessProviderParse = readonly

ErrCodeProcessProviderParse error parsing process output

Value:

"ProcessProviderParseError"
const ErrCodeProcessProviderVersion = readonly

ErrCodeProcessProviderVersion version error in output

Value:

"ProcessProviderVersionError"
const ErrCodeProcessProviderRequired = readonly

ErrCodeProcessProviderRequired required attribute missing in output

Value:

"ProcessProviderRequiredError"
const ErrCodeProcessProviderExecution = readonly

ErrCodeProcessProviderExecution execution of command failed

Value:

"ProcessProviderExecutionError"
const DefaultDuration = readonly

DefaultDuration is the default amount of time in minutes that the credentials will be valid for.

Value:

time.Duration(15) * time.Minute
const DefaultBufSize = readonly

DefaultBufSize limits buffer size from growing to an enormous amount due to a faulty process.

Value:

int(8 * sdkio.KibiByte)
const DefaultTimeout = readonly

DefaultTimeout default limit on time a process can run.

Value:

time.Duration(1) * time.Minute

Type Summary collapse

Function Summary collapse

Type Details

CredentialProcessResponse struct

A CredentialProcessResponse is the AWS credentials format that must be returned when executing an external credential_process.

Structure Fields:

Version int

As of this writing, the Version key must be set to 1. This might increment over time as the structure evolves.

AccessKeyID string

The access key ID that identifies the temporary security credentials.

SecretAccessKey string

The secret access key that can be used to sign requests.

SessionToken string

The token that users must pass to the service API to use the temporary credentials.

Expiration *time.Time

The date on which the current credentials expire.

Function Details

func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials

NewCredentials returns a pointer to a new Credentials object wrapping the ProcessProvider. The credentials will expire every 15 minutes by default.



186
187
188
189
190
191
192
193
194
195
196
197
198
199
// File 'aws/credentials/processcreds/provider.go', line 186

func NewCredentials(command string, options ...func(*ProcessProvider)) *credentials.Credentials { p := &ProcessProvider{ command: exec.Command(command), Duration: DefaultDuration, Timeout: DefaultTimeout, MaxBufSize: DefaultBufSize, } for _, option := range options { option(p) } return credentials.NewCredentials(p) }

func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials

NewCredentialsCommand returns a pointer to a new Credentials object with the specified command, and default timeout, duration and max buffer size.



213
214
215
216
217
218
219
220
221
222
223
224
225
226
// File 'aws/credentials/processcreds/provider.go', line 213

func NewCredentialsCommand(command *exec.Cmd, options ...func(*ProcessProvider)) *credentials.Credentials { p := &ProcessProvider{ command: command, Duration: DefaultDuration, Timeout: DefaultTimeout, MaxBufSize: DefaultBufSize, } for _, option := range options { option(p) } return credentials.NewCredentials(p) }

func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials

NewCredentialsTimeout returns a pointer to a new Credentials object with the specified command and timeout, and default duration and max buffer size.



203
204
205
206
207
208
209
// File 'aws/credentials/processcreds/provider.go', line 203

func NewCredentialsTimeout(command string, timeout time.Duration) *credentials.Credentials { p := NewCredentials(command, func(opt *ProcessProvider) { opt.Timeout = timeout }) return p }