Skip to content

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

Add quote for jq

Fang-Pen Lin5b2c0583e080
diff --git a/backend/bdd/features/pki/acme/auth.feature b/backend/bdd/features/pki/acme/auth.feature
index b1b8ee5ae1..dd824d18f9 100644
--- a/backend/bdd/features/pki/acme/auth.feature
+++ b/backend/bdd/features/pki/acme/auth.feature
@@ -17,8 +17,8 @@ Feature: Authorization
Then I sign the certificate signing request csr with private key cert_key and output it as csr_pem in PEM format
Then I submit the certificate signing request PEM csr_pem certificate order to the ACME server as order
Then the value order.authorizations[0].uri with jq . should match pattern {BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/authorizations/(.+)
- Then the value order.authorizations[0].body with jq .status should be equal to "pending"
- Then the value order.authorizations[0].body with jq .challenges | map(pick(.type, .status)) | sort_by(.type) should be equal to json
+ Then the value order.authorizations[0].body with jq ".status" should be equal to "pending"
+ Then the value order.authorizations[0].body with jq ".challenges | map(pick(.type, .status)) | sort_by(.type)" should be equal to json
"""
[
{
@@ -27,8 +27,8 @@ Feature: Authorization
}
]
"""
- Then the value order.authorizations[0].body with jq .challenges | map(.status) | sort should be equal to ["pending"]
- Then the value order.authorizations[0].body with jq .identifier should be equal to json
+ Then the value order.authorizations[0].body with jq ".challenges | map(.status) | sort" should be equal to ["pending"]
+ Then the value order.authorizations[0].body with jq ".identifier" should be equal to json
"""
{
"type": "dns",
diff --git a/backend/bdd/features/pki/acme/cert-profile.feature b/backend/bdd/features/pki/acme/cert-profile.feature
index 042f86e399..564b060132 100644
--- a/backend/bdd/features/pki/acme/cert-profile.feature
+++ b/backend/bdd/features/pki/acme/cert-profile.feature
@@ -16,11 +16,11 @@ Feature: ACME Cert Profile
}
"""
Then the value response.status_code should be equal to 200
- Then the value response with jq .certificateProfile.id should be present
- Then the value response with jq .certificateProfile.slug should be equal to "{profile_slug}"
- Then the value response with jq .certificateProfile.caId should be equal to "{CERT_CA_ID}"
- Then the value response with jq .certificateProfile.certificateTemplateId should be equal to "{CERT_TEMPLATE_ID}"
- Then the value response with jq .certificateProfile.enrollmentType should be equal to "acme"
+ Then the value response with jq ".certificateProfile.id" should be present
+ Then the value response with jq ".certificateProfile.slug" should be equal to "{profile_slug}"
+ Then the value response with jq ".certificateProfile.caId" should be equal to "{CERT_CA_ID}"
+ Then the value response with jq ".certificateProfile.certificateTemplateId" should be equal to "{CERT_TEMPLATE_ID}"
+ Then 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
@@ -41,5 +41,5 @@ Feature: ACME Cert Profile
And I memorize response with jq ".certificateProfile.id" as profile_id
When I send a GET request to "/api/v1/pki/certificate-profiles/{profile_id}/acme/eab-secret/reveal"
Then the value response.status_code should be equal to 200
- Then the value response with jq .eabKid should be equal to "{profile_id}"
- Then the value response with jq .eabSecret should be present
+ Then the value response with jq ".eabKid" should be equal to "{profile_id}"
+ Then the value response with jq ".eabSecret" should be present
diff --git a/backend/bdd/features/pki/acme/order.feature b/backend/bdd/features/pki/acme/order.feature
index d9cf5c2689..1ba2c3570f 100644
--- a/backend/bdd/features/pki/acme/order.feature
+++ b/backend/bdd/features/pki/acme/order.feature
@@ -45,7 +45,7 @@ Feature: Order
Then I create a RSA private key pair as cert_key
Then I sign the certificate signing request csr with private key cert_key and output it as csr_pem in PEM format
Then I submit the certificate signing request PEM csr_pem certificate order to the ACME server as order
- Then the value order.body with jq .identifiers | sort_by(.value) should be equal to json
+ Then the value order.body with jq ".identifiers | sort_by(.value)" should be equal to json
"""
[
{"type": "dns", "value": "example.com"},
@@ -71,7 +71,7 @@ Feature: Order
Then I sign the certificate signing request csr with private key cert_key and output it as csr_pem in PEM format
Then I submit the certificate signing request PEM csr_pem certificate order to the ACME server as order
Then I send an ACME post-as-get to order.uri as fetched_order
- Then the value fetched_order with jq .status should be equal to "pending"
- Then the value fetched_order with jq .identifiers should be equal to [{"type": "dns", "value": "localhost"}]
- Then the value fetched_order with jq .finalize should match pattern {BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/orders/(.+)/finalize
- Then the value fetched_order with jq all(.authorizations[]; startswith("{BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/authorizations/")) should be equal to true
+ Then the value fetched_order with jq ".status" should be equal to "pending"
+ Then the value fetched_order with jq ".identifiers" should be equal to [{"type": "dns", "value": "localhost"}]
+ Then the value fetched_order with jq ".finalize" should match pattern {BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/orders/(.+)/finalize
+ Then the value fetched_order with jq "all(.authorizations[]; startswith('{BASE_URL}/api/v1/pki/acme/profiles/{acme_profile.id}/authorizations/'))" should be equal to true
diff --git a/backend/bdd/features/steps/pki_acme.py b/backend/bdd/features/steps/pki_acme.py
index 4c33b42b1f..855195ac5f 100644
--- a/backend/bdd/features/steps/pki_acme.py
+++ b/backend/bdd/features/steps/pki_acme.py
@@ -314,7 +314,7 @@ def step_impl(context: Context, var_path: str, jq_query: str):
)
-@then("the value {var_path} with jq {jq_query} should be present")
+@then('the value {var_path} with jq "{jq_query}" should be present')
def step_impl(context: Context, var_path: str, jq_query: str):
value, result = apply_value_with_jq(
context=context,
@@ -326,7 +326,7 @@ def step_impl(context: Context, var_path: str, jq_query: str):
)
-@then("the value {var_path} with jq {jq_query} should be equal to {expected}")
+@then('the value {var_path} with jq "{jq_query}" should be equal to {expected}')
def step_impl(context: Context, var_path: str, jq_query: str, expected: str):
value, result = apply_value_with_jq(
context=context,
@@ -339,7 +339,7 @@ def step_impl(context: Context, var_path: str, jq_query: str, expected: str):
)
-@then("the value {var_path} with jq {jq_query} should match pattern {regex}")
+@then('the value {var_path} with jq "{jq_query}" should match pattern {regex}')
def step_impl(context: Context, var_path: str, jq_query: str, regex: str):
value, result = apply_value_with_jq(
context=context,