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

Standardise credentials API (#4223) (#4163) #4225

Merged
merged 4 commits into from
May 17, 2023

Conversation

tustvold
Copy link
Contributor

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?

@github-actions github-actions bot added the object-store Object Store Interface label May 16, 2023
@@ -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 {
Copy link
Contributor Author

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

@tustvold
Copy link
Contributor Author

@roeap perhaps you might be able to give this one a look, I believe you were interested in #4223

Copy link
Contributor

@roeap roeap left a 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>>> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
) -> 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.

Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
object-store Object Store Interface
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants