Skip to content
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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

AikoBB
Copy link
Member

@AikoBB AikoBB commented Mar 12, 2025

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 repository and link it here)
  • Added a changelog (if necessary)

sofiar-msft and others added 6 commits February 19, 2025 14:25
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)
@Copilot Copilot bot review requested due to automatic review settings March 12, 2025 12:56
Copy link
Contributor

@Copilot Copilot AI left a 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/";
Copy link
Preview

Copilot AI Mar 12, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
const ComunicationClientsScopePrefix = "https://communication.azure.com/clients/";
const TeamsExtensionEndpoint = "/access/teamsPhone/:exchangeAccessToken";
const TeamsExtensionApiVersion = "2025-03-02-preview";
const ComunicationClientsEndpoint = "/access/entra/:exchangeAccessToken";
Copy link
Preview

Copilot AI Mar 12, 2025

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.

Positive Feedback
Negative Feedback

Provide additional feedback

Please help us improve GitHub Copilot by sharing more details about this comment.

Please select one or more of the options
@azure-sdk
Copy link
Collaborator

API change check

APIView has identified API level changes in this PR and created following API reviews.

@azure/communication-common

Copy link
Member

@mjafferi-msft mjafferi-msft left a 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 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants