From c4b759b6a87614bd8c8babcd7174ea0cd73d5cfd Mon Sep 17 00:00:00 2001 From: Fang-Pen Lin Date: Fri, 7 Nov 2025 17:09:29 -0800 Subject: [PATCH] Fix bootstrap auth --- .gitignore | 1 + backend/bdd/features/environment.py | 13 +++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.gitignore b/.gitignore index f2a23324b..b4e9a07c2 100644 --- a/.gitignore +++ b/.gitignore @@ -71,5 +71,6 @@ frontend-build cli/infisical-merge cli/test/infisical-merge /backend/binary +backend/bdd/.bdd-infisical-bootstrap-result.json /npm/bin diff --git a/backend/bdd/features/environment.py b/backend/bdd/features/environment.py index c77646358..52615036a 100644 --- a/backend/bdd/features/environment.py +++ b/backend/bdd/features/environment.py @@ -21,7 +21,7 @@ BOOTSTRAP_INFISICAL = int(os.environ.get("BOOTSTRAP_INFISICAL", 0)) # Called mostly from a CI to setup the new Infisical instance to get it ready for BDD tests def bootstrap_infisical(context: Context): - bootstrap_result_file = pathlib.Path.cwd() / ".bootstrap-result.json" + bootstrap_result_file = pathlib.Path.cwd() / ".bdd-infisical-bootstrap-result.json" if bootstrap_result_file.exists(): logger.info( "Bootstrap result file exists at %s, loading it now", bootstrap_result_file @@ -45,6 +45,15 @@ def bootstrap_infisical(context: Context): user = body["user"] temp_token = body["token"] + resp = client.post( + "/api/v3/auth/select-organization", + headers={"Authorization": f"Bearer {temp_token}"}, + json={"organizationId": org["id"]}, + ) + resp.raise_for_status() + body = resp.json() + temp_token = body["token"] + resp = client.post( "/api/v1/auth/token", headers={"Authorization": f"Bearer {temp_token}"}, @@ -96,7 +105,7 @@ def bootstrap_infisical(context: Context): ) resp.raise_for_status() body = resp.json() - ca = body["certificateAuthorities"] + ca = body cert_template_slug = faker.slug() resp = client.post(