Allow configuration of nonce for ec2 authentication (#6953)

* Allow configuration of nonce for ec2 authentication

* Addressing pull request comment
This commit is contained in:
Aaron Donovan 2019-06-27 11:06:20 -04:00 committed by Jeff Mitchell
parent 755fde7023
commit b70f5c4923

View File

@ -134,6 +134,14 @@ func NewAWSAuthMethod(conf *auth.AuthConfig) (auth.AuthMethod, error) {
}
}
nonceRaw, ok := conf.Config["nonce"]
if ok {
a.nonce, ok = nonceRaw.(string)
if !ok {
return nil, errors.New("could not convert 'nonce' value into string")
}
}
if a.authType == typeIAM {
// Check for an optional custom frequency at which we should poll for creds.