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

Refactor Controller concerns to not use Warden::WebAuthn::StrategyHelpers #29

Merged
merged 8 commits into from Jun 24, 2023

Conversation

tcannonfodder
Copy link
Contributor

Note, this cannot be merged in until ruby-passkeys/warden-webauthn#4 is merged and a new gem version is cut

This PR prevents the bleed-through caused by including all of Warden::WebAuthn::StrategyHelpers for a small number of methods.

This resolves #28

(@Vagab I can't add you as a reviewer directly, but would like your feedback on this one as well, since it would solve our discussion: #25 (comment))

* In order to prevent a bleed-through between `warden-webauthn` and
	`devise-passkeys`, we need to use the new
	`Warden::WebAuthn::RackHelper` in order to get the `relying_party_key`
	that it defines
	* This prevents confusion & accidental over-inclusion that was caused
		by including the entire `Warden::WebAuthn::StrategyHelpers` module
* In order to prevent a bleed-through between `warden-webauthn` and
	`devise-passkeys`, we need to add error-handling inside of
	`verify_passkey_challenge` instead of including the entire
	`Warden::WebAuthn::StrategyHelpers`
	* This prevents confusion & accidental over-inclusion that was caused
		by including the entire `Warden::WebAuthn::StrategyHelpers` module
* The definitions from the README were added directly to
	`warden-webauthn`'s `Warden::WebAuthn::RackHelper`
	* see: ruby-passkeys/warden-webauthn@80d2101
* Therefore, we can remove this code and rely on the `RackHelper`
	to define the method for us
Copy link
Contributor

@Vagab Vagab left a comment

Choose a reason for hiding this comment

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

Would be cool to be requested as a reviewer, but in the meantime here goes.
One small suggestion, other than that - lgtm 🔥

* Moving the preamble checks that the `parsed_credential` is valid into
	its own `verify_credential_integrity` `before_action` helps keep the
	`verify_passkey_challenge` focused, since verifying the credential's
	integrity is a separate step (making sure it's not blank and is
	parseable JSON)
@tcannonfodder tcannonfodder merged commit 9be65a3 into main Jun 24, 2023
1 of 3 checks passed
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.

Refactor controller concerns to not use Warden::WebAuthn::StrategyHelpers
2 participants