feat(sdk): support custom API key prefix for client-side validation#1360
feat(sdk): support custom API key prefix for client-side validation#1360mishushakov wants to merge 2 commits into
Conversation
Add `E2B_API_KEY_PREFIX` env var and `apiKeyPrefix` / `api_key_prefix` connection option so deployments issuing keys with a non-default prefix can pass client-side validation. Defaults to `e2b_`. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
🦋 Changeset detectedLatest commit: 764bfd2 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
PR SummaryLow Risk Overview
Reviewed by Cursor Bugbot for commit 764bfd2. Bugbot is set up for automated code reviews on this repo. Configure here. |
Package ArtifactsBuilt from a00fcd3. Download artifacts from this workflow run. JS SDK ( npm install ./e2b-2.28.1-mishushakov-custom-api-key-prefix.0.tgzCLI ( npm install ./e2b-cli-2.10.5-mishushakov-custom-api-key-prefix.0.tgzPython SDK ( pip install ./e2b-2.26.0+mishushakov.custom.api.key.prefix-py3-none-any.whl |
…i-key-prefix # Conflicts: # packages/python-sdk/tests/test_connection_config.py
Summary
E2B_API_KEY_PREFIXenv var or theapiKeyPrefix(JS) /api_key_prefix(Python) connection option, defaulting toe2b_.validateApiKey/validate_api_keyuse the configured prefix (regex-escaped) so deployments issuing keys with a non-default prefix pass client-side validation; the prefix is threaded throughApiClientfromConnectionConfig.ConnectionConfig; extracted the JSescapeRegExphelper intoutils.ts.Test plan
pnpm run format,pnpm run lint,pnpm run typecheckpnpm exec vitest run tests/api/validateApiKey.test.ts tests/api/handleApiError.test.ts tests/connectionConfig.test.ts tests/sandbox/abortSignal.test.ts tests/template/abortSignal.test.ts tests/sandbox/configPropagation.test.tspoetry run pytest tests/test_validate_api_key.py tests/test_connection_config.py tests/test_api_client_transport.py tests/sync/sandbox_sync/test_config_propagation.py tests/async/sandbox_async/test_config_propagation.py🤖 Generated with Claude Code