-
Notifications
You must be signed in to change notification settings - Fork 385
Implemented Service Exception for Imds Probe #5615
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
8 commits
Select commit
Hold shift + click to select a range
54c94c3
Implemented Service Exception for Imds Probe
Robbie-Microsoft 6eb7ec3
Implemented GitHub Feedback
Robbie-Microsoft 2a8d86f
Merge branch 'main' into rginsburg/msiv2_imds_probe_service_exception
Robbie-Microsoft 6609fc3
Implemented GitHub feedback
Robbie-Microsoft 499323d
Merge branch 'main' into rginsburg/msiv2_imds_probe_service_exception
Robbie-Microsoft 651e826
Merge branch 'main' into rginsburg/msiv2_imds_probe_service_exception
Robbie-Microsoft 9b7a5d8
Fixed typo in unshipped files
Robbie-Microsoft 12a57a9
fixed broken unit test
Robbie-Microsoft 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
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
51 changes: 51 additions & 0 deletions
51
src/client/Microsoft.Identity.Client/ManagedIdentity/ManagedIdentitySourceResult.cs
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 |
|---|---|---|
| @@ -0,0 +1,51 @@ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. | ||
|
|
||
| namespace Microsoft.Identity.Client.ManagedIdentity | ||
| { | ||
| /// <summary> | ||
| /// Result of managed identity source detection, including the detected source and any failure information from IMDS probes. | ||
| /// </summary> | ||
| /// <remarks> | ||
| /// This class is returned by <see cref="ManagedIdentityApplication.GetManagedIdentitySourceAsync"/> to provide | ||
| /// detailed information about managed identity source detection, including failure reasons when IMDS probes fail. | ||
| /// This information is useful for credential chains like DefaultAzureCredential to determine whether to skip | ||
| /// managed identity authentication entirely. | ||
| /// </remarks> | ||
| public class ManagedIdentitySourceResult | ||
| { | ||
| /// <summary> | ||
| /// Gets the detected managed identity source. | ||
| /// </summary> | ||
| /// <value> | ||
| /// The <see cref="ManagedIdentitySource"/> that was detected on the environment. | ||
| /// Returns <see cref="ManagedIdentitySource.None"/> if no managed identity source was detected. | ||
| /// </value> | ||
| public ManagedIdentitySource Source { get; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the failure reason from the IMDSv1 probe, if it failed. | ||
| /// </summary> | ||
| /// <value> | ||
| /// A string describing why the IMDSv1 probe failed, or <c>null</c> if the probe succeeded or was not attempted. | ||
| /// </value> | ||
| public string ImdsV1FailureReason { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Gets or sets the failure reason from the IMDSv2 probe, if it failed. | ||
| /// </summary> | ||
| /// <value> | ||
| /// A string describing why the IMDSv2 probe failed, or <c>null</c> if the probe succeeded or was not attempted. | ||
| /// </value> | ||
| public string ImdsV2FailureReason { get; set; } | ||
|
|
||
| /// <summary> | ||
| /// Initializes a new instance of the <see cref="ManagedIdentitySourceResult"/> class. | ||
| /// </summary> | ||
| /// <param name="source">The detected managed identity source.</param> | ||
| public ManagedIdentitySourceResult(ManagedIdentitySource source) | ||
| { | ||
| Source = source; | ||
| } | ||
| } | ||
| } |
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
12 changes: 10 additions & 2 deletions
12
src/client/Microsoft.Identity.Client/PublicApi/net462/PublicAPI.Unshipped.txt
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,8 +1,16 @@ | ||
| const Microsoft.Identity.Client.MsalError.ManagedIdentityAllSourcesUnavailable = "managed_identity_all_sources_unavailable" -> string | ||
| const Microsoft.Identity.Client.MsalError.ImdsServiceError = "imds_service_error" -> string | ||
| const Microsoft.Identity.Client.MsalError.ManagedIdentityAllSourcesUnavailable = "managed_identity_all_sources_unavailable" -> string | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2 | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2.FormatResultAsync(Microsoft.Identity.Client.AuthenticationResult authenticationResult, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2.ValidateCachedTokenAsync(Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData cachedTokenData) -> System.Threading.Tasks.Task<bool> | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData.MsalCacheValidationData() -> void | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData.PersistedCacheParameters.get -> System.Collections.Generic.IDictionary<string, string> | ||
| Microsoft.Identity.Client.ManagedIdentityApplication.GetManagedIdentitySourceAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource> | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV1FailureReason.get -> string | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV1FailureReason.set -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV2FailureReason.get -> string | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV2FailureReason.set -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ManagedIdentitySourceResult(Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource source) -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.Source.get -> Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource | ||
| Microsoft.Identity.Client.ManagedIdentityApplication.GetManagedIdentitySourceAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult> |
12 changes: 10 additions & 2 deletions
12
src/client/Microsoft.Identity.Client/PublicApi/net472/PublicAPI.Unshipped.txt
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,8 +1,16 @@ | ||
| const Microsoft.Identity.Client.MsalError.ManagedIdentityAllSourcesUnavailable = "managed_identity_all_sources_unavailable" -> string | ||
| const Microsoft.Identity.Client.MsalError.ImdsServiceError = "imds_service_error" -> string | ||
| const Microsoft.Identity.Client.MsalError.ManagedIdentityAllSourcesUnavailable = "managed_identity_all_sources_unavailable" -> string | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2 | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2.FormatResultAsync(Microsoft.Identity.Client.AuthenticationResult authenticationResult, System.Threading.CancellationToken cancellationToken = default(System.Threading.CancellationToken)) -> System.Threading.Tasks.Task | ||
| Microsoft.Identity.Client.AuthScheme.IAuthenticationOperation2.ValidateCachedTokenAsync(Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData cachedTokenData) -> System.Threading.Tasks.Task<bool> | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData.MsalCacheValidationData() -> void | ||
| Microsoft.Identity.Client.AuthScheme.MsalCacheValidationData.PersistedCacheParameters.get -> System.Collections.Generic.IDictionary<string, string> | ||
| Microsoft.Identity.Client.ManagedIdentityApplication.GetManagedIdentitySourceAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource> | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV1FailureReason.get -> string | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV1FailureReason.set -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV2FailureReason.get -> string | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ImdsV2FailureReason.set -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.ManagedIdentitySourceResult(Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource source) -> void | ||
| Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult.Source.get -> Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySource | ||
| Microsoft.Identity.Client.ManagedIdentityApplication.GetManagedIdentitySourceAsync(System.Threading.CancellationToken cancellationToken) -> System.Threading.Tasks.Task<Microsoft.Identity.Client.ManagedIdentity.ManagedIdentitySourceResult> |
Oops, something went wrong.
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.