tom-s-powell commented on code in PR #14608:
URL: https://github.com/apache/iceberg/pull/14608#discussion_r2556691337


##########
aws/src/test/java/org/apache/iceberg/aws/TestAwsClientProperties.java:
##########
@@ -180,7 +180,7 @@ public void 
refreshCredentialsEndpointWithOverridingOAuthToken() {
     Map<String, String> properties =
         ImmutableMap.of(
             CatalogProperties.URI,
-            "http://localhost:1234/v1";,
+            "http://localhost:1234/v1/catalog";,

Review Comment:
   updating this just for consistency with 
`refreshCredentialsEndpointWithOAuthToken`



##########
aws/src/test/java/org/apache/iceberg/aws/TestAwsClientProperties.java:
##########
@@ -189,17 +189,22 @@ public void 
refreshCredentialsEndpointWithOverridingOAuthToken() {
             "specific-token");
     AwsClientProperties awsClientProperties = new 
AwsClientProperties(properties);
 
-    Map<String, String> expectedProperties =
-        ImmutableMap.<String, String>builder()
-            .putAll(properties)
-            .put("credentials.uri", "http://localhost:1234/v1/credentials";)
-            .build();
-
     AwsCredentialsProvider provider =
         awsClientProperties.credentialsProvider("key", "secret", "token");
     assertThat(provider).isInstanceOf(VendedCredentialsProvider.class);
     VendedCredentialsProvider vendedCredentialsProvider = 
(VendedCredentialsProvider) provider;
-    
assertThat(vendedCredentialsProvider).extracting("properties").isEqualTo(expectedProperties);
+    assertThat(vendedCredentialsProvider)

Review Comment:
   Previous:
   ```
   {
      "client.credentials-provider.token": "specific-token",
      "client.refresh-credentials-endpoint": 
"http://localhost:1234/v1/credentials";,
      "credentials.uri": "http://localhost:1234/v1/credentials";,
      "token": "oauth-token",
      "uri": "http://localhost:1234/v1/catalog";
   }
   ```
   
   New:
   ```
   {
      "client.refresh-credentials-endpoint": 
"http://localhost:1234/v1/credentials";,
      "credentials.uri": "http://localhost:1234/v1/credentials";,
      "token": "specific-token",
      "uri": "http://localhost:1234/v1/catalog";
   }
   ```
   
   Here you can see that `VendedCredentialsProvider` is now receiving a single 
`token` property rather than `token` and `client.credentials-provider.token`. 
However, the value of `token` it receives is actually the value of 
`client.credentials-provider.token` which has overridden the original `token` 
property. 
   
   My impression from reading the implementation of `VendedCredentialsProvider` 
is that this is actually more desirable behaviour, in that (a) it never 
references the prefixed properties and (b) `PropertyUtil.propertiesWithPrefix` 
filters properties with a prefix then removes the prefix (i.e., you would not 
expect to receive the prefixed property). 
   
   I'm kind of confused what this test was previously testing as it didn't seem 
to be reflecting any property overrides. 



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to