Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.
TypeScript acmeagentsai-agentscertificate-managementdevsecopsenvironment-variableskubernetesopen-sourcepampkipostgresprivate-caprivileged-access-managementsecret-managementsecret-managersecretssecrets-managementsecuritysecurity-toolsvault
Isolate vars
Fang-Pen Lin2026fcd628a4
diff --git a/backend/bdd/features/environment.py b/backend/bdd/features/environment.pyindex 9a2e9f90b0..dce0eb5389 100644--- a/backend/bdd/features/environment.py+++ b/backend/bdd/features/environment.py@@ -185,28 +185,33 @@ def bootstrap_infisical(context: Context):def before_all(context: Context):+ base_vars = {+ "BASE_URL": BASE_URL,+ "PEBBLE_URL": PEBBLE_URL,+ }if BOOTSTRAP_INFISICAL:details = bootstrap_infisical(context)- context.vars = {- "BASE_URL": BASE_URL,- "PEBBLE_URL": PEBBLE_URL,+ vars = base_vars | {"PROJECT_ID": details["project"]["id"],"CERT_CA_ID": details["ca"]["id"],"CERT_TEMPLATE_ID": details["cert_template"]["id"],"AUTH_TOKEN": details["auth_token"],}else:- context.vars = {- "BASE_URL": BASE_URL,- "PEBBLE_URL": PEBBLE_URL,+ vars = base_vars | {"PROJECT_ID": PROJECT_ID,"CERT_CA_ID": CERT_CA_ID,"CERT_TEMPLATE_ID": CERT_TEMPLATE_ID,"AUTH_TOKEN": AUTH_TOKEN,}+ context._initial_vars = varscontext.http_client = httpx.Client(base_url=BASE_URL)+def before_scenario(context: Context, scenario: typing.Any):+ context.vars = deepcopy(context._initial_vars)++def after_scenario(context: Context, scenario: typing.Any):if hasattr(context, "web_server"):context.web_server.shutdown_and_server_close()diff --git a/backend/bdd/features/steps/pki_acme.py b/backend/bdd/features/steps/pki_acme.pyindex 51ab4209e4..353ec942da 100644--- a/backend/bdd/features/steps/pki_acme.py+++ b/backend/bdd/features/steps/pki_acme.py@@ -387,8 +387,9 @@ def register_account_with_eab():acme_client = context.acme_clientaccount_public_key = acme_client.net.key.public_key()- # clear the account in case if we want to register twice- acme_client.net.account = None+ if not only_return_existing:+ # clear the account in case if we want to register twice+ acme_client.net.account = Noneif hasattr(context, "alt_eab_url"):eab_directory = messages.Directory.from_json({"newAccount": context.alt_eab_url}@@ -408,8 +409,14 @@ def register_account_with_eab(only_return_existing=only_return_existing,)try:- context.vars[account_var] = acme_client.new_account(registration)+ if not only_return_existing:+ context.vars[account_var] = acme_client.new_account(registration)+ else:+ context.vars[account_var] = acme_client.query_registration(+ acme_client.net.account+ )except Exception as exp:+ logger.error(f"Failed to register: {exp}", exc_info=True)context.vars["error"] = exp