chibenwa commented on code in PR #2744: URL: https://github.com/apache/james-project/pull/2744#discussion_r2166874094
########## server/protocols/jwt/src/main/java/org/apache/james/jwt/JwtTokenVerifier.java: ########## @@ -67,12 +99,19 @@ public static JwtTokenVerifier create(JwtConfiguration jwtConfiguration) { private static final Logger LOGGER = LoggerFactory.getLogger(JwtTokenVerifier.class); + private final JwtParser kidJwtParser; private final List<JwtParser> jwtParsers; public JwtTokenVerifier(PublicKeyProvider pubKeyProvider) { + // one parser that performs key lookup by kid + this.kidJwtParser = toImmutableJwtParser(h -> { + String kid = Objects.requireNonNull((String)h.get("kid")); + return pubKeyProvider.get(kid).orElse(null); Review Comment: Do not use null -- 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: notifications-unsubscr...@james.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: notifications-unsubscr...@james.apache.org For additional commands, e-mail: notifications-h...@james.apache.org