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

Passkey tests #231

Merged
merged 11 commits into from
Jan 7, 2025
Merged

Passkey tests #231

merged 11 commits into from
Jan 7, 2025

Conversation

cpb8010
Copy link
Contributor

@cpb8010 cpb8010 commented Dec 20, 2024

Description

Instead of having the browser in the loop, we can just sign this ourselves to generate test coverage around the web auth n validation steps.

Additional context

We have e2e tests in another repo that will break if we fail to sign correctly, but we can exercise more of the validation without the browser in the loop to generate too much of the signatures.

Instead of having the browser in the loop, we can just sign this
ourselves.
Just need to figure out the formats ;)
@cpb8010 cpb8010 self-assigned this Dec 20, 2024
@cpb8010 cpb8010 added enhancement New feature or request help wanted Extra attention is needed project: contracts labels Dec 20, 2024
Something must be getting mixed up, because these recorded signatures
already passed the simplewebauth verification checks so they should
verify with the web crpyto libs.

Will need to dig through that lib again to see what's going on compared
to how I recorded these.
So there was issue where the signature was too long and it was hard to
see, but now all the data formats are using raw bytes so should be
directly compable.

No clue as to what's incompatible between the two ES256 implementions
The problem before was double hash,
the problem now is making bad s values during key generation
JSON parsing fails on duplicate keys, so it's impossible to get coverage
on the duplicate key checks.
Also explicitly not testing cross-origin, as we don't care anymore about
it's value (unless we want to save that with the key, because it should
otherwise be managed by the signer with the rp hosts)
@cpb8010 cpb8010 marked this pull request as ready for review December 25, 2024 21:40
@cpb8010 cpb8010 requested review from ly0va and MexicanAce December 25, 2024 21:40
Don't allow any invalid keys instead of just checking the most recent
key in case there are duplicate keys in the JSON
Rename the variables and have the same range check as low S
@cpb8010 cpb8010 changed the title feat: create an independent implementation for signing Passkey tests Jan 2, 2025
test/PasskeyModule.ts Outdated Show resolved Hide resolved
test/PasskeyModule.ts Show resolved Hide resolved
test/PasskeyModule.ts Outdated Show resolved Hide resolved
cpb8010 and others added 3 commits January 6, 2025 07:49
Co-authored-by: Nicolas Villanueva <[email protected]>
Helps with consistency between the SDK and contract tests, also helps
clean up the test code with a quick refactor
Copy link
Member

@ly0va ly0va left a comment

Choose a reason for hiding this comment

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

LGTM

@ly0va ly0va merged commit 0c0848d into main Jan 7, 2025
3 checks passed
@ly0va ly0va deleted the real-passkey-tests branch January 7, 2025 14:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed project: contracts
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants