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

ParseUnverified godoc update #340

Closed
duhaesbaert opened this issue Aug 22, 2023 · 1 comment
Closed

ParseUnverified godoc update #340

duhaesbaert opened this issue Aug 22, 2023 · 1 comment

Comments

@duhaesbaert
Copy link
Contributor

This is sort of a nitpick or my side, but the godoc for the ParseUnverified is the following:

// ParseUnverified parses the token but doesn't validate the signature.
//
// WARNING: Don't use this method unless you know what you're doing.
//
// It's only ever useful in cases where you know the signature is valid (because it has
// been checked previously in the stack) and you want to extract values from it.

The part that I would suggest changing is because it has been checked previously in the stack, that does not necessarily must be true, for example, when receiving a JWT that will be validated after the parse has happened, we should be exposed to any risks as well.

So the godoc could be something like:

// ParseUnverified parses the token but doesn't validate the signature.
//
// WARNING: Don't use this method unless you know what you're doing.
//
// It's only ever useful in cases where you know the signature is valid (since it has already 
// been or will be checked elsewhere in the stack) and you want to extract values from it.

Opening an issue to understand if that makes sense, and if so I can open this really short PR to fix as well.

@oxisto
Copy link
Collaborator

oxisto commented Aug 22, 2023

Looks fine to be, feel free to open a PR for this :)

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

No branches or pull requests

2 participants