Skip to content

Commit

Permalink
Merge pull request #4883 from atishpatel/main
Browse files Browse the repository at this point in the history
Expose ProcessProviderOptions in session's CredentialsProviderOptions
  • Loading branch information
lucix-aws authored Jul 6, 2023
2 parents d744468 + 7990455 commit 6e85489
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion aws/session/credentials.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,10 @@ type CredentialsProviderOptions struct {
// WebIdentityRoleProviderOptions configures a WebIdentityRoleProvider,
// such as setting its ExpiryWindow.
WebIdentityRoleProviderOptions func(*stscreds.WebIdentityRoleProvider)

// ProcessProviderOptions configures a ProcessProvider,
// such as setting its Timeout.
ProcessProviderOptions func(*processcreds.ProcessProvider)
}

func resolveCredentials(cfg *aws.Config,
Expand Down Expand Up @@ -135,7 +139,11 @@ func resolveCredsFromProfile(cfg *aws.Config,

case len(sharedCfg.CredentialProcess) != 0:
// Get credentials from CredentialProcess
creds = processcreds.NewCredentials(sharedCfg.CredentialProcess)
var optFns []func(*processcreds.ProcessProvider)
if sessOpts.CredentialsProviderOptions != nil && sessOpts.CredentialsProviderOptions.ProcessProviderOptions != nil {
optFns = append(optFns, sessOpts.CredentialsProviderOptions.ProcessProviderOptions)
}
creds = processcreds.NewCredentials(sharedCfg.CredentialProcess, optFns...)

default:
// Fallback to default credentials provider, include mock errors for
Expand Down

0 comments on commit 6e85489

Please sign in to comment.