tus-node-server icon indicating copy to clipboard operation
tus-node-server copied to clipboard

Add other Credentials support for Azure store

Open sam-ayo opened this issue 9 months ago โ€ข 5 comments

This PR includes support for using other azure credentials like DefaultAzureCredential instead of using the storage account key which like any key comes with it's security risks

sam-ayo avatar Feb 14 '26 08:02 sam-ayo

๐Ÿฆ‹ Changeset detected

Latest commit: 0be83cb24c60e01c919c25bd57cb7ecc205d84a6

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

This PR includes changesets to release 1 package
Name Type
@tus/azure-store Patch

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

changeset-bot[bot] avatar Feb 14 '26 08:02 changeset-bot[bot]

[!NOTE]

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • [ ] โ–ถ๏ธ Resume reviews
  • [ ] ๐Ÿ” Trigger review

Walkthrough

AzureStore now accepts either an accountKey or a TokenCredential (accountKey made optional); BlobServiceClient is created with the resolved credential. Added @azure/core-auth. Tests updated to cover TokenCredential acceptance and constructor validation. Root package.json only had a trailing newline change.

Changes

Cohort / File(s) Summary
Azure store package manifest
packages/azure-store/package.json
Added dependency @azure/core-auth (^1.9.0) and restored trailing newline.
Azure store implementation
packages/azure-store/src/index.ts
Options updated: accountKey -> optional, added credential?: TokenCredential. Validation now requires either accountKey or credential. Resolve credential to provided TokenCredential or to StorageSharedKeyCredential and instantiate BlobServiceClient with that credential.
Azure store tests
packages/azure-store/src/test/index.ts
Reorganized tests into a nested describe; added imports (assert, TokenCredential). Added constructor tests: accepts TokenCredential, throws when neither credential nor accountKey provided, and validates missing account/containerName. Moved setup into inner scope; some tests commented out.
Root package manifest
package.json
Whitespace-only change: restored trailing newline; no semantic or dependency changes.

Estimated code review effort

๐ŸŽฏ 3 (Moderate) | โฑ๏ธ ~20 minutes

๐Ÿšฅ Pre-merge checks | โœ… 4
โœ… Passed checks (4 passed)
Check name Status Explanation
Title check โœ… Passed The title accurately reflects the main change: adding support for other Azure credentials (TokenCredential types) as an alternative to account keys for AzureStore authentication.
Description check โœ… Passed The description is directly related to the changeset, explaining the motivation for adding credential support as a more secure alternative to storage account keys.
Docstring Coverage โœ… Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Merge Conflict Detection โœ… Passed โœ… No merge conflicts detected when merging into main

โœ๏ธ Tip: You can configure your own custom pre-merge checks in the settings.

โœจ Finishing Touches
๐Ÿงช Generate unit tests (beta)
  • [ ] Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

โค๏ธ Share

Comment @coderabbitai help to get the list of available commands.

coderabbitai[bot] avatar Feb 14 '26 08:02 coderabbitai[bot]

Taking a step back, it would be great if people can just pass their own credentials thing and we don't need to manually wrap every option. Not sure if that makes sense, haven't looked into it enough.

Murderlon avatar Feb 24 '26 13:02 Murderlon

Taking a step back, it would be great if people can just pass their own credentials thing and we don't need to manually wrap every option. Not sure if that makes sense, haven't looked into it enough.

Could you expatiate on what you mean? Not sure I understand

sam-ayo avatar Feb 24 '26 15:02 sam-ayo

Is this PR abandoned? It would be good to get this in some form

JeromeGill avatar Jul 17 '26 17:07 JeromeGill

Is this PR abandoned? It would be good to get this in some form

I can fix the conflicts on it. But not sure @Murderlon is aligned on it?

sam-ayo avatar Jul 17 '26 19:07 sam-ayo