NewCustomTokenCredentials - returns credentials using the AssumeRoleWithCustomToken STS API.
(stsEndpoint, token, roleArn string, optFuncs ...CustomTokenOpt)
| 154 | // NewCustomTokenCredentials - returns credentials using the |
| 155 | // AssumeRoleWithCustomToken STS API. |
| 156 | func NewCustomTokenCredentials(stsEndpoint, token, roleArn string, optFuncs ...CustomTokenOpt) (*Credentials, error) { |
| 157 | c := CustomTokenIdentity{ |
| 158 | STSEndpoint: stsEndpoint, |
| 159 | Token: token, |
| 160 | RoleArn: roleArn, |
| 161 | } |
| 162 | for _, optFunc := range optFuncs { |
| 163 | optFunc(&c) |
| 164 | } |
| 165 | return New(&c), nil |
| 166 | } |
| 167 | |
| 168 | // CustomTokenOpt is a function type to configure the custom-token based |
| 169 | // credentials using NewCustomTokenCredentials. |