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

feat: jws signature validation #498

Merged
merged 7 commits into from
Aug 26, 2024
Merged

Conversation

dav1do
Copy link
Contributor

@dav1do dav1do commented Aug 20, 2024

Implements event validation using did:key/JWS. This verifies the envelope and makes sure the cacao grants access to the key that signed the payload. This builds on #495 (current target) and I had to make the cacao/pkh Verifier async since it can be a JWS based on the metadata.

This is not invoked anywhere and the tests currently only verify signatures for the valid events from the ceramic-sdk test vectors.

@dav1do dav1do requested review from a team and nathanielc as code owners August 20, 2024 22:18
@dav1do dav1do requested review from JulissaDantes and removed request for a team August 20, 2024 22:18
Copy link

linear bot commented Aug 20, 2024

validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
Copy link
Contributor

@samika98 samika98 left a comment

Choose a reason for hiding this comment

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

Looks great! Just a nit about adding dcstrings and comments, and also a question about naming.

validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/opts.rs Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
validation/src/verifier/key_verifier.rs Outdated Show resolved Hide resolved
@dav1do dav1do force-pushed the feat/aes-283-jws-envelope-signature branch from 183c85a to 44c0175 Compare August 21, 2024 18:16
@dav1do dav1do temporarily deployed to github-tests-2024 August 21, 2024 18:27 — with GitHub Actions Inactive
Base automatically changed from feat/aes-32-pkh-signature-validation to main August 22, 2024 16:52
@dav1do dav1do force-pushed the feat/aes-283-jws-envelope-signature branch 3 times, most recently from c190dfd to c9a89a9 Compare August 22, 2024 22:41
@dav1do dav1do temporarily deployed to github-tests-2024 August 22, 2024 22:50 — with GitHub Actions Inactive
- use input struct/enum for jws verification (kind of clunky but slightly more clear, maybe?)
- add some doc strings/comments
- use map_or instead of is_none + unwrap
still missing time parameters for did resolution to be in parity with js-did
@dav1do dav1do force-pushed the feat/aes-283-jws-envelope-signature branch from c9a89a9 to ffe6db3 Compare August 23, 2024 20:04
@dav1do dav1do force-pushed the feat/aes-283-jws-envelope-signature branch from ffe6db3 to 5a0f598 Compare August 23, 2024 20:07
@dav1do dav1do temporarily deployed to github-tests-2024 August 23, 2024 20:17 — with GitHub Actions Inactive
@dav1do dav1do temporarily deployed to github-tests-2024 August 26, 2024 17:25 — with GitHub Actions Inactive
@dav1do dav1do added this pull request to the merge queue Aug 26, 2024
Merged via the queue into main with commit 681e666 Aug 26, 2024
5 checks passed
@dav1do dav1do deleted the feat/aes-283-jws-envelope-signature branch August 26, 2024 18:13
@smrz2001 smrz2001 mentioned this pull request Aug 26, 2024
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