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

Update: JSON Web Token Cheat Sheet for Java #1176

Open
chalbersma opened this issue Jul 26, 2023 · 15 comments
Open

Update: JSON Web Token Cheat Sheet for Java #1176

chalbersma opened this issue Jul 26, 2023 · 15 comments
Labels
ACK_OBTAINED Issue acknowledged from core team so work can be done to fix it. HELP_WANTED Issue for which help is wanted to do the job. UPDATE_CS Issue about the update/refactoring of a existing cheat sheet.

Comments

@chalbersma
Copy link

What is missing or needs to be updated?

How difficult would it be to make this multi-language? JWT's have sort of become a web standard as an authentication/authorization primitive. It would be nice to have the common operations (parsing, validating,
best practices etc...) spelled out in various languages (like python, nodejs etc...).

How should this be resolved?

Either the creation of a JSON Web Token Cheat Sheet for or generalizing the Java cheat sheet. That might be something I could contribute to. But I'm not necessarily a JWT expert.

@chalbersma chalbersma added ACK_WAITING Issue waiting acknowledgement from core team before to start the work to fix it. HELP_WANTED Issue for which help is wanted to do the job. UPDATE_CS Issue about the update/refactoring of a existing cheat sheet. labels Jul 26, 2023
@szh
Copy link
Collaborator

szh commented Jul 26, 2023

I would love to see this made generic. As you said, JWTs are used in many languages.

@kwwall
Copy link
Collaborator

kwwall commented Jul 26, 2023

If you ignore the code examples, most of this CS is already generic, so are you (@chalbersma) wanting a CS that has examples with examples of other programming languages such as Python, NodeJS, etc.? That would be unwieldy if all crammed into a single CS, but probably doable if we want multiple ones per language. If that is done, then the contents of this CS should be refactored into a language-neutral one that once discusses JWT (both things to do and things to avoid) in a common JWT cheat sheet and this one for Java should be refactored to take advantage of the common one. Either that or just write all the examples in some suitable pseudo-code. I just don't think doing this correctly would be trivial. Sure, someone could copy the "JSON Web Token Cheat Sheet for Java" and only change the examples to (say) Python, but that doesn't scale well since if some common JWT advise needs to be revised (which seems inevitable in the long term), then it needs to get updated in multiple places.

So the bottom line here I think is to proceed with caution here and don't underestimate the effort involved.

Just my $.02.

@szh
Copy link
Collaborator

szh commented Jul 26, 2023

I think it makes more sense to just maintain a generic one, using Java or pseudo-code or whatever language. I don't think it's necessary or worthwhile to keep separate cheat sheets for different languages or to have multiple language code samples.
I think the best path forward is to just generalize the existing CS and remove "for Java" from the name.

@kwwall
Copy link
Collaborator

kwwall commented Jul 27, 2023

Per @szh -

I think the best path forward is to just generalize the existing CS and remove "for Java" from the name.

I agree. I think removing the "for Java" will go a long way to set expectations. Doing that and just explaining at the beginning that Java was just selected as the language to illustrate examples might be all that is needed.

@jmanico
Copy link
Member

jmanico commented Jul 27, 2023 via email

@szh szh added ACK_OBTAINED Issue acknowledged from core team so work can be done to fix it. and removed ACK_WAITING Issue waiting acknowledgement from core team before to start the work to fix it. labels Jul 28, 2023
@szh
Copy link
Collaborator

szh commented Jul 28, 2023

Great, seems like we agree on a path forward. @chalbersma do you want to spearhead this effort and submit a PR for it?

@chalbersma
Copy link
Author

Oof, I was hoping that just suggesting it would make someone with more time take it over. Additionally part of the reason I was looking at the guide in the first place is that I'm not certain that I actually have the expertise to write the guide. In theory, I know what I'd want to see for generic examples (at least in Python). But it's likely that I would make some legitimate errors.

I'll see what I can come up with though.

@kwwall
Copy link
Collaborator

kwwall commented Aug 2, 2023

@chalbersma - I don't think what we are proposing requires a lot of technical depth, but just an investment on some of your time. One or 2 of us will review it so you don't need to be an expert in this specific case because I think the changes will be minor as per recommended in #1176 (comment).

@jmanico
Copy link
Member

jmanico commented Aug 7, 2023

I think this is a really good idea, how can I help support this?

@chalbersma
Copy link
Author

@jmanico I got some Friday freetime and made a super rough draft. Would love some feedback (or even a pull request or two).

@jmanico
Copy link
Member

jmanico commented Aug 11, 2023 via email

@kwwall
Copy link
Collaborator

kwwall commented Aug 11, 2023

Love the way the multi-language code example looks. Pretty sweet. Didn't even know you could do that in Markdown.

@chalbersma
Copy link
Author

Love the way the multi-language code example looks. Pretty sweet. Didn't even know you could do that in Markdown.

Oh ya the pymdown extensions essentially give you most of the nice features from sphinx in markdown if you want them.

@EbonyAdder
Copy link
Contributor

Not 100% sure where this proposal is at, but, I noticed there is still a "Help Wanted" tag. If assistance is still needed, I could help. I have experience with JWT security and multiple programming languages.

@jmanico
Copy link
Member

jmanico commented Nov 24, 2023

Not 100% sure where this proposal is at, but, I noticed there is still a "Help Wanted" tag. If assistance is still needed, I could help. I have experience with JWT security and multiple programming languages.

By all means, check out the draft and let us know what you think! Its listed above :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ACK_OBTAINED Issue acknowledged from core team so work can be done to fix it. HELP_WANTED Issue for which help is wanted to do the job. UPDATE_CS Issue about the update/refactoring of a existing cheat sheet.
Projects
None yet
Development

No branches or pull requests

5 participants