feat(webauthn): populate authenticatorAttachment in JSON responses#299
Merged
Conversation
#159) The registration `transports` array already folds getInfo 0x09 with the ceremony transport, but `authenticatorAttachment` was still hardcoded to `None` for both RegistrationResponseJSON and AuthenticationResponseJSON. Derive it from the channel-stamped ceremony transport via a new `Transport::authenticator_attachment()`. libwebauthn only drives roaming authenticators, so every transport maps to "cross-platform"; an unknown transport omits the field. Assertions gain a `transport` field stamped in `webauthn_get_assertion`, mirroring how MakeCredential is already stamped. The existing large-blob end-to-end tests (single- and multi-assertion, over MockChannel) now assert the ceremony transport is stamped onto every assertion, covering the wiring in addition to the to_idl_model mapping.
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.
authenticatorAttachment was hardcoded to None on both the registration and authentication JSON responses, so consumers had to patch the JSON themselves afterwards. It is now derived from the transport the ceremony ran on.
Assertions gain a transport field, stamped in webauthn_get_assertion so that both the FIDO2 and U2F paths are covered, mirroring what makeCredential already does. libwebauthn only drives roaming authenticators, so every transport maps to cross-platform, and an unknown transport omits the field.
The transports half of #159 landed in #282, so this completes it.
Closes #159.