Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

Fix BDD tests

Carlos Monastyrski08dd308f2c7f
diff --git a/backend/bdd/features/pki/acme/access-control.feature b/backend/bdd/features/pki/acme/access-control.feature
index de68970f9d..a42653b98c 100644
--- a/backend/bdd/features/pki/acme/access-control.feature
+++ b/backend/bdd/features/pki/acme/access-control.feature
@@ -2,7 +2,7 @@ Feature: Access Control
Scenario Outline: Access resources across different account
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account0
Then I memorize acme_account0.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account0_id
When I create certificate signing request as csr
@@ -34,7 +34,7 @@ Feature: Access Control
Then the value response.status_code should not be equal to 404
And I put away current ACME client as client0
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account1
Then I peak and memorize the next nonce as nonce
When I send a raw ACME request to "<url>"
@@ -62,7 +62,7 @@ Feature: Access Control
Scenario Outline: Access resources across a different profiles
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account0
Then I memorize acme_account0.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account0_id
When I create certificate signing request as csr
@@ -94,27 +94,9 @@ Feature: Access Control
Then the value response.status_code should not be equal to 404
And I put away current ACME client as client0
- Given I make a random slug as profile_slug
- Given I use AUTH_TOKEN for authentication
- When I send a "POST" request to "/api/v1/cert-manager/certificate-profiles" with JSON payload
- """
- {
- "projectId": "{PROJECT_ID}",
- "slug": "{profile_slug}",
- "description": "",
- "enrollmentType": "acme",
- "caId": "{CERT_CA_ID}",
- "certificatePolicyId": "{CERT_POLICY_ID}",
- "acmeConfig": {}
- }
- """
- Then the value response.status_code should be equal to 200
- Then I memorize response with jq ".certificateProfile.id" as profile_id
- When I send a "GET" request to "/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal"
- Then I memorize response with jq ".eabKid" as eab_kid
- And I memorize response with jq ".eabSecret" as eab_secret
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{profile_id}/directory"
- Then I register a new ACME account with email [email protected] and EAB key id "{eab_kid}" with secret "{eab_secret}" as acme_account1
+ Given I have an ACME cert profile as "acme_profile1"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile1.app_id}/profiles/{acme_profile1.id}/directory"
+ Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile1.eab_kid}" with secret "{acme_profile1.eab_secret}" as acme_account1
Then I peak and memorize the next nonce as nonce
Then I memorize <src_var> with jq "<jq>" as <dest_var>
When I send a raw ACME request to "<url>"
@@ -143,7 +125,7 @@ Feature: Access Control
Scenario Outline: Access resources across a different profile with the same key pair
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account0
Then I memorize acme_account0.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account0_id
When I create certificate signing request as csr
@@ -175,27 +157,9 @@ Feature: Access Control
Then the value response.status_code should not be equal to 404
And I put away current ACME client as client0
- Given I make a random slug as profile_slug
- Given I use AUTH_TOKEN for authentication
- When I send a "POST" request to "/api/v1/cert-manager/certificate-profiles" with JSON payload
- """
- {
- "projectId": "{PROJECT_ID}",
- "slug": "{profile_slug}",
- "description": "",
- "enrollmentType": "acme",
- "caId": "{CERT_CA_ID}",
- "certificatePolicyId": "{CERT_POLICY_ID}",
- "acmeConfig": {}
- }
- """
- Then the value response.status_code should be equal to 200
- Then I memorize response with jq ".certificateProfile.id" as profile_id
- When I send a "GET" request to "/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal"
- Then I memorize response with jq ".eabKid" as eab_kid
- And I memorize response with jq ".eabSecret" as eab_secret
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{profile_id}/directory" with the key pair from client0
- Then I register a new ACME account with email [email protected] and EAB key id "{eab_kid}" with secret "{eab_secret}" as acme_account1
+ Given I have an ACME cert profile as "acme_profile1"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile1.app_id}/profiles/{acme_profile1.id}/directory" with the key pair from client0
+ Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile1.eab_kid}" with secret "{acme_profile1.eab_secret}" as acme_account1
Then I peak and memorize the next nonce as nonce
Then I memorize <src_var> with jq "<jq>" as <dest_var>
When I send a raw ACME request to "<url>"
@@ -223,7 +187,7 @@ Feature: Access Control
Scenario Outline: URL mismatch
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
Then I memorize acme_account.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account_id
When I create certificate signing request as csr
@@ -273,7 +237,7 @@ Feature: Access Control
Scenario Outline: Send KID and JWK in the same time
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account_id
When I create certificate signing request as csr
diff --git a/backend/bdd/features/pki/acme/account.feature b/backend/bdd/features/pki/acme/account.feature
index c7eb25a534..295c8c752a 100644
--- a/backend/bdd/features/pki/acme/account.feature
+++ b/backend/bdd/features/pki/acme/account.feature
@@ -2,13 +2,13 @@ Feature: Account
Scenario: Create a new account
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And the value acme_account.uri with jq "." should match pattern {BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/accounts/(.+)
Scenario: Create a new account with the same key pair twice
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri as kid
And I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account2
@@ -17,7 +17,7 @@ Feature: Account
Scenario: Find an existing account
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri as account_uri
And I find the existing ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as retrieved_account
@@ -26,7 +26,7 @@ Feature: Account
# Note: This is a very special case for cert-manager.
Scenario: Create a new account with EAB then retrieve it without EAB
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri as account_uri
And I find the existing ACME account without EAB as retrieved_account
@@ -35,13 +35,13 @@ Feature: Account
Scenario: Create a new account without EAB
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] without EAB
And the value error with jq ".type" should be equal to "urn:ietf:params:acme:error:externalAccountRequired"
Scenario Outline: Scenario: Create a new account with bad EAB credentials
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "<eab_kid>" with secret "<eab_secret>" as acme_account
And the value error with jq ".type" should be equal to "<error_type>"
And the value error with jq ".detail" should be equal to "<error_msg>"
@@ -57,7 +57,7 @@ Feature: Account
Scenario Outline: Scenario: Create a new account with bad EAB url
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
And I use a different new-account URL "<url>" for EAB signature
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And the value error with jq ".type" should be equal to "urn:ietf:params:acme:error:externalAccountRequired"
@@ -65,9 +65,9 @@ Feature: Account
Examples: Bad URLs
| url |
- | {BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-account-bad |
- | {BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-account?foo=bar |
- | {BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-account#foobar |
+ | {BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/new-account-bad |
+ | {BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/new-account?foo=bar |
+ | {BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/new-account#foobar |
| {BASE_URL}/acme/new-account |
- | https://example.com/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-account-bad |
+ | https://example.com/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/new-account-bad |
| bad |
diff --git a/backend/bdd/features/pki/acme/auth.feature b/backend/bdd/features/pki/acme/auth.feature
index ef087ee074..edda9b953e 100644
--- a/backend/bdd/features/pki/acme/auth.feature
+++ b/backend/bdd/features/pki/acme/auth.feature
@@ -2,7 +2,7 @@ Feature: Authorization
Scenario: Get authorization
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
diff --git a/backend/bdd/features/pki/acme/cert-profile.feature b/backend/bdd/features/pki/acme/cert-profile.feature
index d6b9679cfb..8b434d09d7 100644
--- a/backend/bdd/features/pki/acme/cert-profile.feature
+++ b/backend/bdd/features/pki/acme/cert-profile.feature
@@ -9,10 +9,8 @@ Feature: ACME Cert Profile
"projectId": "{PROJECT_ID}",
"slug": "{profile_slug}",
"description": "",
- "enrollmentType": "acme",
"caId": "{CERT_CA_ID}",
- "certificatePolicyId": "{CERT_POLICY_ID}",
- "acmeConfig": {}
+ "certificatePolicyId": "{CERT_POLICY_ID}"
}
"""
Then the value response.status_code should be equal to 200
@@ -20,30 +18,8 @@ Feature: ACME Cert Profile
And the value response with jq ".certificateProfile.slug" should be equal to "{profile_slug}"
And the value response with jq ".certificateProfile.caId" should be equal to "{CERT_CA_ID}"
And the value response with jq ".certificateProfile.certificatePolicyId" should be equal to "{CERT_POLICY_ID}"
- And the value response with jq ".certificateProfile.enrollmentType" should be equal to "acme"
- Scenario: Reveal EAB secret
- Given I make a random slug as profile_slug
- And I use AUTH_TOKEN for authentication
- When I send a "POST" request to "/api/v1/cert-manager/certificate-profiles" with JSON payload
- """
- {
- "projectId": "{PROJECT_ID}",
- "slug": "{profile_slug}",
- "description": "",
- "enrollmentType": "acme",
- "caId": "{CERT_CA_ID}",
- "certificatePolicyId": "{CERT_POLICY_ID}",
- "acmeConfig": {}
- }
- """
- Then the value response.status_code should be equal to 200
- And I memorize response with jq ".certificateProfile.id" as profile_id
- When I send a "GET" request to "/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal"
- Then the value response.status_code should be equal to 200
- And the value response with jq ".eabKid" should be equal to "{profile_id}"
- And the value response with jq ".eabSecret" should be present
- And I memorize response with jq ".eabKid" as eab_kid
- And I memorize response with jq ".eabSecret" as eab_secret
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{profile_id}/directory"
- Then I register a new ACME account with email [email protected] and EAB key id "{eab_kid}" with secret "{eab_secret}" as acme_account
+ Scenario: Enable ACME enrollment on an application and reveal the EAB secret
+ Given I have an ACME cert profile as "acme_profile"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
+ Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
diff --git a/backend/bdd/features/pki/acme/challenge.feature b/backend/bdd/features/pki/acme/challenge.feature
index 0d673c567c..176188ec05 100644
--- a/backend/bdd/features/pki/acme/challenge.feature
+++ b/backend/bdd/features/pki/acme/challenge.feature
@@ -2,7 +2,7 @@ Feature: Challenge
Scenario: Validate challenge with HTTP-01
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -24,7 +24,7 @@ Feature: Challenge
Scenario: Validate challenge with DNS-01
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -46,7 +46,7 @@ Feature: Challenge
Scenario: Validate challenge with retry
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -68,7 +68,7 @@ Feature: Challenge
Scenario: Validate challenges for multiple domains
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -102,7 +102,7 @@ Feature: Challenge
Scenario: Did not finish all challenges
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -159,7 +159,7 @@ Feature: Challenge
Scenario: CSR names mismatch with order identifier
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -222,7 +222,7 @@ Feature: Challenge
"skipDnsOwnershipVerification": true
}
"""
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
diff --git a/backend/bdd/features/pki/acme/directory.feature b/backend/bdd/features/pki/acme/directory.feature
index 30a94af383..5174471a9c 100644
--- a/backend/bdd/features/pki/acme/directory.feature
+++ b/backend/bdd/features/pki/acme/directory.feature
@@ -2,13 +2,13 @@ Feature: Directory
Scenario: Get the directory of ACME service urls
Given I have an ACME cert profile as "acme_profile"
- When I send a "GET" request to "/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I send a "GET" request to "/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then the response status code should be "200"
And the response body should match JSON value
"""
{
"newNonce": "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-nonce",
- "newAccount": "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-account",
+ "newAccount": "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/new-account",
"newOrder": "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-order",
"meta": {
"externalAccountRequired": true
diff --git a/backend/bdd/features/pki/acme/external-ca.feature b/backend/bdd/features/pki/acme/external-ca.feature
index 028babbb38..3e13393eb5 100644
--- a/backend/bdd/features/pki/acme/external-ca.feature
+++ b/backend/bdd/features/pki/acme/external-ca.feature
@@ -88,7 +88,7 @@ Feature: External CA
"""
Then I memorize cert_policy with jq ".certificatePolicy.id" as cert_policy_id
Given I create an ACME profile with ca {ext_ca_id} and policy {cert_policy_id} as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -271,7 +271,7 @@ Feature: External CA
"""
Then I memorize cert_policy with jq ".certificatePolicy.id" as cert_policy_id
Given I create an ACME profile with ca {ext_ca_id} and policy {cert_policy_id} as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -457,7 +457,7 @@ Feature: External CA
"""
Then I memorize cert_policy with jq ".certificatePolicy.id" as cert_policy_id
Given I create an ACME profile with ca {ext_ca_id} and policy {cert_policy_id} as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -621,7 +621,7 @@ Feature: External CA
"""
Then I memorize cert_policy with jq ".certificatePolicy.id" as cert_policy_id
Given I create an ACME profile with ca {ext_ca_id} and policy {cert_policy_id} as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
diff --git a/backend/bdd/features/pki/acme/internal-ca.feature b/backend/bdd/features/pki/acme/internal-ca.feature
index 934b7bef31..b03f8ed61b 100644
--- a/backend/bdd/features/pki/acme/internal-ca.feature
+++ b/backend/bdd/features/pki/acme/internal-ca.feature
@@ -2,7 +2,7 @@ Feature: Internal CA
Scenario: CSR with SANs only
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
diff --git a/backend/bdd/features/pki/acme/nonce.feature b/backend/bdd/features/pki/acme/nonce.feature
index 93fc3f981d..abd4552f18 100644
--- a/backend/bdd/features/pki/acme/nonce.feature
+++ b/backend/bdd/features/pki/acme/nonce.feature
@@ -8,7 +8,7 @@ Feature: Nonce
Scenario Outline: Send a bad nonce to account endpoints
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account_id
When I create certificate signing request as csr
@@ -51,7 +51,7 @@ Feature: Nonce
Scenario Outline: Send the same nonce twice
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I memorize acme_account.uri with jq "capture("/(?<id>[^/]+)$") | .id" as account_id
When I create certificate signing request as csr
diff --git a/backend/bdd/features/pki/acme/order.feature b/backend/bdd/features/pki/acme/order.feature
index 4665bac584..e6325d369c 100644
--- a/backend/bdd/features/pki/acme/order.feature
+++ b/backend/bdd/features/pki/acme/order.feature
@@ -2,7 +2,7 @@ Feature: Order
Scenario: Create a new order
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -22,7 +22,7 @@ Feature: Order
Scenario: Create a new order with SANs
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -52,7 +52,7 @@ Feature: Order
Scenario: Fetch an order
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
When I create certificate signing request as csr
Then I add names to certificate signing request csr
@@ -72,7 +72,7 @@ Feature: Order
Scenario Outline: Create an order with invalid identifier types
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I peak and memorize the next nonce as nonce
When I send a raw ACME request to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-order"
@@ -104,7 +104,7 @@ Feature: Order
Scenario Outline: Create an order with invalid identifier values
Given I have an ACME cert profile as "acme_profile"
- When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/directory"
+ When I have an ACME client connecting to "{BASE_URL}/api/v1/cert-manager/acme/applications/{acme_profile.app_id}/profiles/{acme_profile.id}/directory"
Then I register a new ACME account with email [email protected] and EAB key id "{acme_profile.eab_kid}" with secret "{acme_profile.eab_secret}" as acme_account
And I peak and memorize the next nonce as nonce
When I send a raw ACME request to "{BASE_URL}/api/v1/cert-manager/acme/profiles/{acme_profile.id}/new-order"
diff --git a/backend/bdd/features/steps/pki_acme.py b/backend/bdd/features/steps/pki_acme.py
index 78256ef597..f7aa8913df 100644
--- a/backend/bdd/features/steps/pki_acme.py
+++ b/backend/bdd/features/steps/pki_acme.py
@@ -41,12 +41,83 @@ faker = Faker()
class AcmeProfile:
- def __init__(self, id: str, eab_kid: str, eab_secret: str):
+ def __init__(self, id: str, app_id: str, eab_kid: str, eab_secret: str):
self.id = id
+ self.app_id = app_id
self.eab_kid = eab_kid
self.eab_secret = eab_secret
+def _create_acme_profile_with_app(
+ context: Context,
+ ca_id: str | None = None,
+ policy_id: str | None = None,
+ acme_config: dict | None = None,
+) -> "AcmeProfile":
+ """Create a certificate profile, a PKI application, attach them, enable ACME
+ enrollment on the junction, and reveal the EAB secret. Returns an AcmeProfile
+ carrying both the profile id and the application id needed for the new
+ application-scoped ACME routes."""
+ jwt_token = context.vars["AUTH_TOKEN"]
+ headers = {"authorization": f"Bearer {jwt_token}"}
+ project_id = context.vars["PROJECT_ID"]
+ ca_id = ca_id or context.vars["CERT_CA_ID"]
+ policy_id = policy_id or context.vars["CERT_POLICY_ID"]
+
+ response = context.http_client.post(
+ "/api/v1/cert-manager/certificate-profiles",
+ headers=headers,
+ json={
+ "projectId": project_id,
+ "slug": faker.slug(),
+ "description": "ACME Profile created by BDD test",
+ "caId": ca_id,
+ "certificatePolicyId": policy_id,
+ },
+ )
+ response.raise_for_status()
+ profile_id = response.json()["certificateProfile"]["id"]
+
+ response = context.http_client.post(
+ "/api/v1/cert-manager/applications",
+ headers=headers,
+ params={"projectId": project_id},
+ json={"name": faker.slug()},
+ )
+ response.raise_for_status()
+ app_id = response.json()["application"]["id"]
+
+ response = context.http_client.post(
+ f"/api/v1/cert-manager/applications/{app_id}/profiles",
+ headers=headers,
+ params={"projectId": project_id},
+ json={"profileIds": [profile_id]},
+ )
+ response.raise_for_status()
+
+ response = context.http_client.put(
+ f"/api/v1/cert-manager/applications/{app_id}/profiles/{profile_id}/enrollment/acme",
+ headers=headers,
+ params={"projectId": project_id},
+ json=acme_config or {},
+ )
+ response.raise_for_status()
+
+ response = context.http_client.post(
+ f"/api/v1/cert-manager/applications/{app_id}/profiles/{profile_id}/enrollment/acme/eab/reveal",
+ headers=headers,
+ params={"projectId": project_id},
+ )
+ response.raise_for_status()
+ body = response.json()
+ return AcmeProfile(
+ id=profile_id,
+ app_id=app_id,
+ eab_kid=body["eabKid"],
+ eab_secret=body["eabSecret"],
+ )
+
+
@given("I make a random {faker_type} as {var_name}")
def step_impl(context: Context, faker_type: str, var_name: str):
context.vars[var_name] = getattr(faker, faker_type)()
@@ -54,44 +125,7 @@ def step_impl(context: Context, faker_type: str, var_name: str):
@given('I have an ACME cert profile as "{profile_var}"')
def step_impl(context: Context, profile_var: str):
- profile_id = context.vars.get("PROFILE_ID")
- secret = context.vars.get("EAB_SECRET")
- if profile_id is not None and secret is not None:
- kid = profile_id
- else:
- profile_slug = faker.slug()
- jwt_token = context.vars["AUTH_TOKEN"]
- response = context.http_client.post(
- "/api/v1/cert-manager/certificate-profiles",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- json={
- "projectId": context.vars["PROJECT_ID"],
- "slug": profile_slug,
- "description": "ACME Profile created by BDD test",
- "enrollmentType": "acme",
- "caId": context.vars["CERT_CA_ID"],
- "certificatePolicyId": context.vars["CERT_POLICY_ID"],
- "acmeConfig": {},
- },
- )
- response.raise_for_status()
- resp_json = response.json()
- profile_id = resp_json["certificateProfile"]["id"]
- kid = profile_id
-
- response = context.http_client.get(
- f"/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- )
- response.raise_for_status()
- resp_json = response.json()
- secret = resp_json["eabSecret"]
-
- context.vars[profile_var] = AcmeProfile(
- profile_id,
- eab_kid=kid,
- eab_secret=secret,
- )
+ context.vars[profile_var] = _create_acme_profile_with_app(context)
@given("I create a Cloudflare connection as {var_name}")
@@ -231,119 +265,24 @@ def step_impl(context: Context, var_name: str):
'I create an ACME profile with ca {ca_id} and policy {policy_id} as "{profile_var}"'
)
def step_impl(context: Context, ca_id: str, policy_id: str, profile_var: str):
- profile_slug = faker.slug()
- jwt_token = context.vars["AUTH_TOKEN"]
- response = context.http_client.post(
- "/api/v1/cert-manager/certificate-profiles",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- json={
- "projectId": context.vars["PROJECT_ID"],
- "slug": profile_slug,
- "description": "ACME Profile created by BDD test",
- "enrollmentType": "acme",
- "caId": replace_vars(ca_id, context.vars),
- "certificatePolicyId": replace_vars(policy_id, context.vars),
- "acmeConfig": {},
- },
- )
- response.raise_for_status()
- resp_json = response.json()
- profile_id = resp_json["certificateProfile"]["id"]
- kid = profile_id
-
- response = context.http_client.get(
- f"/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- )
- response.raise_for_status()
- resp_json = response.json()
- secret = resp_json["eabSecret"]
-
- context.vars[profile_var] = AcmeProfile(
- profile_id,
- eab_kid=kid,
- eab_secret=secret,
+ context.vars[profile_var] = _create_acme_profile_with_app(
+ context,
+ ca_id=replace_vars(ca_id, context.vars),
+ policy_id=replace_vars(policy_id, context.vars),
)
@given('I create an ACME profile with config as "{profile_var}"')
def step_impl(context: Context, profile_var: str):
- profile_slug = faker.slug()
- jwt_token = context.vars["AUTH_TOKEN"]
acme_config = replace_vars(json.loads(context.text), context.vars)
- response = context.http_client.post(
- "/api/v1/cert-manager/certificate-profiles",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- json={
- "projectId": context.vars["PROJECT_ID"],
- "slug": profile_slug,
- "description": "ACME Profile created by BDD test",
- "enrollmentType": "acme",
- "caId": context.vars["CERT_CA_ID"],
- "certificatePolicyId": context.vars["CERT_POLICY_ID"],
- "acmeConfig": acme_config,
- },
- )
- response.raise_for_status()
- resp_json = response.json()
- profile_id = resp_json["certificateProfile"]["id"]
- kid = profile_id
-
- response = context.http_client.get(
- f"/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- )
- response.raise_for_status()
- resp_json = response.json()
- secret = resp_json["eabSecret"]
-
- context.vars[profile_var] = AcmeProfile(
- profile_id,
- eab_kid=kid,
- eab_secret=secret,
+ context.vars[profile_var] = _create_acme_profile_with_app(
+ context, acme_config=acme_config
)
@given('I have an ACME cert profile with external ACME CA as "{profile_var}"')
def step_impl(context: Context, profile_var: str):
- profile_id = context.vars.get("PROFILE_ID")
- secret = context.vars.get("EAB_SECRET")
- if profile_id is not None and secret is not None:
- kid = profile_id
- else:
- profile_slug = faker.slug()
- jwt_token = context.vars["AUTH_TOKEN"]
- response = context.http_client.post(
- "/api/v1/cert-manager/certificate-profiles",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- json={
- "projectId": context.vars["PROJECT_ID"],
- "slug": profile_slug,
- "description": "ACME Profile created by BDD test",
- "enrollmentType": "acme",
- "caId": context.vars["CERT_CA_ID"],
- "certificatePolicyId": context.vars["CERT_POLICY_ID"],
- "acmeConfig": {},
- },
- )
- response.raise_for_status()
- resp_json = response.json()
- profile_id = resp_json["certificateProfile"]["id"]
- kid = profile_id
-
- response = context.http_client.get(
- f"/api/v1/cert-manager/certificate-profiles/{profile_id}/acme/eab-secret/reveal",
- headers=dict(authorization="Bearer {}".format(jwt_token)),
- )
- response.raise_for_status()
- resp_json = response.json()
- secret = resp_json["eabSecret"]
-
- context.vars[profile_var] = AcmeProfile(
- profile_id,
- eab_kid=kid,
- eab_secret=secret,
- )
+ context.vars[profile_var] = _create_acme_profile_with_app(context)
@given("I intercept outgoing requests")
diff --git a/backend/bdd/features/steps/pki_scep.py b/backend/bdd/features/steps/pki_scep.py
index 8fef8f4a36..fcce84393a 100644
--- a/backend/bdd/features/steps/pki_scep.py
+++ b/backend/bdd/features/steps/pki_scep.py
@@ -26,14 +26,17 @@ def _next_enroll_name(context: Context) -> str:
class ScepProfile:
- def __init__(self, profile_id: str, challenge_password: str):
+ def __init__(self, profile_id: str, app_id: str, challenge_password: str):
self.id = profile_id
+ self.app_id = app_id
self.challenge_password = challenge_password
class SscepHelper:
- def __init__(self, base_url: str, profile_id: str, work_dir: str):
- self.scep_url = f"{base_url}/scep/{profile_id}/pkiclient.exe"
+ def __init__(self, base_url: str, app_id: str, profile_id: str, work_dir: str):
+ self.scep_url = (
+ f"{base_url}/scep/applications/{app_id}/profiles/{profile_id}/pkiclient.exe"
+ )
self.work_dir = work_dir
self.ca_cert_prefix = os.path.join(work_dir, "ca.pem")
@@ -190,31 +193,59 @@ def _create_scep_profile(
include_ca_cert: bool = True,
allow_renewal: bool = True,
) -> ScepProfile:
+ """Create a certificate profile, a PKI application, attach them, and enable
+ SCEP enrollment on the junction. Returns a ScepProfile carrying both the
+ profile id and the application id needed for the new application-scoped
+ SCEP routes."""
jwt_token = context.vars["AUTH_TOKEN"]
- profile_slug = faker.slug()
+ headers = {"authorization": f"Bearer {jwt_token}"}
+ project_id = context.vars["PROJECT_ID"]
response = context.http_client.post(
"/api/v1/cert-manager/certificate-profiles",
- headers={"authorization": f"Bearer {jwt_token}"},
+ headers=headers,
json={
- "projectId": context.vars["PROJECT_ID"],
- "slug": profile_slug,
+ "projectId": project_id,
+ "slug": faker.slug(),
"description": "SCEP Profile created by BDD test",
- "enrollmentType": "scep",
"caId": context.vars["CERT_CA_ID"],
"certificatePolicyId": context.vars["CERT_POLICY_ID"],
- "scepConfig": {
- "challengePassword": challenge_password,
- "includeCaCertInResponse": include_ca_cert,
- "allowCertBasedRenewal": allow_renewal,
- },
},
)
response.raise_for_status()
- resp_json = response.json()
- profile_id = resp_json["certificateProfile"]["id"]
+ profile_id = response.json()["certificateProfile"]["id"]
- return ScepProfile(profile_id, challenge_password)
+ response = context.http_client.post(
+ "/api/v1/cert-manager/applications",
+ headers=headers,
+ params={"projectId": project_id},
+ json={"name": faker.slug()},
+ )
+ response.raise_for_status()
+ app_id = response.json()["application"]["id"]
+
+ response = context.http_client.post(
+ f"/api/v1/cert-manager/applications/{app_id}/profiles",
+ headers=headers,
+ params={"projectId": project_id},
+ json={"profileIds": [profile_id]},
+ )
+ response.raise_for_status()
+
+ response = context.http_client.put(
+ f"/api/v1/cert-manager/applications/{app_id}/profiles/{profile_id}/enrollment/scep",
+ headers=headers,
+ params={"projectId": project_id},
+ json={
+ "challengeType": "static",
+ "challengePassword": challenge_password,
+ "includeCaCertInResponse": include_ca_cert,
+ "allowCertBasedRenewal": allow_renewal,
+ },
+ )
+ response.raise_for_status()
+
+ return ScepProfile(profile_id, app_id, challenge_password)
def _get_sscep_helper(context: Context, profile_var: str) -> SscepHelper:
@@ -225,6 +256,7 @@ def _get_sscep_helper(context: Context, profile_var: str) -> SscepHelper:
work_dir = tempfile.mkdtemp(prefix="scep_bdd_")
context.vars[helper_key] = SscepHelper(
base_url=context.vars["BASE_URL"],
+ app_id=profile.app_id,
profile_id=profile.id,
work_dir=work_dir,
)
@@ -256,11 +288,17 @@ def step_impl(context: Context, profile_var: str):
)
+def _scep_pkiclient_url(profile: ScepProfile, operation: str) -> str:
+ return (
+ f"/scep/applications/{profile.app_id}/profiles/{profile.id}"
+ f"/pkiclient.exe?operation={operation}"
+ )
+
+
@when('I send a SCEP GetCACaps request for profile "{profile_var}"')
def step_impl(context: Context, profile_var: str):
profile: ScepProfile = context.vars[profile_var]
- url = f"/scep/{profile.id}/pkiclient.exe?operation=GetCACaps"
- response = context.http_client.get(url)
+ response = context.http_client.get(_scep_pkiclient_url(profile, "GetCACaps"))
context.vars["response"] = response
context.vars["scep_caps_response"] = response.text
@@ -268,8 +306,7 @@ def step_impl(context: Context, profile_var: str):
@when('I send a SCEP GetCACert request for profile "{profile_var}"')
def step_impl(context: Context, profile_var: str):
profile: ScepProfile = context.vars[profile_var]
- url = f"/scep/{profile.id}/pkiclient.exe?operation=GetCACert"
- response = context.http_client.get(url)
+ response = context.http_client.get(_scep_pkiclient_url(profile, "GetCACert"))
context.vars["response"] = response
context.vars["scep_getcacert_response"] = response
@@ -277,8 +314,7 @@ def step_impl(context: Context, profile_var: str):
@when('I send a SCEP request with unsupported operation "{operation}" for profile "{profile_var}"')
def step_impl(context: Context, operation: str, profile_var: str):
profile: ScepProfile = context.vars[profile_var]
- url = f"/scep/{profile.id}/pkiclient.exe?operation={operation}"
- response = context.http_client.get(url)
+ response = context.http_client.get(_scep_pkiclient_url(profile, operation))
context.vars["response"] = response