Skip to content

Conversation

@acoburn
Copy link
Collaborator

@acoburn acoburn commented Nov 15, 2023

As with #775 this creates an integration module for Quarkus with a similar set of methods

@acoburn acoburn requested a review from a team as a code owner November 15, 2023 20:27
@acoburn acoburn changed the title JCL-442: Add quarkus module JCL-442: Add a quarkus integration module Nov 15, 2023
Copy link
Contributor

@langsamu langsamu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is nothing really Quarkus about this functionality. Just MP. I like it.

Maybe better to name it such so it inspires use with frameworks/contexts other than Quarkus.

If there are ever more such utilities that are really for Quarkus then a collecting module might be created (like runtime).

* @return the session, if present and unexpired
*/
public static Optional<Session> asSession(final JsonWebToken jwt, final Function<String, Session> mapping) {
if (Instant.now().isBefore(Instant.ofEpochSecond(jwt.getExpirationTime()))) {
Copy link
Contributor

@langsamu langsamu Nov 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should it be the responsibility of this conversion utility to enforce expiry?

JWT validation is more than expiry. I would aim either for all validation or none at all.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Microprofile gives us a lot of flexibility with validation, and I think it would be better to just defer to those mechanisms. Which is to say that, unlike with Spring, we really don't have a need to enforce/validate expiration dates here.

@acoburn
Copy link
Collaborator Author

acoburn commented Nov 17, 2023

I had initially titled this module inrupt-client-microprofile, because, as you describe, it is not really quarkus-specific. However, I opted to use quarkus in the title because there are other features that I'd like to add to this (eventually), such as CDI injection of a Client and/or SolidClient. And from a user's perspective, if they are using quarkus, they may not care about microprofile per se, and that ease of use is significant

@acoburn acoburn merged commit de137e3 into main Nov 17, 2023
@acoburn acoburn deleted the JCL-442-quarkus-module branch November 17, 2023 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants