Skip to content
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

TOMEE-4284 - Implement tomee.mp.jwt.allow.no-exp property over mp.jwt.tomee.allow.no-exp #990

Closed

Conversation

tichovz
Copy link
Contributor

@tichovz tichovz commented Dec 18, 2022

…no-exp

@tichovz
Copy link
Contributor Author

tichovz commented Dec 18, 2022

@rzo1
Copy link
Contributor

rzo1 commented Nov 15, 2023

Do we have an issue for this one @tichovz ?

@tichovz
Copy link
Contributor Author

tichovz commented Nov 15, 2023

Hi!

I have no issues for this, but David asked if could take a look at it.

On Nov 9, 2022, at 10:29 AM, Zoltán Tichov <[email protected]> wrote:

Hi!

Is there another task that could be taken care of?

There's a change in the same code that's on my "I should really find the time to fix that" list if you want to dig in.

Basically, we added a TomEE-specific property mp.jwt.tomee.allow.no-exp. We likely should avoid putting custom properties in >the mp.jwt.* namespace and likely we should:

  • rename it to something that starts with tomee like say tomee.mp.jwt.allow.no-exp
  • ensure both properties work for backwards compatibility
  • tomee.mp.jwt.allow.no-exp would win if both were defined
  • any use of mp.jwt.tomee.allow.no-exp should get a warning log message
  • create an itest or two in itests/microprofile-jwt-itests/ that uses the property
  • update docs/microprofile/jwt.adoc
  • File JIRA cause I haven't done that yet, LOL :)

The runtime change will be a piece of cake for you. Most the work would be in the itest, which could be kind of new/fun to do.

Thoughts?

@rzo1
Copy link
Contributor

rzo1 commented Nov 15, 2023

Thanks. That was the missing link, so maybe you can just rebase and we do a CI build to see, if it breaks anything?

@tichovz
Copy link
Contributor Author

tichovz commented Nov 15, 2023

Thanks, Would I make a rebase with the main branch or the 9.x branch?

@rzo1
Copy link
Contributor

rzo1 commented Nov 15, 2023

Let's test against main and if it looks nice, we should backport to 9.1.x too

@tichovz
Copy link
Contributor Author

tichovz commented Nov 20, 2023

I made a rebase to main and it seems ok.

@@ -117,6 +119,15 @@ private JWTAuthConfiguration createJWTAuthConfiguration() {
config.getOptionalValue("mp.jwt.decrypt.key.algorithm", String.class).orElse(null),
config.getOptionalValue("mp.jwt.verify.publickey.algorithm", String.class).orElse(null));
}

private Boolean queryAllowExp(){
Copy link
Contributor

Choose a reason for hiding this comment

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

    private Boolean queryAllowExp(){
        return config.getOptionalValue("tomee.mp.jwt.allow.no-exp", Boolean.class)
                .or(() -> config.getOptionalValue("mp.jwt.tomee.allow.no-exp", Boolean.class)
                        .map(value -> {
                            CONFIGURATION.warning("mp.jwt.tomee.allow.no-exp property is deprecated, use tomee.mp.jwt.allow.no-exp propert instead.");
                            return value;
                        }))
                .orElse(false);
    }

to avoid to read both entries all the time (Config can be slow depending the ConfigSource) and to avoid the AtomicBoolean which is not needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the improvement.

Copy link
Contributor

Choose a reason for hiding this comment

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

@tichovz Can you include the feedback provided by Romain? :)

@rzo1 rzo1 changed the title Implement tomee.mp.jwt.allow.no-exp property over mp.jwt.tomee.allow.… TOMEE-4284 - Implement tomee.mp.jwt.allow.no-exp property over mp.jwt.tomee.allow.no-exp Nov 29, 2023
@tichovz tichovz closed this Dec 3, 2023
@tichovz tichovz deleted the mp-jwt-tomee.mp.jwt.allow.no-exp-property branch December 3, 2023 18:31
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.

3 participants