@@ -34,6 +34,7 @@ use crate::{
3434 } ,
3535 } ,
3636 transport:: AuthTokenData ,
37+ Transport ,
3738} ;
3839
3940use super :: timeout:: DEFAULT_TIMEOUT ;
@@ -48,7 +49,7 @@ pub struct MakeCredentialResponse {
4849 pub large_blob_key : Option < Vec < u8 > > ,
4950 pub unsigned_extensions_output : MakeCredentialsResponseUnsignedExtensions ,
5051 /// Transport the credential was created over, stamped by the channel.
51- pub transport : Option < crate :: Transport > ,
52+ pub transport : Option < Transport > ,
5253 /// Transports the authenticator advertised in getInfo (0x09), if any.
5354 pub authenticator_transports : Option < Vec < String > > ,
5455}
@@ -67,7 +68,7 @@ struct AttestationObject<'a> {
6768/// Maps the active transport to AuthenticatorTransport tokens for the registration
6869/// `transports` member. The list is deduplicated and lexicographically sorted per
6970/// WebAuthn L3 §5.2.1.1, and is empty when the transport is unknown.
70- fn registration_transports ( transport : Option < crate :: Transport > ) -> Vec < String > {
71+ fn registration_transports ( transport : Option < Transport > ) -> Vec < String > {
7172 let mut tokens: Vec < String > = transport
7273 . into_iter ( )
7374 . map ( Ctap2Transport :: from)
@@ -1537,18 +1538,18 @@ mod tests {
15371538 let request = create_test_request ( ) ;
15381539
15391540 for ( transport, token) in [
1540- ( crate :: Transport :: Usb , "usb" ) ,
1541- ( crate :: Transport :: Ble , "ble" ) ,
1542- ( crate :: Transport :: Nfc , "nfc" ) ,
1543- ( crate :: Transport :: Hybrid , "hybrid" ) ,
1541+ ( Transport :: Usb , "usb" ) ,
1542+ ( Transport :: Ble , "ble" ) ,
1543+ ( Transport :: Nfc , "nfc" ) ,
1544+ ( Transport :: Hybrid , "hybrid" ) ,
15441545 ] {
15451546 response. transport = Some ( transport) ;
15461547 let model = response. to_idl_model ( & request) . unwrap ( ) ;
15471548 assert_eq ! ( model. response. transports, vec![ token. to_string( ) ] ) ;
15481549 }
15491550
15501551 // The token reaches the JSON wire format too.
1551- response. transport = Some ( crate :: Transport :: Nfc ) ;
1552+ response. transport = Some ( Transport :: Nfc ) ;
15521553 let json = response
15531554 . to_json_string (
15541555 & request,
@@ -1573,7 +1574,7 @@ mod tests {
15731574 let request = create_test_request ( ) ;
15741575
15751576 // Reported out of order with a duplicate; the ceremony transport (ble) folds in.
1576- response. transport = Some ( crate :: Transport :: Ble ) ;
1577+ response. transport = Some ( Transport :: Ble ) ;
15771578 response. authenticator_transports = Some ( vec ! [
15781579 "usb" . to_string( ) ,
15791580 "nfc" . to_string( ) ,
@@ -1586,7 +1587,7 @@ mod tests {
15861587 ) ;
15871588
15881589 // A ceremony transport already in the reported list is not duplicated.
1589- response. transport = Some ( crate :: Transport :: Usb ) ;
1590+ response. transport = Some ( Transport :: Usb ) ;
15901591 response. authenticator_transports = Some ( vec ! [ "usb" . to_string( ) , "nfc" . to_string( ) ] ) ;
15911592 let model = response. to_idl_model ( & request) . unwrap ( ) ;
15921593 assert_eq ! (
@@ -1600,7 +1601,7 @@ mod tests {
16001601 assert_eq ! ( model. response. transports, vec![ "usb" . to_string( ) ] ) ;
16011602
16021603 // Unknown tokens pass through, folded with the ceremony transport.
1603- response. transport = Some ( crate :: Transport :: Ble ) ;
1604+ response. transport = Some ( Transport :: Ble ) ;
16041605 response. authenticator_transports =
16051606 Some ( vec ! [ "smart-card" . to_string( ) , "custom" . to_string( ) ] ) ;
16061607 let model = response. to_idl_model ( & request) . unwrap ( ) ;
0 commit comments