-
Notifications
You must be signed in to change notification settings - Fork 268
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
Support custom ImdsId for AppServiceManagedIdentityCredential. #2284
base: main
Are you sure you want to change the base?
Conversation
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.
Thanks for the contribution, but I don't think we can expose much of this publicly and probably already have too much public for the next beta release where we'll better align with other languages' versions of azure_identity
. That's not to say we can't have some idiomatic rust-specifics, but it seems the AppServiceManagedIdentityCredential
shouldn't even be public.
For that alone I'd still merge this, but then the whole reason for exposing the IMDS type evaporates. We also won't expose the cache. It's not like people can't write their own if needed. We don't want to expose types unless necessary or highly requested becuase we'll have to support them as-is in perpetuity. Instead, we will probably have a more robust cache that can be securely persisted a la https://github.com/Azure/azure-sdk-for-go/blob/main/sdk/azidentity/cache/cache.go. So we wouldn't expose this simple in-memory cache as-is.
@@ -1,5 +1,16 @@ | |||
# Release History | |||
|
|||
## 0.23.0 (?) |
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.
## 0.23.0 (?) | |
## 0.23.0 (Unreleased) |
@hallipr can we get the bot hooked up to make these changes automatically soon?
@@ -19,7 +19,10 @@ pub struct AppServiceManagedIdentityCredential { | |||
} | |||
|
|||
impl AppServiceManagedIdentityCredential { | |||
pub fn new(options: impl Into<TokenCredentialOptions>) -> azure_core::Result<Arc<Self>> { |
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.
@chlowell @scottaddie should this type even be exposed publicly? I'm close to refactoring azure_identity
and I remember talking about how only ManagedIdentityCredential
should be exposed and all the "implementation-specific" credentials should be internal. That would significantly affect the need for this PR and force consideration for how else to pass the IMDS ID. Comparing with Go's azidentity, I see it's just an implementation detail. I'm guessing this equates to ManagedIdentityCredentialOptions.ManagedIDKind
? I'm not sure, though, since the only implementations I see are all user-assigned variants.
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.
A unified ManagedIdentityCredential
credential makes sense to me. When to call the IMDS static IP endpiont and when to call a environment specific endpoint I guess switches on the presence of IDENTITY_ENDPOINT
in env?
For any Managed Identity credential it is important to be somehow able to specify whether to use a specific ClientId or just use the endpoints default.
Understandable on both fronts. |
…implementing a custom TokenCredential." This reverts commit c646422.
Possibly. We're discussing in the Identity v-team. But I can say you won't be able to use these changes for long, and even then would have to use a patched git reference to |
Happy to not actually PR this then. For now I am referencing my fork for usage of |
This matches the interface of
VirtualMachineManagedIdentityCredential
, it enables specifying aclient_id
to use for Identities being served not via the VM local Imds endpoint.