You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by "tustvold (via GitHub)" <gi...@apache.org> on 2023/05/16 11:00:31 UTC

[GitHub] [arrow-rs] tustvold opened a new pull request, #4225: Standardise credentials API (#4223) (#4163)

tustvold opened a new pull request, #4225:
URL: https://github.com/apache/arrow-rs/pull/4225

   # Which issue does this PR close?
   
   <!--
   We generally require a GitHub issue to be filed for all bug fixes and enhancements and this helps us generate change logs for our releases. You can link an issue to this PR using the GitHub syntax. For example `Closes #123` indicates that this PR will close issue #123.
   -->
   
   Part of #4223
   Part of #4163
   
   # Rationale for this change
    
   <!--
   Why are you proposing this change? If this is already explained clearly in the issue then this section is not needed.
   Explaining clearly why changes are proposed helps reviewers understand your changes and offer better suggestions for fixes.
   -->
   
   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?
   
   <!--
   There is no need to duplicate the description in the issue here but it is sometimes worth providing a summary of the individual changes in this PR.
   -->
   
   # Are there any user-facing changes?
   
   
   <!--
   If there are user-facing changes then we may require documentation to be updated before approving the PR.
   -->
   
   <!---
   If there are any breaking changes to public APIs, please add the `breaking change` label.
   -->
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold merged pull request #4225: Standardise credentials API (#4223) (#4163)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold merged PR #4225:
URL: https://github.com/apache/arrow-rs/pull/4225


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] roeap commented on a diff in pull request #4225: Standardise credentials API (#4223) (#4163)

Posted by "roeap (via GitHub)" <gi...@apache.org>.
roeap commented on code in PR #4225:
URL: https://github.com/apache/arrow-rs/pull/4225#discussion_r1195661702


##########
object_store/src/azure/credential.rs:
##########
@@ -338,13 +342,15 @@ impl ClientSecretOAuthProvider {
 }
 
 #[async_trait::async_trait]
-impl TokenCredential for ClientSecretOAuthProvider {
+impl TokenProvider for ClientSecretOAuthProvider {
+    type Credential = AzureCredential;
+
     /// Fetch a token
     async fn fetch_token(
         &self,
         client: &Client,
         retry: &RetryConfig,
-    ) -> Result<TemporaryToken<String>> {
+    ) -> crate::Result<TemporaryToken<Arc<AzureCredential>>> {

Review Comment:
   ```suggestion
       ) -> crate::Result<TemporaryToken<Arc<Self::Credential>>> {
   ```
   
   probably not worth the change, but I find this a little bit more explicit when reading the code.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on pull request #4225: Standardise credentials API (#4223) (#4163)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on PR #4225:
URL: https://github.com/apache/arrow-rs/pull/4225#issuecomment-1549462193

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


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4225: Standardise credentials API (#4223) (#4163)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #4225:
URL: https://github.com/apache/arrow-rs/pull/4225#discussion_r1194995402


##########
object_store/src/client/mod.rs:
##########
@@ -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 {

Review Comment:
   This is the interface that will be made public as part of #4163 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [arrow-rs] tustvold commented on a diff in pull request #4225: Standardise credentials API (#4223) (#4163)

Posted by "tustvold (via GitHub)" <gi...@apache.org>.
tustvold commented on code in PR #4225:
URL: https://github.com/apache/arrow-rs/pull/4225#discussion_r1196329815


##########
object_store/src/azure/credential.rs:
##########
@@ -338,13 +342,15 @@ impl ClientSecretOAuthProvider {
 }
 
 #[async_trait::async_trait]
-impl TokenCredential for ClientSecretOAuthProvider {
+impl TokenProvider for ClientSecretOAuthProvider {
+    type Credential = AzureCredential;
+
     /// Fetch a token
     async fn fetch_token(
         &self,
         client: &Client,
         retry: &RetryConfig,
-    ) -> Result<TemporaryToken<String>> {
+    ) -> crate::Result<TemporaryToken<Arc<AzureCredential>>> {

Review Comment:
   I think I prefer being explicit about the type returned



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org