Fix provisioning profile

This commit is contained in:
Fang-Pen Lin
2025-11-12 09:12:34 -08:00
parent 1ad84f0450
commit 60c428c5bb
+4 -4
View File
@@ -140,14 +140,14 @@ def step_impl(context: Context, faker_type: str, var_name: str):
def step_impl(context: Context, profile_var: str): def step_impl(context: Context, profile_var: str):
profile_id = os.getenv("PROFILE_ID") profile_id = os.getenv("PROFILE_ID")
secret = os.getenv("EAB_SECRET") secret = os.getenv("EAB_SECRET")
if profile_id is None and secret is None: if profile_id is not None and secret is not None:
kid = profile_id kid = profile_id
else: else:
profile_slug = faker.slug() profile_slug = faker.slug()
jwt_token = context.vars["AUTH_TOKEN"]
response = context.http_client.post( response = context.http_client.post(
"/api/v1/pki/certificate-profiles", "/api/v1/pki/certificate-profiles",
headers=prepare_headers(context), headers=dict(authorization="Bearer {}".format(jwt_token)),
json={ json={
"projectId": context.vars["PROJECT_ID"], "projectId": context.vars["PROJECT_ID"],
"slug": profile_slug, "slug": profile_slug,
@@ -165,7 +165,7 @@ def step_impl(context: Context, profile_var: str):
response = context.http_client.get( response = context.http_client.get(
f"/api/v1/pki/certificate-profiles/{profile_id}/acme/eab-secret/reveal", f"/api/v1/pki/certificate-profiles/{profile_id}/acme/eab-secret/reveal",
headers=prepare_headers(context), headers=dict(authorization="Bearer {}".format(jwt_token)),
) )
response.raise_for_status() response.raise_for_status()
resp_json = response.json() resp_json = response.json()