-
Notifications
You must be signed in to change notification settings - Fork 46
Upgrade to auth v6 and improve extension performance #1350
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
Merged
Merged
Changes from all commits
Commits
Show all changes
46 commits
Select commit
Hold shift + click to select a range
df0e2f8
Moving toward auth pkg v6
bwateratmsft 5e5315d
Merge branch 'main' into bmw/authV6
bwateratmsft f347d1f
Engine 106
bwateratmsft 113e82d
Fix mock subscription provider
bwateratmsft b0a6354
Fix selectSubscriptions
bwateratmsft 8bf992b
Few more fixes
bwateratmsft 3b8e457
Fix focus view TDP
bwateratmsft b6b606b
Fix one more thing
bwateratmsft e86152c
Minor changes
bwateratmsft bc99d99
Commit what I have
bwateratmsft a314e97
Fixes and refactors
bwateratmsft 4359423
Minimally fix cloud console
bwateratmsft 4ace0db
Build err
bwateratmsft 1c4120d
Delay sending telemetry so we can use cached data
bwateratmsft 66e8086
Dependency updates
bwateratmsft 298fa2f
Ahyup
bwateratmsft 9e3baef
Oh boy...
bwateratmsft f65146a
Merge branch 'main' into bmw/authV6
bwateratmsft fe75e7b
Go back to main
bwateratmsft 634048b
Redo after merges
bwateratmsft f46258c
Should be nodenext
bwateratmsft 10b2b76
We need node 22
bwateratmsft 632635e
Use event
bwateratmsft e4621f0
Tiny updates
bwateratmsft e01696e
Fixes
bwateratmsft 6f56d3e
Merge branch 'main' into bmw/authV6
bwateratmsft 0e76bad
Fixes
bwateratmsft d841bce
Fix super busted lockfile
bwateratmsft 18f6608
Merge branch 'main' into bmw/authV6
bwateratmsft 3c99c9a
Merge branch 'main' into bmw/authV6
bwateratmsft 73f1933
Merge branch 'main' into bmw/authV6
bwateratmsft 1339576
Deps update
bwateratmsft b1dab72
Impl manual refresh clearing cache
bwateratmsft 60e15bc
Fix lockfile conflict
bwateratmsft 1c82366
wip
alexweininger 43df097
Merge remote-tracking branch 'origin/main' into alex/authv6
alexweininger 009bc1e
Fix
alexweininger ee1602c
Refactor cache management: replace boolean flag with dedicated functi…
alexweininger 378e484
Remove temp md file
alexweininger 83e0dc8
Only load AzDO provider when testing
alexweininger 1413885
Fixup
alexweininger e851624
Fixup
alexweininger b63a4fb
Merge remote-tracking branch 'origin/main' into alex/authv6
alexweininger f05db86
Optimize tenant authentication check by using a Set for unauthenticat…
alexweininger 6ba9aa5
Copilot PR feedback
alexweininger a19973e
Merge remote-tracking branch 'origin/main' into alex/authv6
alexweininger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,47 +1,17 @@ | ||
| /*--------------------------------------------------------------------------------------------- | ||
| * Copyright (c) Microsoft Corporation. All rights reserved. | ||
| * Licensed under the MIT License. See License.txt in the project root for license information. | ||
| * Licensed under the MIT License. See License.md in the project root for license information. | ||
| *--------------------------------------------------------------------------------------------*/ | ||
|
|
||
| import { AzureDevOpsSubscriptionProviderInitializer, AzureSubscriptionProvider, createAzureDevOpsSubscriptionProviderFactory } from "@microsoft/vscode-azext-azureauth"; | ||
| import { IActionContext } from "@microsoft/vscode-azext-utils"; | ||
| import type { AzureSubscriptionProvider } from "@microsoft/vscode-azext-azureauth"; | ||
| import { createVSCodeAzureSubscriptionProviderFactory } from "./VSCodeAzureSubscriptionProvider"; | ||
|
|
||
| /** | ||
| * Returns a factory function that creates a subscription provider, satisfying the `AzureSubscriptionProvider` interface. | ||
| * | ||
| * If the `useAzureSubscriptionProvider` is set to `true`, an `AzureDevOpsSubscriptionProviderFactory` is returned. | ||
| * Otherwise, a `VSCodeSubscriptionProviderFactory` is returned. | ||
| * | ||
| * For nightly tests that require Azure DevOps federated credentials, use the test API to set | ||
| * `ext.testing.overrideAzureSubscriptionProvider` with an AzDO provider factory instead. | ||
| */ | ||
| export function getSubscriptionProviderFactory(activateContext?: IActionContext): () => Promise<AzureSubscriptionProvider> { | ||
| // if this for a nightly test, we want to use the test subscription provider | ||
| const useAzureFederatedCredentials: boolean = !/^(false|0)?$/i.test(process.env['AzCode_UseAzureFederatedCredentials'] || ''); | ||
| if (useAzureFederatedCredentials) { | ||
| // when running tests, ensure we throw the errors and they aren't silently swallowed | ||
| if (activateContext) { | ||
| activateContext.errorHandling.rethrow = useAzureFederatedCredentials; | ||
| } | ||
|
|
||
| const serviceConnectionId: string | undefined = process.env['AzCode_ServiceConnectionID']; | ||
| const domain: string | undefined = process.env['AzCode_ServiceConnectionDomain']; | ||
| const clientId: string | undefined = process.env['AzCode_ServiceConnectionClientID']; | ||
|
|
||
| if (!serviceConnectionId || !domain || !clientId) { | ||
| throw new Error(`Using Azure DevOps federated credentials, but federated service connection is not configured\n | ||
| process.env.AzCode_ServiceConnectionID: ${serviceConnectionId ? "✅" : "❌"}\n | ||
| process.env.AzCode_ServiceConnectionDomain: ${domain ? "✅" : "❌"}\n | ||
| process.env.AzCode_ServiceConnectionClientID: ${clientId ? "✅" : "❌"}\n | ||
| `); | ||
| } | ||
|
|
||
| const initializer: AzureDevOpsSubscriptionProviderInitializer = { | ||
| serviceConnectionId, | ||
| domain, | ||
| clientId, | ||
| }; | ||
| return createAzureDevOpsSubscriptionProviderFactory(initializer); | ||
| } else { | ||
| return createVSCodeAzureSubscriptionProviderFactory(); | ||
| } | ||
| export function getSubscriptionProviderFactory(): () => Promise<AzureSubscriptionProvider> { | ||
| return createVSCodeAzureSubscriptionProviderFactory(); | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.