Skip to content

Commit

Permalink
remove typeshare from client data json
Browse files Browse the repository at this point in the history
This is because `serde(flatten)` is not supported in typeshare, see 1Password/typeshare#114 for more info
  • Loading branch information
Progdrasil committed Dec 11, 2023
1 parent 67ab50c commit 9b74f86
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
5 changes: 2 additions & 3 deletions passkey-types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,15 @@ This crate contains the types defined in both the [WebAuthn Level 3] and [CTAP 2
In this module the type names mirror exactly those in the specifications for ease of navigation. They are defined in a way that allows interoperability with the web types directly as well as the [JSON encoding] for over network communication.

### Bytes Serialization
By default, the [`Bytes`] type serializes to an array of numbers for easy conversion to array buffers on the JavaScript side. However, if you are interacting with a server directly or wish to use this crate with Android's [credential-manager] library, you may wish this type to serialize to Base64Url. To do so, simply enable the crate feature `serialize_bytes_as_base64_string`. In the future we will work on changing this behavior dynamically.

By default, the [`Bytes`] type serializes to an array of numbers for easy conversion to array buffers on the JavaScript side. However, if you are interacting with a server directly or wish to use this crate with Android's [credential-manager] library, you may wish this type to serialize to Base64Url. To do so, simply enable the crate feature `serialize_bytes_as_base64_string`. In the future we will work on changing this behavior dynamically.

## CTAP 2

In this module, seeing as the method inputs are not given explicit names, the `Request` and `Response` types are defined in separate modules for each operation. These types make use of the same data structures from the [WebAuthn](#webauthn) module. In some cases though, the types have different constraits regarding required and optional fields, in which case it is re-defined in the [CTAP](#ctap-2) module along with a `TryFrom` implementation in either direction.


[WebAuthn Level 3]: https://w3c.github.io/webauthn/
[CTAP 2.0]: https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html
[JSON encoding]: https://w3c.github.io/webauthn/#typedefdef-publickeycredentialjson
[`Bytes`]: https://docs.rs/passkey-types/latest/passkey_types/struct.Bytes.html
[credential-manager]: https://developer.android.com/reference/android/credentials/package-summary
[credential-manager]: https://developer.android.com/reference/android/credentials/package-summary
1 change: 0 additions & 1 deletion passkey-types/src/webauthn/attestation.rs
Original file line number Diff line number Diff line change
Expand Up @@ -555,7 +555,6 @@ pub struct AuthenticatorAttestationResponse {
/// [5.8.1.1 Serialization]: https://w3c.github.io/webauthn/#clientdatajson-serialization
#[derive(Debug, Clone, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
#[typeshare]
pub struct CollectedClientData {
/// This member contains the value [`ClientDataType::Create`] when creating new credentials, and
/// [`ClientDataType::Get`] when getting an assertion from an existing credential. The purpose
Expand Down

0 comments on commit 9b74f86

Please sign in to comment.