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

port: [#4465][#6560] Allow TokenCredential authentication in CosmosDbPartitionedStorage #4473

Merged

Conversation

ceciliaavila
Copy link
Collaborator

Fixes #4465

Description

This PR adds the CosmosDB authentication method through TokenCredential in CosmosDbPartitionedStorage

Specific Changes

  • Upgraded @azure/cosmos package from ^3.3.1 to 3.10.0 to get the CosmosClient constructor that uses TokenCredential.
  • Added TokenCredential property to CosmosDbPartitionedStorageOptions class.
  • Updated validation to throw an error if AuthKey and TokenCredential properties are null.
  • Added the alternative to create a CosmosClient using the TokenCredential if provided.
  • Updated Typescript version to avoid errors with the new version of @azure/cosmos

Testing

The following image shows the information saved in CosmosDB after creating the client using Azure credentials.
image

@ceciliaavila ceciliaavila requested a review from a team as a code owner May 5, 2023 13:30
@coveralls
Copy link

coveralls commented May 5, 2023

Pull Request Test Coverage Report for Build 4893955816

  • 4 of 5 (80.0%) changed or added relevant lines in 1 file are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+0.4%) to 84.729%

Changes Missing Coverage Covered Lines Changed/Added Lines %
libraries/botbuilder-azure/src/cosmosDbPartitionedStorage.ts 4 5 80.0%
Files with Coverage Reduction New Missed Lines %
libraries/botbuilder-lg/src/templateExtensions.ts 1 84.48%
Totals Coverage Status
Change from base Build 4893948222: 0.4%
Covered Lines: 20044
Relevant Lines: 22418

💛 - Coveralls

@tracyboehrer tracyboehrer merged commit 192d4b2 into main May 8, 2023
@tracyboehrer tracyboehrer deleted the southworks/add/cosmosdbpartitionedstorage-tokencredential branch May 8, 2023 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

port: [#6560] Allow TokenCredential authentication in CosmosDbPartitionedStorage
4 participants