Use libwebauthn for JSON request parsing#116
Open
AlfioEmanueleFresta wants to merge 1 commit intomainfrom
Open
Use libwebauthn for JSON request parsing#116AlfioEmanueleFresta wants to merge 1 commit intomainfrom
AlfioEmanueleFresta wants to merge 1 commit intomainfrom
Conversation
msirringhaus
requested changes
Jan 8, 2026
Collaborator
msirringhaus
left a comment
There was a problem hiding this comment.
Left some questions inline
| .unwrap_or_else(|| { | ||
| // Default to effective domain from origin | ||
| origin | ||
| .rsplit_once('/') |
Collaborator
There was a problem hiding this comment.
Is rsplit_once() really correct here? Can't there be multiple /?
Member
There was a problem hiding this comment.
good catch. we should be explicit:
let effective_domain = origin.strip_prefix("https://")
.map(|rest| rest.split_once('/').0.to_string());| MakeCredentialRequest { | ||
| hash: client_data_hash, | ||
| origin, | ||
| String::from_utf8(make_cred_request.client_data_json()).map_err(|_| { |
Collaborator
There was a problem hiding this comment.
See my comment here linux-credentials/libwebauthn#155 (comment) I think it would be sensible for make_cred_request.client_data_json() to return a String.
|
|
||
| // Get the client data JSON from the request for response serialization | ||
| let client_data_json = | ||
| String::from_utf8(get_assertion_request.client_data_json()).map_err(|_| { |
| .unwrap_or_else(|| { | ||
| // Default to effective domain from origin | ||
| origin | ||
| .rsplit_once('/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR migrates JSON request parsing to use libwebauthn's
WebAuthnIDL::from_json()trait instead of our custom parsing code. This removes ~700 lines of manual parsing in favour of the shared implementation.Changes
MakeCredentialRequest::from_json()andGetAssertionRequest::from_json()from libwebauthnMakeCredentialOptions,GetCredentialOptions,CredentialDescriptor, etc.)d97c80d25bdb974472c40de5e5031db5946ad532(from Web IDL support 3/N: response JSON serialization libwebauthn#155)Behavioral changes
Default timeout
The default timeout when not specified by the relying party changes from 300s to 60s:
credentialsd/credentialsd/src/dbus/model.rs
Line 211 in 03206d2
Allow list transports
Previously we cleared
transportsfrom credentials in the allow list as a workaround. This is no longer done - transports now pass through as-is. These are just UI hints and shouldn't affect functionality.Follow-up