From 9a974e2e3075f155676892ce322145d07c519b91 Mon Sep 17 00:00:00 2001 From: Ben Verbeken Date: Mon, 26 Jan 2026 10:09:47 +0100 Subject: [PATCH 1/2] add authentication when creating test companies --- .github/workflows/build.yml | 1 + tests/seatsioClientTest.py | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e4f6865..82a3f4b 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -28,3 +28,4 @@ jobs: - run: uv run pytest -n 16 env: DEMO_COMPANY_SECRET_KEY: ${{ secrets.DEMO_COMPANY_SECRET_KEY }} + CORE_V2_STAGING_EU_SYSTEM_API_SECRET: ${{ secrets.CORE_V2_STAGING_EU_SYSTEM_API_SECRET }} diff --git a/tests/seatsioClientTest.py b/tests/seatsioClientTest.py index a2d0e51..a78fb79 100644 --- a/tests/seatsioClientTest.py +++ b/tests/seatsioClientTest.py @@ -27,7 +27,10 @@ def newClient(self, secret_key): return seatsio.Client(Region(BASE_URL), secret_key) def create_test_company(self): - response = requests.post(BASE_URL + "/system/public/users/actions/create-test-company") + response = requests.post( + url=BASE_URL + "/system/private/create-test-company", + auth=(os.environ["CORE_V2_STAGING_EU_SYSTEM_API_SECRET"], '') + ) if response.ok: return response.json() else: From a3aebd8af44e2050846b4b78ea47a0676f196d9a Mon Sep 17 00:00:00 2001 From: Ben Verbeken Date: Mon, 26 Jan 2026 10:56:03 +0100 Subject: [PATCH 2/2] fail with clear error message if env var not set --- tests/seatsioClientTest.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/tests/seatsioClientTest.py b/tests/seatsioClientTest.py index a78fb79..4f5e703 100644 --- a/tests/seatsioClientTest.py +++ b/tests/seatsioClientTest.py @@ -29,7 +29,7 @@ def newClient(self, secret_key): def create_test_company(self): response = requests.post( url=BASE_URL + "/system/private/create-test-company", - auth=(os.environ["CORE_V2_STAGING_EU_SYSTEM_API_SECRET"], '') + auth=(self.system_api_secret(), '') ) if response.ok: return response.json() @@ -90,6 +90,11 @@ def wait_for_status_changes(self, event, num_status_changes): else: return status_changes + def system_api_secret(self): + secret = os.getenv("CORE_V2_STAGING_EU_SYSTEM_API_SECRET") + assert secret, "Missing CORE_V2_STAGING_EU_SYSTEM_API_SECRET" + return secret + def demo_company_secret_key(self): return os.environ["DEMO_COMPANY_SECRET_KEY"]