fix: trim additional tenant IDs from connection strings#311
Open
YunchuWang wants to merge 1 commit into
Open
Conversation
getAdditionallyAllowedTenants() splits comma-separated tenant IDs but does not trim whitespace from individual entries. This causes authentication failures when connection strings contain spaces around tenant IDs (e.g., 'tenant1, tenant2'), since the untrimmed values (e.g., ' tenant2') are passed directly to WorkloadIdentityCredential. Also filters out empty entries from trailing commas. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
Pull request overview
This pull request fixes connection-string parsing for Azure Managed Durable Task authentication by normalizing the AdditionallyAllowedTenants value so tenant IDs are usable by Azure Identity credentials. It aligns the SDK’s behavior with common connection-string formatting (spaces and trailing commas) and adds unit coverage to prevent regressions.
Changes:
- Trim whitespace around each comma-separated tenant ID in
AdditionallyAllowedTenants. - Filter out empty tenant entries created by trailing (or repeated) commas.
- Add unit tests covering whitespace trimming, trailing commas, and wildcard (
*) handling.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| packages/durabletask-js-azuremanaged/src/connection-string.ts | Normalizes AdditionallyAllowedTenants by trimming entries and removing empty values. |
| packages/durabletask-js-azuremanaged/test/unit/connection-string.spec.ts | Adds parsing tests for whitespace, trailing commas, and wildcard tenant values. |
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
Fixes #211
Testing
npm test -w @microsoft/durabletask-js-azuremanaged -- --runTestsByPath test/unit/connection-string.spec.tsnpm run build:azuremanaged