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

auth: Add a getSessionWithScopes to AzureAuthentication #1762

Merged
merged 5 commits into from
Aug 6, 2024

Conversation

nturinski
Copy link
Member

getSession would always end up retrieving the session without a scope. When we tried to fix it via this PR, there ended up being a lot of scope issues specifically around deployment.

However, the need for a scoped token has come up again and is a requirement for security work. The easiest workaround to all the brokenness was to just make a new function that retrieves a new session while leaving the old one version alone.

This will be called by the Resources extension so that the user will not need to log in again. Here's that PR https://github.com/microsoft/vscode-azureresourcegroups/compare/nat/scopedSessions?expand=1

@nturinski nturinski requested a review from a team as a code owner August 6, 2024 04:46
bwateratmsft
bwateratmsft previously approved these changes Aug 6, 2024
@@ -9,12 +9,19 @@ import type * as vscode from 'vscode';
* Represents a means of obtaining authentication data for an Azure subscription.
*/
export interface AzureAuthentication {
/**
* Gets a VS Code authentication session for an Azure subscription.
* Always uses the default scope, `https://management.azure.com/.default/.default.`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Clarify here that it will respect the microsoft-sovereign-cloud.environment setting.

@nturinski nturinski merged commit bbd9dbf into main Aug 6, 2024
4 checks passed
@nturinski nturinski deleted the auth/nat/sessionScope branch August 6, 2024 17:42
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.

3 participants