-
Notifications
You must be signed in to change notification settings - Fork 6
JCL-442: Add a quarkus integration module #776
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this 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()))) { |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
|
I had initially titled this module |
As with #775 this creates an integration module for Quarkus with a similar set of methods