Skip to content

Conversation

@isra-fel
Copy link
Member

@isra-fel isra-fel commented Jun 2, 2025

To enable updating the auth scope, this PR adds it to the environment. There will be a follow-up PR to update Set-AzEnvironment and logic in SshCredentialFactory in azure-powershell repo.

@isra-fel isra-fel requested a review from Copilot June 2, 2025 06:55
Copy link
Contributor

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

Adds SSH authentication scopes to the Azure environment abstraction so that SSH credential logic can pick up the correct resource scope.

  • Introduce AzureSshAuthScope (and region-specific variants) in AzureEnvironmentConstants
  • Extend ExtendedEndpoint and AzureEnvironmentExtensions.SetEndpoint to handle the new scope
  • Populate built-in environments (public, China, USGov) with the SSH auth scope property

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/Authentication.Abstractions/Extensions/AzureEnvironmentExtensions.cs Handle AzureSshAuthScope in the SetEndpoint switch
src/Authentication.Abstractions/AzureEnvironmentConstants.cs Define AzureSshAuthScope, ChinaSshAuthScope, USGovernmentSshAuthScope
src/Authentication.Abstractions/AzureEnvironment.cs Add AzureSshAuthScope member to ExtendedEndpoint
src/Authentication.Abstractions/AzureEnvironment.BuiltIn.cs Set the new SSH auth scope property on built-in environments
Comments suppressed due to low confidence (2)

src/Authentication.Abstractions/AzureEnvironment.BuiltIn.cs:168

  • Add unit tests to verify that the built-in environments for AzureCloud, AzureChinaCloud, and AzureUSGovernment include the new AzureSshAuthScope property with the expected constant values.
azureEnvironments[EnvironmentName.AzureCloud].SetProperty(ExtendedEndpoint.AzureSshAuthScope, AzureEnvironmentConstants.AzureSshAuthScope);

src/Authentication.Abstractions/AzureEnvironmentConstants.cs:299

  • The <see> cref references SshCredentialFactory, which may live in a different assembly. Consider qualifying it with its full namespace or removing the tag if it won’t resolve in this project’s documentation build.
/// The scope for SSH authentication. See <see cref="SshCredentialFactory"/>

@isra-fel isra-fel merged commit 6186daf into Azure:main Jun 3, 2025
2 checks passed
@isra-fel isra-fel deleted the ssh-scope branch June 3, 2025 00:36
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