-
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
Long or JsonValue #100
Comments
I think how we define the behavior is that non-standard claims should be the underlying JsonValue type as these are just direct mappings from the payload. |
@starksm64 perhaps an idea, but for a next version of JWT it might make sense to remove all the conversion and mapping requirements from the JWT spec, and delegate that all to a potential MP Conversion Spec? |
The jwt.getClaim("") method is not properly typed - there is no way how to find out which type is expected by the consumer.
You will compile successfully, yet fail horribly in runtime, as the "getClaim" method has no chance of knowing what to return. |
It's been a few months later now when I last proposed a convertor spec. Wonder how people think about it now. |
@arjantijms I think a converter spec makes sense. Did you propose this to a larger group, or just here? There is also a chat in MP Config about a converter spec: eclipse/microprofile-config#514 |
@radcortez Didn't propose it so much to a larger group, though I did had a blog about it: https://arjan-tijms.omnifaces.org/2014/08/high-time-to-standardize-java-ee.html |
I think this should be proposed in the new groups (either MP or Jakarta). I guess your blog is from a time, when things were a little "dormant" so to say. Should have more acceptance now :) |
@radcortez Indeed, the either MP or Jakarta is however a new problem ;) Since both groups are separate pending discussions, it does make quite a difference. If I'm not mistaken Jakarta can't use/depend on MP now, but MP can't (easily) add new Jakarta stuff since that would mean additional dependencies, |
Well, right now it would be easier for MP to include stuff from Jakarta than the other way around. There are a few things being discussed in the MP group to allow Jakarta to use MP stuff. For instance, a lot of specs are interested and could benefit from MP Config. I don't want in anyway way to "highjack" your work. Are you willing to try to propose this again to either group, and we can try to figure out where it should fall? I'm happy to help. |
Hi All, adding David's @dblevins requirement from #114, IMHO we'd be better off keeping it all within a single issue to do with type safe retrieval of the claims.
|
And here is a related question/requirement from @ivanjunckes:
|
There is a discussion in MP Config about exposing the available Converter facilities. Since MP JWT depends directly from Config already, maybe we can leverage some of this work together. |
@radcortez Sounds reasonable to have the typed claims retrieval and injection built around them.
given this Address claim ? I.e would the converter accept JSON objects so that the custom converter could bind it to an |
If we use the current Converter API present in MP Config, the source object is always a String. So on your converter you could just use Jsonb and pick up the string and convert it into the object. |
@radcortez |
We should probably not rush in any case :-), and discuss it properly in time for 2.0. IMHO this is the main area of improvement for 2.0 |
Yes, the proper way to solve this is to have a separate Converter spec flexible enough that each spec can use. We are going to try to do some working prototype in the SmallRye project to extract the conversion code to its own library and figure out if we can make that an API on its own. |
@radcortez That is a neat idea, but what would happen if an application combines several MP specs, each of them having their own Converter providers. If it works out it would be massive :-), but it may make sense also consider small type-converter facilities which are optimized for a specific spec. IMHO we'll need to get this issue done for the major release, do we have just a few months for it ? Thanks |
Hey guys I have an implementation question. What should be returned when we do:
jwt.getClaim("customClaimLong");
Should it be a Long or a JsonValue? It makes more sense to me to be a Long as we are in Java and all the other claims for the Claims enum return the long wrapper.
The text was updated successfully, but these errors were encountered: