Skip to content

Secured sandbox auto signature#845

Merged
sitole merged 8 commits intomainfrom
feat/secured-sandbox-auto-signature
Aug 4, 2025
Merged

Secured sandbox auto signature#845
sitole merged 8 commits intomainfrom
feat/secured-sandbox-auto-signature

Conversation

@sitole
Copy link
Copy Markdown
Member

@sitole sitole commented Aug 4, 2025

Some users report that JS/Python types lack a useSignature attribute, which only works when secure=true is set for the sandbox. This change removes the useSignatrue parameter and makes all upload/download URL requests signed if secure was provided, making sure the function will work for all possible cases.

@sitole sitole self-assigned this Aug 4, 2025
@sitole sitole added the Improvement Improvement for current functionality label Aug 4, 2025
@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Aug 4, 2025

🦋 Changeset detected

Latest commit: b10b0bf

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@e2b/python-sdk Minor
e2b Minor

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

@sitole
Copy link
Copy Markdown
Member Author

sitole commented Aug 4, 2025

This is also a change needed for safe migration to allow secure=true as default when creating a sandbox.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR simplifies the sandbox file URL signing mechanism by automatically determining when to use signed URLs based on whether the sandbox was created with the secure option. It removes the manual useSignature parameter from both JavaScript and Python SDKs, making signed URLs the default behavior for secure sandboxes.

  • Removes useSignature parameter from downloadUrl and uploadUrl methods
  • Automatically enables URL signing when sandbox has an access token (secure mode)
  • Updates error messages to clarify that signature expiration requires a secured sandbox

Reviewed Changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/js-sdk/src/sandbox/index.ts Removes useSignature parameter and implements automatic signing detection
packages/python-sdk/e2b/sandbox/main.py Removes useSignature parameter and implements automatic signing detection
packages/js-sdk/tests/sandbox/secure.test.ts Updates test to remove useSignature parameter usage
packages/js-sdk/tests/sandbox/files/signing.test.ts Updates multiple tests to remove useSignature parameter and removes obsolete tests
packages/python-sdk/tests/sync/sandbox_sync/files/test_secured.py Updates test calls to remove useSignature parameter
packages/python-sdk/tests/async/sandbox_async/files/test_secured.py Updates test calls to remove useSignature parameter
apps/web/src/app/(docs)/docs/filesystem/upload/page.mdx Updates documentation to remove useSignature usage
apps/web/src/app/(docs)/docs/filesystem/download/page.mdx Updates documentation to remove useSignature usage
.changeset/wicked-ghosts-tie.md Adds changelog entry for the breaking change

Comment thread packages/js-sdk/tests/sandbox/files/signing.test.ts Outdated
Comment thread packages/js-sdk/tests/sandbox/files/signing.test.ts Outdated
Comment thread packages/js-sdk/src/sandbox/index.ts Outdated
Copy link
Copy Markdown
Member

@ben-fornefeld ben-fornefeld left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small usability enhancement, otherwise LGTM.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Ben Fornefeld <50748440+ben-fornefeld@users.noreply.github.com>
@sitole sitole enabled auto-merge (squash) August 4, 2025 12:32
@sitole sitole merged commit c0a4172 into main Aug 4, 2025
7 of 8 checks passed
@sitole sitole deleted the feat/secured-sandbox-auto-signature branch August 4, 2025 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Improvement Improvement for current functionality

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants