Skip to content

Commit aed1d73

Browse files
committed
Add pending tests for gcp auth
1 parent 816dba7 commit aed1d73

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

lib/vault/api/auth.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,14 +251,13 @@ def aws_iam(role, credentials_provider, iam_auth_header_value = nil, sts_endpoin
251251
#
252252
# @param [String] role
253253
# @param [String] jwt
254-
# jwt returned by the instance identity metadata
254+
# jwt returned by the instance identity metadata, or iam api
255255
# @param [String] path optional
256256
# the path were the gcp auth backend is mounted
257257
#
258258
# @return [Secret]
259259
def gcp(role, jwt, path = 'gcp')
260260
payload = { role: role, jwt: jwt }
261-
# Set a custom nonce if client is providing one
262261
json = client.post("/v1/auth/#{CGI.escape(path)}/login", JSON.fast_generate(payload))
263262
secret = Secret.decode(json)
264263
client.token = secret.auth.client_token

spec/integration/api/auth_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ module Vault
272272
end
273273

274274
let!(:old_token) { subject.token }
275-
275+
276276
let(:jwt) do
277277
"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyLCJwcm9qZWN0X2lkIjoicHJvamVjdF9pZCJ9.TmuiSHtbLMZuw_LOzKWQ2vnC7BUvu2b4CeBXdxCDCXQ"
278278
end
@@ -283,7 +283,7 @@ module Vault
283283

284284
it "does not authenticate if project_id does not match" do
285285
pending "gcp auth requires real resources and keys"
286-
286+
287287
expect do
288288
subject.auth.gcp("rspec_wrong_role", jwt)
289289
end.to raise_error(Vault::HTTPClientError, /project_id doesn't match/)

0 commit comments

Comments
 (0)