-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ACS][Common][Alpha] Added a new auth credential for Teams Phone Extentions #33356
base: main
Are you sure you want to change the base?
Conversation
there are more than one possible design, why was the one in this PR chosen? request PRs)_ - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary) --------- Co-authored-by: Dominik Messinger <[email protected]> Co-authored-by: Adrian Tang <[email protected]> Co-authored-by: Aigerim Beishenbekova <[email protected]>
### Packages impacted by this PR ### Issues associated with this PR ### Describe the problem that is addressed by this PR ### What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen? ### Are there test cases added in this PR? _(If not, why?)_ ### Provide a list of related PRs _(if any)_ ### Command used to generate this PR:**_(Applicable only to SDK release request PRs)_ ### Checklists - [ ] Added impacted package name to the issue description - [ ] Does this PR needs any fixes in the SDK Generator?** _(If so, create an Issue in the [Autorest/typescript](https://github.com/Azure/autorest.typescript) repository and link it here)_ - [ ] Added a changelog (if necessary)
There was a problem hiding this comment.
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 introduces a new Entra token credential mechanism for Azure Communication Services, enabling Entra users (including those with a Teams license) to authenticate for Teams Phone Extensibility. Key changes include:
- Addition of the EntraTokenCredential implementation and its corresponding options.
- Updates to the AzureCommunicationTokenCredential to accept EntraCommunicationTokenCredentialOptions.
- Enhancements to documentation, tests, and API definitions to support the new credential type.
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 2 comments.
Show a summary per file
File | Description |
---|---|
sdk/communication/communication-common/src/entraTokenCredential.ts | New credential implementation and token exchange logic for Entra tokens. |
sdk/communication/communication-common/README.md | Documentation updates to describe the new credential usage. |
sdk/communication/communication-common/test/public/node/entraCommunicationTokenCredential.spec.ts | Added tests covering various scenarios of token exchange and error handling. |
sdk/communication/communication-common/src/azureCommunicationTokenCredential.ts | Updated constructor overloads to support Entra options. |
sdk/communication/communication-common/review/communication-common.api.md | API definition updated to include new Entra options. |
sdk/communication/communication-common/CHANGELOG.md | Changelog updated to document the new feature. |
sdk/communication/communication-common/src/index.ts | Exports updated to include EntraCommunicationTokenCredentialOptions. |
Comments suppressed due to low confidence (1)
sdk/communication/communication-common/src/entraTokenCredential.ts:175
- The error message uses placeholder braces which might confuse users; consider replacing them with the actual URL values to improve clarity.
throw new Error(`Scopes validation failed. Ensure all scopes start with either {TeamsExtensionScopePrefix} or {ComunicationClientsScopePrefix}.`);
} from "@azure/core-rest-pipeline"; | ||
|
||
const TeamsExtensionScopePrefix = "https://auth.msft.communication.azure.com/"; | ||
const ComunicationClientsScopePrefix = "https://communication.azure.com/clients/"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider correcting the spelling of 'ComunicationClientsScopePrefix' to 'CommunicationClientsScopePrefix' for consistency and clarity.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
const ComunicationClientsScopePrefix = "https://communication.azure.com/clients/"; | ||
const TeamsExtensionEndpoint = "/access/teamsPhone/:exchangeAccessToken"; | ||
const TeamsExtensionApiVersion = "2025-03-02-preview"; | ||
const ComunicationClientsEndpoint = "/access/entra/:exchangeAccessToken"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rename 'ComunicationClientsEndpoint' to 'CommunicationClientsEndpoint' to fix the spelling and align with standard naming conventions.
Copilot is powered by AI, so mistakes are possible. Review output carefully before use.
Fixing main->feature branch merge conflict
API change check APIView has identified API level changes in this PR and created following API reviews. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving, just that commit also has pnpm-lock.yaml, is this file also needs to be comitted ?
Packages impacted by this PR
Issues associated with this PR
Describe the problem that is addressed by this PR
What are the possible designs available to address the problem? If there are more than one possible design, why was the one in this PR chosen?
Are there test cases added in this PR? (If not, why?)
Provide a list of related PRs (if any)
Command used to generate this PR:**(Applicable only to SDK release request PRs)
Checklists