@@ -40,12 +40,9 @@ impl RpIdHash {
4040 }
4141}
4242
43+ // NOTE: WebAuthn requires all fields and CTAP2 does not.
4344#[ derive( Debug , Serialize , Clone , Default , Deserialize , PartialEq , Eq ) ]
4445pub struct RelyingParty {
45- // TODO(baloo): spec is wrong !!!!111
46- // https://fidoalliance.org/specs/fido-v2.0-ps-20190130/fido-client-to-authenticator-protocol-v2.0-ps-20190130.html#commands
47- // in the example "A PublicKeyCredentialRpEntity DOM object defined as follows:"
48- // inconsistent with https://w3c.github.io/webauthn/#sctn-rp-credential-params
4946 pub id : String ,
5047 #[ serde( skip_serializing_if = "Option::is_none" ) ]
5148 pub name : Option < String > ,
@@ -94,9 +91,9 @@ impl RelyingPartyWrapper {
9491 }
9592}
9693
97- // TODO(baloo): should we rename this PublicKeyCredentialUserEntity ?
94+ // NOTE: WebAuthn requires all fields and CTAP2 does not.
9895#[ derive( Debug , Serialize , Clone , Eq , PartialEq , Deserialize , Default ) ]
99- pub struct User {
96+ pub struct PublicKeyCredentialUserEntity {
10097 #[ serde( with = "serde_bytes" ) ]
10198 pub id : Vec < u8 > ,
10299 pub name : Option < String > ,
@@ -406,13 +403,13 @@ pub struct AuthenticationExtensionsClientOutputs {
406403#[ cfg( test) ]
407404mod test {
408405 use super :: {
409- COSEAlgorithm , PublicKeyCredentialDescriptor , PublicKeyCredentialParameters , RelyingParty ,
410- Transport , User ,
406+ COSEAlgorithm , PublicKeyCredentialDescriptor , PublicKeyCredentialParameters ,
407+ PublicKeyCredentialUserEntity , RelyingParty , Transport ,
411408 } ;
412409 use serde_cbor:: from_slice;
413410
414- fn create_user ( ) -> User {
415- User {
411+ fn create_user ( ) -> PublicKeyCredentialUserEntity {
412+ PublicKeyCredentialUserEntity {
416413 id : vec ! [
417414 0x30 , 0x82 , 0x01 , 0x93 , 0x30 , 0x82 , 0x01 , 0x38 , 0xa0 , 0x03 , 0x02 , 0x01 , 0x02 , 0x30 ,
418415 0x82 , 0x01 , 0x93 , 0x30 , 0x82 , 0x01 , 0x38 , 0xa0 , 0x03 , 0x02 , 0x01 , 0x02 , 0x30 , 0x82 ,
@@ -479,7 +476,7 @@ mod test {
479476 0x69 , 0x74 , 0x68 , // ...
480477 ] ;
481478 let expected = create_user ( ) ;
482- let actual: User = from_slice ( & input) . unwrap ( ) ;
479+ let actual: PublicKeyCredentialUserEntity = from_slice ( & input) . unwrap ( ) ;
483480 assert_eq ! ( expected, actual) ;
484481 }
485482
@@ -519,7 +516,7 @@ mod test {
519516
520517 #[ test]
521518 fn serialize_user_nodisplayname ( ) {
522- let user = User {
519+ let user = PublicKeyCredentialUserEntity {
523520 id : vec ! [
524521 0x30 , 0x82 , 0x01 , 0x93 , 0x30 , 0x82 , 0x01 , 0x38 , 0xa0 , 0x03 , 0x02 , 0x01 , 0x02 , 0x30 ,
525522 0x82 , 0x01 , 0x93 , 0x30 , 0x82 , 0x01 , 0x38 , 0xa0 , 0x03 , 0x02 , 0x01 , 0x02 , 0x30 , 0x82 ,
0 commit comments