We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents c35a958 + c142eab commit 4780e89Copy full SHA for 4780e89
1 file changed
lib/vault/api/auth.rb
@@ -173,11 +173,13 @@ def github(github_token)
173
# @param [String] role
174
# @param [String] pkcs7
175
# pkcs7 returned by the instance identity document (with line breaks removed)
176
- # @param [String] nonce
+ # @param [String] nonce optional
177
#
178
# @return [Secret]
179
- def aws_ec2(role, pkcs7, nonce)
180
- payload = { role: role, pkcs7: pkcs7, nonce: nonce }
+ def aws_ec2(role, pkcs7, nonce = nil)
+ payload = { role: role, pkcs7: pkcs7 }
181
+ # Set a custom nonce if client is providing one
182
+ payload[:nonce] = nonce if nonce
183
json = client.post('/v1/auth/aws-ec2/login', JSON.fast_generate(payload))
184
secret = Secret.decode(json)
185
client.token = secret.auth.client_token
0 commit comments