MCPcopy
hub / github.com/minio/minio-go / NewSTSAssumeRole

Function NewSTSAssumeRole

pkg/credentials/assume_role.go:113–121  ·  view source on GitHub ↗

NewSTSAssumeRole returns a pointer to a new Credentials object wrapping the STSAssumeRole.

(stsEndpoint string, opts STSAssumeRoleOptions)

Source from the content-addressed store, hash-verified

111// NewSTSAssumeRole returns a pointer to a new
112// Credentials object wrapping the STSAssumeRole.
113func NewSTSAssumeRole(stsEndpoint string, opts STSAssumeRoleOptions) (*Credentials, error) {
114 if opts.AccessKey == "" || opts.SecretKey == "" {
115 return nil, errors.New("AssumeRole credentials access/secretkey is mandatory")
116 }
117 return New(&STSAssumeRole{
118 STSEndpoint: stsEndpoint,
119 Options: opts,
120 }), nil
121}
122
123const defaultDurationSeconds = 3600
124

Callers

nothing calls this directly

Calls 1

NewFunction · 0.70

Tested by

no test coverage detected