gulecroc commented on code in PR #24944:
URL: https://github.com/apache/pulsar/pull/24944#discussion_r2497721725


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/protocol/DefaultMetadataResolver.java:
##########
@@ -109,4 +71,30 @@ public static URL getWellKnownMetadataUrl(URL issuerUrl) {
             throw new IllegalArgumentException(e);
         }
     }
+
+    /**
+     * Resolves the authorization metadata.
+     *
+     * @return metadata
+     * @throws IOException if the metadata could not be resolved.
+     */
+    public Metadata resolve() throws IOException {
+
+        try {
+            Response response = httpClient.prepareGet(metadataUrl.toString())
+                    .addHeader(HttpHeaderNames.ACCEPT, 
HttpHeaderValues.APPLICATION_JSON)
+                    .execute()
+                    .toCompletableFuture()
+                    .get();
+
+            Metadata metadata;
+            try (InputStream inputStream = response.getResponseBodyAsStream()) 
{
+                metadata = this.objectReader.readValue(inputStream);
+            }
+            return metadata;
+
+        } catch (IOException | InterruptedException | ExecutionException e) {

Review Comment:
   InterruptedException was not restored here too : 
https://github.com/gulecroc/pulsar/blob/edd1739f61fe75b8bb87ed4484a94fc89dbff8fa/pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/protocol/TokenClient.java#L113
   I will fix both



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

Reply via email to