-
Notifications
You must be signed in to change notification settings - Fork 867
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
Standardise credentials API (#4223) (#4163) #4225
Conversation
@@ -503,6 +506,90 @@ impl GetOptionsExt for RequestBuilder { | |||
} | |||
} | |||
|
|||
/// Provides credentials for use when signing requests | |||
#[async_trait] | |||
pub trait CredentialProvider: std::fmt::Debug + Send + Sync { |
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.
This is the interface that will be made public as part of #4163
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.
Looking great.
In a follow-up I would like to look into if we can make the scopes / resources in the oAuth flows somehow configurable, without out crating too much chaos :).
/// Fetch a token | ||
async fn fetch_token( | ||
&self, | ||
client: &Client, | ||
retry: &RetryConfig, | ||
) -> Result<TemporaryToken<String>> { | ||
) -> crate::Result<TemporaryToken<Arc<AzureCredential>>> { |
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.
) -> crate::Result<TemporaryToken<Arc<AzureCredential>>> { | |
) -> crate::Result<TemporaryToken<Arc<Self::Credential>>> { |
probably not worth the change, but I find this a little bit more explicit when reading the code.
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.
I think I prefer being explicit about the type returned
Which issue does this PR close?
Part of #4223
Part of #4163
Rationale for this change
In order to expose extension points that relate to authorization and credentials, it helps to have a standard abstraction for representing this.
What changes are included in this PR?
Are there any user-facing changes?