-
Notifications
You must be signed in to change notification settings - Fork 59
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
Allow retrieving claims by using the Claims enum #154
Comments
@andreas-eberle +1, |
This is a compatible change since it just adds a method, so it can be included in 1.2 |
@rdebusscher it is compatible for the users but requires the implementations to update their existing implementation code. I don't really mind to be honest from our own implementation's point of vew, but we can't just do it for the minor release ? |
It is no problem that a minor release require a change to the implementation code. In fact, that is the general rule, otherwise not much will change. However, It can't introduce a breaking change. So I agree that this change, small (only a couple of lines) but very helpful for the developers. |
@rdebusscher That said the focus is on the users, so well, I don't mind it be included in 1.2 then. |
Sounds good. @andreas-eberle Go ahead please with your PR :-) |
I added the methods with default implementations forwarding to the old methods. So the code is doing exactly the same and other implementations also should not have to adapt anything. |
Very good, thanks |
@andreas-eberle @rdebusscher |
My understanding of this plugin is that the interfaces can not be changed for a given baseline, any idea how it can be fixed ? |
MP Config has this configuration:
But I'm not sure what can we put there in our case to allow new method additions to the existing interfaces available in 1.1.1. Has someone dealt with a similar issue before ? I can do a PR myself once I know how to fix it |
From what I see in the pom, the used bnd plugin versions seem very old (October 2017) while there exist a newer version 5.0 from January 2020. Maybe these problems are fixed in the newer versions? |
@sberyozkin, @rdebusscher : It seems the relevant version is actually the version in the annotation here https://github.com/andreas-eberle/microprofile-jwt-auth/blob/add-get-claims-with-claims/api/src/main/java/org/eclipse/microprofile/jwt/package-info.java#L40 and not the dependency version. The plugin wants us to increase this version from 1.0 to 1.1. It does not accept an increase from 1.0 to 1.0.1. Should I add this increase in my PR or should we try to find a way to not make this increase? |
Btw, you can get more details on the error message when using the following as configuration for the bnd-baseline-maven-plugin.
|
Hi @andreas-eberle Thanks, so the next version will be |
Although I never really worked with osgi, I think it would make sense to have the same osgi version tag as the module version. However, you have two packages under the org.eclipse.microprofile main package with both having their own package-info.java file. This will mean you sometimes will increase the version of one of these packages without changing the classes in that package. Just so you are aware of that. I don't think this is an issue. Will you make a PR to increase the version again, or should I send you one? |
Hi @andreas-eberle You may have seen a microprofile forum thread, @Emily-Jiang explained how this plugin operates. So indeed, lets do the following:
And please resubmit your PR alongside those changes; please use Thanks |
@sberyozkin: I added the changes to my branch and opened a new PR #158. |
I think it would be a good idea to add a method
JsonWebToken.getClaim(Claims claim)
to allow retrieving claims by using theClaims
enum. At the moment one is forced to write unnecessarily bloated code likejwt.getClaim(Claims.groups.name())
. This is even true for the default methods given in the interfaceJsonWebToken
. Adding this method could make code more readable.Let me know if you want a PR for this.
The text was updated successfully, but these errors were encountered: