-
Notifications
You must be signed in to change notification settings - Fork 74
auth: totally rewrite VSCodeAzureSubscriptionProvider
#2104
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
base: main
Are you sure you want to change the base?
Conversation
|
@danegsta suggested we switch to support proper pagination a la |
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 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()withgetAvailableSubscriptions()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/, andutils/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.
A lot of the assumptions we made when originally creating this package are no longer true.
getAccounts()API nowgetSession()can often result inonDidChangeSessionsbeing fired unexpectedly, which made things likeisSignedIn()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.