danielcweeks commented on code in PR #18756:
URL: https://github.com/apache/iceberg/pull/18756#discussion_r4446958359


##########
core/src/main/java/org/apache/iceberg/rest/RESTClient.java:
##########
@@ -226,4 +226,14 @@ <T extends RESTResponse> T postForm(
   default RESTClient withAuthSession(AuthSession session) {
     return this;
   }
+
+  /**
+   * Unwraps this client to the given type, if possible. This allows callers 
to access the
+   * underlying HTTP library used by this client.
+   *
+   * @return the unwrapped client, or null if this client cannot be unwrapped 
to the given type
+   */
+  default <T> T unwrap(Class<T> type) {
+    return type.isInstance(this) ? type.cast(this) : null;
+  }

Review Comment:
   This feels like an awkward workaround.  Why don't we just have a an 
HttpClient implementation for the auth manager as opposed to poking through the 
implementation like this?
   
   Also, doesn't this create an issue with how the underlying http client was 
configured if different from what's necessary for the auth server?



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