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

Canonicalise empty env/plugins/matrix to nil for sign/verify #45

Merged
merged 1 commit into from
Aug 26, 2024

Conversation

DrJosh9000
Copy link
Contributor

jcs does not canonicalise {} and [] to null (or vice-versa).

encoding/json would obey omitempty as a directive in a struct field tag, but the canonicalPayload isn't encoding Values as a struct - it's encoding a map[string]any.

Since there are a bunch of signatures floating about now, I made an educated guess that null would be the most common value for un-set env, plugins, and matrix. But this may still break some signatures.

@DrJosh9000 DrJosh9000 requested a review from a team August 26, 2024 04:47
Copy link
Contributor

@wolfeidau wolfeidau left a comment

Choose a reason for hiding this comment

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

👍🏻 🚀 NICE, seems like a good move to make this more consistent!

@DrJosh9000 DrJosh9000 merged commit c1c7160 into main Aug 26, 2024
1 check passed
@DrJosh9000 DrJosh9000 deleted the canonicalise-empty-to-nil branch August 26, 2024 04:50
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.

2 participants