alinta-cucumber-rest-bdd 0.5.10 → 0.5.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cucumber-rest-bdd/steps/auth.rb +5 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1569aaf64a55d2f72df804c0fbc2dff157028a2b
|
4
|
+
data.tar.gz: '034494094425fc8a7f5560b5ae1a7be98c5f59b2'
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7fda30643c7b4d29c0d710bd7c338e130b4e8f7307371b621d1b34af35ba939e6f6655c673358b7fb09ef7533fea0a0e9f6a3bd5c5c1500317e81186952f64a
|
7
|
+
data.tar.gz: 0cfa7650881740db37f9717cfd450a0375f3b5d4b1015e2841794f062e66496f5c9d61ac9f022ffcae1c74b613e43ee68522f6b3948cf6df6a29f523c58323a0
|
@@ -1,10 +1,10 @@
|
|
1
|
-
Given(/^I retrieve the API Management subscription key$/) do
|
1
|
+
Given(/^I retrieve the API Management subscription key secret "(.*?)" from Azure Storage Vault "(.*?)" using tenant "(.*?)" with credentials "(.*?)" and "(.*?)"$/) do |secret_name, vault_name, tenant_id, client_id, client_secret|
|
2
2
|
if @apim_subscription_key.to_s.empty?
|
3
3
|
@apim_subscription_key = ENV['apim_subscription_key']
|
4
4
|
|
5
5
|
if @apim_subscription_key.to_s.empty?
|
6
6
|
steps %Q{
|
7
|
-
Given I retrieve the secret "
|
7
|
+
Given I retrieve the secret "#{secret_name}" from Azure Storage Vault "#{vault_name}" using tenant "#{tenant_id}" with credentials "#{client_id}" and "#{client_secret}"
|
8
8
|
}
|
9
9
|
@apim_subscription_key = @response.get_as_type "$..value", "string"
|
10
10
|
end
|
@@ -18,16 +18,9 @@ Given(/^I add the API Management key header$/) do
|
|
18
18
|
}
|
19
19
|
end
|
20
20
|
|
21
|
-
Given(/^I retrieve the secret "(.*?)" from Azure Storage Vault$/) do |secret_name|
|
22
|
-
tenant_id = ENV['ALINTA_TENANTID']
|
23
|
-
client_id = ENV['ALINTA_CLIENTID']
|
24
|
-
client_secret = ENV['ALINTA_CLIENTSECRET']
|
25
|
-
vault_name = ENV['ALINTA_VAULT']
|
26
|
-
if tenant_id.nil? or client_id.nil? or client_secret.nil? or vault_name.nil?
|
27
|
-
fail('One or more required environment variables have not been defined.')
|
28
|
-
end
|
21
|
+
Given(/^I retrieve the secret "(.*?)" from Azure Storage Vault "(.*?)" using tenant "(.*?)" with credentials "(.*?)" and "(.*?)"$/) do |secret_name, vault_name, tenant_id, client_id, client_secret|
|
29
22
|
steps %Q{
|
30
|
-
Given I authenticate with Azure
|
23
|
+
Given I authenticate with Azure tenant "#{tenant_id}" using client credentials "#{client_id}" and "#{client_secret}"
|
31
24
|
}
|
32
25
|
access_token = @response.get_as_type "$..access_token", "string"
|
33
26
|
steps %Q{
|
@@ -35,7 +28,7 @@ Given(/^I retrieve the secret "(.*?)" from Azure Storage Vault$/) do |secret_nam
|
|
35
28
|
}
|
36
29
|
end
|
37
30
|
|
38
|
-
Given(/^I authenticate with Azure
|
31
|
+
Given(/^I authenticate with Azure tenant "(.*?)" using client credentials "(.*?)" and "(.*?)"$/) do |tenant_id, client_id, client_secret|
|
39
32
|
steps %Q{
|
40
33
|
Given I authenticate with "https://login.windows.net/#{tenant_id}/oauth2/token" using client credentials "#{client_id}" and "#{client_secret}"
|
41
34
|
}
|