Add file share link command#111
Open
goanpeca wants to merge 5 commits into
Open
Conversation
Extension Build ReadyDownload the VSIX from the workflow artifacts above. InstallationVS Code UI: Extensions > ... > Install from VSIX... CLI: |
There was a problem hiding this comment.
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.copyShareLinkcommand 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.
bb50bcf to
3baddd3
Compare
Comment on lines
+112
to
+115
| const authorizationPromise = options.bucket.getDownloadAuthorization( | ||
| options.filePath, | ||
| options.expiresIn, | ||
| ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
b2.copyShareLinkto file context menus to create temporary download links.1-604800seconds, validate empty input, copy the URL, and show the ISO expiry.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 testFollow-up notes