mirror of
https://github.com/hashicorp/vault.git
synced 2025-08-22 15:11:07 +02:00
address review feedback
This commit is contained in:
parent
fb04d06b9b
commit
ddb0639a13
@ -413,11 +413,6 @@ func (b *backend) pathLoginUpdate(
|
||||
"role_tag_max_ttl": rTagMaxTTL.String(),
|
||||
"role": roleName,
|
||||
"ami_id": identityDoc.AmiID,
|
||||
// Echo the client nonce back. If nonce was not
|
||||
// supplied to the endpoint, callers should
|
||||
// extract out the nonce from this field for
|
||||
// reauthentication requests.
|
||||
"nonce": clientNonce,
|
||||
},
|
||||
LeaseOptions: logical.LeaseOptions{
|
||||
Renewable: true,
|
||||
@ -426,6 +421,15 @@ func (b *backend) pathLoginUpdate(
|
||||
},
|
||||
}
|
||||
|
||||
// Return the nonce only if reauthentication is allowed
|
||||
if !disallowReauthentication {
|
||||
// Echo the client nonce back. If nonce was not
|
||||
// supplied to the endpoint, callers should
|
||||
// extract out the nonce from this field for
|
||||
// reauthentication requests.
|
||||
resp.Auth.Metadata["nonce"] = clientNonce
|
||||
}
|
||||
|
||||
// Cap the TTL value.
|
||||
shortestTTL := b.System().DefaultLeaseTTL()
|
||||
if roleEntry.TTL > time.Duration(0) && roleEntry.TTL < shortestTTL {
|
||||
|
Loading…
x
Reference in New Issue
Block a user