nastra commented on code in PR #12555:
URL: https://github.com/apache/iceberg/pull/12555#discussion_r2011733123


##########
aws/src/main/java/org/apache/iceberg/aws/RESTSigV4AuthManager.java:
##########
@@ -36,22 +38,58 @@
 @SuppressWarnings("unused") // loaded by reflection
 public class RESTSigV4AuthManager implements AuthManager {
 
-  private final Aws4Signer signer = Aws4Signer.create();
+  private final Aws4Signer signer;
   private final AuthManager delegate;
 
   private Map<String, String> catalogProperties = Map.of();
 
   public RESTSigV4AuthManager(String name, AuthManager delegate) {
     this.delegate = Preconditions.checkNotNull(delegate, "Invalid delegate: 
null");
+    signer = Aws4Signer.create();
   }
 
+  private RESTSigV4AuthManager(AuthManager delegate, Aws4Signer signer) {
+    this.delegate = Preconditions.checkNotNull(delegate, "Invalid delegate: 
null");
+    this.signer = signer;
+  }
+
+  @Override
+  public AuthManager withClient(RESTClient client) {
+    return new RESTSigV4AuthManager(delegate.withClient(client), signer);
+  }
+
+  @Override
+  public AuthSession authSession(AuthScope scope) {
+    AwsProperties awsProperties;
+    if (scope instanceof AuthScopes.Catalog) {
+      this.catalogProperties = scope.properties();
+      awsProperties = new AwsProperties(catalogProperties);
+    } else {
+      awsProperties = new AwsProperties(RESTUtil.merge(catalogProperties, 
scope.properties()));
+    }
+
+    return new RESTSigV4AuthSession(signer, delegate.authSession(scope), 
awsProperties);
+  }
+
+  /**
+   * @deprecated since 1.9.0, will be removed in 1.10.0; use {@link 
#authSession(AuthScope)}
+   *     instead.
+   */
   @Override
+  @Deprecated
+  @SuppressWarnings("deprecation")

Review Comment:
   I don't think this is necessary. All the other components that we deprecate 
don't suppress this warning, since we want to make sure that users see this 
deprecation and switch to the new API



-- 
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