mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Fix bootstrap auth
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -71,5 +71,6 @@ frontend-build
|
||||
cli/infisical-merge
|
||||
cli/test/infisical-merge
|
||||
/backend/binary
|
||||
backend/bdd/.bdd-infisical-bootstrap-result.json
|
||||
|
||||
/npm/bin
|
||||
|
||||
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user