Skip to content

Conversation

@bwateratmsft
Copy link
Contributor

@bwateratmsft bwateratmsft commented Oct 23, 2025

A lot of the assumptions we made when originally creating this package are no longer true.

  • We have the getAccounts() API now
  • We need to support multi-account scenarios
  • Subscriptions can "belong" to multiple tenants
  • Calling getSession() can often result in onDidChangeSessions being fired unexpectedly, which made things like isSignedIn() problematic (leading to event loops)

This PR aims to address all of it. It also adds result caching by default, optional cancellation by token, and parallelizes requests when calling getAvailableSubscriptions().

It is very much a breaking change, so major versions will need to be updated.

@bwateratmsft
Copy link
Contributor Author

@danegsta suggested we switch to support proper pagination a la PagedAsyncIterableIterator. Thoughts?

@bwateratmsft bwateratmsft requested a review from Copilot October 29, 2025 14:51
Copy link

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 refactors the Azure authentication library to version 6.0.0-alpha.1 with a redesigned API surface. The changes introduce a cleaner separation of concerns by organizing contracts, providers, and utilities into distinct directories, and updating the AzureSubscriptionProvider interface with improved methods for account, tenant, and subscription management.

  • Replaced getSubscriptions() with getAvailableSubscriptions() and added dedicated methods for accounts and tenants
  • Introduced new utility functions for PII screening, token expiration handling, and subscription deduplication
  • Reorganized file structure into contracts/, providers/, and utils/ directories

Reviewed Changes

Copilot reviewed 23 out of 24 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
auth/package.json Bumped version to 6.0.0-alpha.1 and VS Code engine to 1.106.0
auth/src/contracts/*.ts Added new contract interfaces for accounts, tenants, subscriptions, and provider APIs
auth/src/providers/*.ts Refactored subscription providers with new base and implementation classes
auth/src/utils/*.ts Added utility functions for screening PII, token handling, and subscription deduplication
auth/test/utils/screen.test.ts Added comprehensive tests for the new PII screening functionality
auth/README.md Updated documentation to reflect new API methods
Files not reviewed (1)
  • auth/package-lock.json: Language not supported

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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

Labels

None yet

Projects

None yet

2 participants