Skip to content

Fix JWT claims update if headers are passed in request#3918

Merged
Jarema merged 1 commit intomainfrom
jarema/fix-claims-update-with-headers
Feb 28, 2023
Merged

Fix JWT claims update if headers are passed in request#3918
Jarema merged 1 commit intomainfrom
jarema/fix-claims-update-with-headers

Conversation

@Jarema
Copy link
Copy Markdown
Member

@Jarema Jarema commented Feb 28, 2023

Claims update message requires only payload to be passed, but passing headers should not fail the request.
This change ensures we extract the payload from the raw message before decoding it.
Before this change, passing claims update with headers would return cryptic expected x chunks error.

Signed-off-by: Tomasz Pietrek tomasz@nats.io

@Jarema Jarema requested a review from a team as a code owner February 28, 2023 08:43
@Jarema Jarema force-pushed the jarema/fix-claims-update-with-headers branch 3 times, most recently from d82e9ed to 606c0cf Compare February 28, 2023 10:00
Claims update message requires only payload to be passed,
but passing headers should not fail the request.
This change ensures we extract payload from raw message
before decoding it.
Before this change, passing claims update with headers
would return cryptic `expected x chunks` error.

Signed-off-by: Tomasz Pietrek <tomasz@nats.io>
@Jarema Jarema force-pushed the jarema/fix-claims-update-with-headers branch from 606c0cf to 8732022 Compare February 28, 2023 10:09
Copy link
Copy Markdown
Member

@neilalexander neilalexander left a comment

Choose a reason for hiding this comment

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

LGTM

@Jarema Jarema merged commit bca45c2 into main Feb 28, 2023
@Jarema Jarema deleted the jarema/fix-claims-update-with-headers branch February 28, 2023 10:43
Copy link
Copy Markdown
Member

@derekcollison derekcollison left a comment

Choose a reason for hiding this comment

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

LGTM

@aricart
Copy link
Copy Markdown
Member

aricart commented Feb 28, 2023

the expected 3 chunks error means that the string that the library tried to decode wasn't 3 string octects separated by ..

neilalexander added a commit that referenced this pull request Oct 10, 2025
Follow-up of #3918, also
stripping headers when performing a JWT delete.

Signed-off-by: Maurice van Veen <github@mauricevanveen.com>
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