Skip to content

Add file share link command#111

Open
goanpeca wants to merge 5 commits into
mainfrom
feat/issue-62-share-link
Open

Add file share link command#111
goanpeca wants to merge 5 commits into
mainfrom
feat/issue-62-share-link

Conversation

@goanpeca

@goanpeca goanpeca commented Jul 1, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Added b2.copyShareLink to file context menus to create temporary download links.
  • Prompt for a TTL in B2 range 1-604800 seconds, validate empty input, copy the URL, and show the ISO expiry.
  • Verify the selected object is the only current downloadable item with that prefix before issuing B2 prefix-scoped authorization.
  • Bound share-link authorization with cancellable progress, timeout handling, and late-settlement logging.
  • Shared the prefix-scoped download URL helper and expiry limit constants with the LM presign path, and clarified user-facing wording.

Linked issue

Closes #62

Tests

  • /Users/gpenacastellanos/miniforge3/condabin/mamba run -n b2-vscode-issue-62 npm run check
  • /Users/gpenacastellanos/miniforge3/condabin/mamba run -n b2-vscode-issue-62 npm test

Follow-up notes

  • B2 download authorization remains prefix-scoped, so confirmation messaging mentions future same-prefix object risk.

Copilot AI review requested due to automatic review settings July 1, 2026 13:13
@goanpeca goanpeca added this to the v0.3.0 milestone Jul 1, 2026
@goanpeca goanpeca added enhancement New feature or request priority: high High priority sdk-parity SDK capability not yet exposed in the extension UI labels Jul 1, 2026
@goanpeca goanpeca self-assigned this Jul 1, 2026
@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown

Extension Build Ready

Download the VSIX from the workflow artifacts above.

Installation

VS Code UI: Extensions > ... > Install from VSIX...

CLI:

code --install-extension b2-vscode-*.vsix

Copilot AI left a comment

Copy link
Copy Markdown

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 adds a new VS Code command for generating and copying time-limited, prefix-scoped Backblaze B2 download links from the file context menu, and updates the existing presign URL limits to match B2’s 7‑day maximum.

Changes:

  • Add b2.copyShareLink command and menu contribution to generate a scoped download authorization + copy the resulting URL.
  • Add TTL prompting/validation and user feedback including an ISO expiry timestamp.
  • Update presign URL max TTL from 1 hour to 7 days and adjust related schemas/tests.

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
src/commands/index.ts Implements TTL parsing/validation and the copyShareLinkCommand, and registers the new command.
package.json Adds the new command contribution and file context menu entry; updates presign tool schema max TTL to 604800.
scripts/release-contract.js Updates the release manifest contract to include the new command and refreshed contributes hash.
src/tools/presignUrlLimits.ts Raises the shared max expiry limit to 7 days.
src/tools/definitions/presignUrl.ts Updates presign tool parameter description to reflect the 7‑day maximum.
src/test/suite/commands.test.ts Adds tests for TTL selection, prefix scoping, URL building/encoding, and TTL validation.
src/test/suite/extension.test.ts Adds assertion that the share-link command is contributed and scoped to files in menus.
src/test/suite/lmToolsFailure.test.ts Updates presign error expectation to use the new max TTL.
src/test/unit/propertyInvariants.test.ts Updates presign invalid TTL invariant test to use the new max TTL.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread src/commands/index.ts Outdated
Copilot AI review requested due to automatic review settings July 1, 2026 13:30

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

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

Comment thread src/services/shareLink.ts
Comment thread src/commands/index.ts

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 12 out of 12 changed files in this pull request and generated no new comments.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated no new comments.

@goanpeca goanpeca marked this pull request as ready for review July 1, 2026 13:59
Copilot AI review requested due to automatic review settings July 8, 2026 23:15
@goanpeca goanpeca force-pushed the feat/issue-62-share-link branch from bb50bcf to 3baddd3 Compare July 8, 2026 23:15

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Comment thread src/services/shareLink.ts
Comment on lines +112 to +115
const authorizationPromise = options.bucket.getDownloadAuthorization(
options.filePath,
options.expiresIn,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request priority: high High priority sdk-parity SDK capability not yet exposed in the extension UI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Create shareable download links (presigned URL command with TTL and prefix scope)

2 participants