Skip to content

Set token.Signature in ParseUnverified#414

Merged
oxisto merged 2 commits intogolang-jwt:mainfrom
slickwilli:main
Jan 28, 2026
Merged

Set token.Signature in ParseUnverified#414
oxisto merged 2 commits intogolang-jwt:mainfrom
slickwilli:main

Conversation

@slickwilli
Copy link
Copy Markdown
Contributor

Sets the token's Signature field in ParseUnverified as discussed in #413

@oxisto
Copy link
Copy Markdown
Collaborator

oxisto commented Jan 28, 2026

Sorry for the major delay on that, somehow this completely slipped through. What are your thoughts on that @mfridman? I would be ok with it.

Comment thread parser.go
@mfridman
Copy link
Copy Markdown
Member

No issues from my end.

@oxisto
Copy link
Copy Markdown
Collaborator

oxisto commented Jan 28, 2026

No issues from my end.

Great. I will adjust this PR to avoid the double-setting of the signature though

@oxisto oxisto requested a review from mfridman as a code owner January 28, 2026 19:21
Copy link
Copy Markdown
Collaborator

@oxisto oxisto left a comment

Choose a reason for hiding this comment

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

@mfridman please have another look at my optimised version

@oxisto oxisto merged commit dce8e4d into golang-jwt:main Jan 28, 2026
11 checks passed
@samfoxcode
Copy link
Copy Markdown

@mfridman @oxisto - previously ParseUnverified did not validate the signature, but with this PR the signature is being validated by way of base64 and if the signature is not valid base64 it will error. Since this differs from the documented behavior of the method (ParseUnverified parses the token but **does not** validate the signature) should this be published as a breaking change and not a patch? Currently this was pushed in 5.3.1 as a patch but this is an unexpected behavior change that now causes an error to be returned.

I've opened an issue here as well: #499

@mfridman
Copy link
Copy Markdown
Member

Thanks @samfoxcode we'll take a look!

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.

4 participants