Skip to content

Conversation

@MasterKale
Copy link
Collaborator

Adding options_to_json_dict opens the door to offering some more control over how options get serialized to simplified, JSON-serializable dict representations.

Three years ago issue #135 asked for the ability to get such a representation with bytes values preserved as-is. In subsequent years that use case had been forgotten and I'd inadvertently broken the ability to achieve this.

This PR fixes that by adding a new bytes_encoder arg to webauthn.helpers.options_to_json_dict() that takes in bytes and returns whatever representation of those bytes makes sense for the RP. This arg is optional - it defaults to encoding bytes to Base64URL strings to preserve existing functionality.

@MasterKale MasterKale mentioned this pull request Jul 4, 2025
@MasterKale MasterKale merged commit 4419713 into master Sep 4, 2025
5 checks passed
@MasterKale MasterKale deleted the feat/option-to-json-dict-custom-bytes-encoder branch September 4, 2025 22:29
@MasterKale MasterKale added this to the v2.7.0 milestone Sep 4, 2025
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.

1 participant