Skip to content

feat: resolve the sandbox API base URL from the API token#3

Merged
sophiajwitt merged 2 commits into
mainfrom
jack/sdk-jwt-base-url
Jul 9, 2026
Merged

feat: resolve the sandbox API base URL from the API token#3
sophiajwitt merged 2 commits into
mainfrom
jack/sdk-jwt-base-url

Conversation

@jackowfish

Copy link
Copy Markdown
Contributor

Description

Re-do of #2. Porter API tokens carry a project_id claim, so the SDK now reads it straight from the token payload (no signature check - that stays the server's job) instead of asking users for PORTER_PROJECT_ID. Outside-cluster setup is down to two env vars: PORTER_SANDBOX_API_KEY and PORTER_CLUSTER_ID.

Cluster ID still has to be explicit since a project can have more than one sandbox-enabled cluster. In-cluster detection (KUBERNETES_SERVICE_HOST) and the PORTER_SANDBOX_BASE_URL / base_url overrides work the same as before, and a token without a project_id claim fails with a pointer to Settings > API tokens.

@jackowfish
jackowfish force-pushed the jack/sdk-jwt-base-url branch from 9a63c44 to 31e6ca9 Compare July 8, 2026 19:26
@jackowfish
jackowfish force-pushed the jack/sdk-jwt-base-url branch from 31e6ca9 to cbd2612 Compare July 8, 2026 19:42
@sophiajwitt
sophiajwitt merged commit 124b0a2 into main Jul 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants