rmannibucau commented on code in PR #7:
URL: https://github.com/apache/geronimo-jwt-auth/pull/7#discussion_r1562554479


##########
src/main/java/org/apache/geronimo/microprofile/impl/jwtauth/jwt/KidMapper.java:
##########
@@ -79,9 +101,48 @@ private void init() {
                                     .collect(Collectors.toSet()))
                                 .orElseGet(HashSet::new);
         ofNullable(config.read("issuer.default", config.read(Names.ISSUER, 
null))).ifPresent(defaultIssuers::add);
+        jwksUrl = config.read("mp.jwt.verify.publickey.location", null);
+        readerFactory = Json.createReaderFactory(emptyMap());
+        ofNullable(jwksUrl).ifPresent(url -> {
+            HttpClient.Builder builder = HttpClient.newBuilder();
+            if (getJwksRefreshInterval() != null) {
+                long secondsRefresh = getJwksRefreshInterval();
+                backgroundThread = 
Executors.newSingleThreadScheduledExecutor();

Review Comment:
   ok for the protected method for me
   
   for the thread factory just pass a param: 
`Executors.newSingleThreadScheduledExecutor(worker -> new Thread(worker, 
KidMapper.class.getName()))` since we'll get a single thread we don't need a 
counter or anything fancy.
   
   it does not help the code flow but if you do a jstack/kill -3/... on the jvm 
you will identify  the thread instead of having a banalised `pool-1-thread-1` 
or anything like that.



-- 
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: dev-unsubscr...@geronimo.apache.org

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

Reply via email to