Add other Credentials support for Azure store
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
๐ฆ 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
[!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_commitssetting.Use the following commands to manage reviews:
@coderabbitai resumeto resume automatic reviews.@coderabbitai reviewto 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.
Comment @coderabbitai help to get the list of available commands.
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.
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
Is this PR abandoned? It would be good to get this in some form
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?