1
1
use std:: sync:: Arc ;
2
2
3
- use bitwarden:: {
4
- error:: Error ,
5
- fido:: {
6
- CheckUserOptions , ClientData , ClientFido2Ext , Fido2CallbackError as BitFido2CallbackError ,
7
- GetAssertionRequest , GetAssertionResult , MakeCredentialRequest , MakeCredentialResult ,
8
- PublicKeyCredentialAuthenticatorAssertionResponse ,
9
- PublicKeyCredentialAuthenticatorAttestationResponse , PublicKeyCredentialRpEntity ,
10
- PublicKeyCredentialUserEntity ,
11
- } ,
12
- vault:: { Cipher , CipherView , Fido2CredentialNewView } ,
3
+ use bitwarden_fido:: {
4
+ CheckUserOptions , ClientData , ClientFido2Ext , Fido2CallbackError as BitFido2CallbackError ,
5
+ Fido2CredentialAutofillView , GetAssertionRequest , GetAssertionResult , MakeCredentialRequest ,
6
+ MakeCredentialResult , Origin , PublicKeyCredentialAuthenticatorAssertionResponse ,
7
+ PublicKeyCredentialAuthenticatorAttestationResponse , PublicKeyCredentialRpEntity ,
8
+ PublicKeyCredentialUserEntity ,
13
9
} ;
14
- use bitwarden_fido :: { Fido2CredentialAutofillView , Origin } ;
10
+ use bitwarden_vault :: { Cipher , CipherView , Fido2CredentialNewView } ;
15
11
16
- use crate :: { error:: Result , Client } ;
12
+ use crate :: {
13
+ error:: { Error , Result } ,
14
+ Client ,
15
+ } ;
17
16
18
17
#[ derive( uniffi:: Object ) ]
19
18
pub struct ClientFido2 ( pub ( crate ) Arc < Client > ) ;
@@ -180,7 +179,7 @@ pub struct CheckUserResult {
180
179
user_verified : bool ,
181
180
}
182
181
183
- impl From < CheckUserResult > for bitwarden :: fido :: CheckUserResult {
182
+ impl From < CheckUserResult > for bitwarden_fido :: CheckUserResult {
184
183
fn from ( val : CheckUserResult ) -> Self {
185
184
Self {
186
185
user_present : val. user_present ,
@@ -268,7 +267,7 @@ pub trait Fido2CredentialStore: Send + Sync {
268
267
struct UniffiTraitBridge < T > ( T ) ;
269
268
270
269
#[ async_trait:: async_trait]
271
- impl bitwarden :: fido :: Fido2CredentialStore for UniffiTraitBridge < & dyn Fido2CredentialStore > {
270
+ impl bitwarden_fido :: Fido2CredentialStore for UniffiTraitBridge < & dyn Fido2CredentialStore > {
272
271
async fn find_credentials (
273
272
& self ,
274
273
ids : Option < Vec < Vec < u8 > > > ,
@@ -306,9 +305,9 @@ pub enum UIHint {
306
305
RequestExistingCredential ( CipherView ) ,
307
306
}
308
307
309
- impl From < bitwarden :: fido :: UIHint < ' _ , CipherView > > for UIHint {
310
- fn from ( hint : bitwarden :: fido :: UIHint < ' _ , CipherView > ) -> Self {
311
- use bitwarden :: fido :: UIHint as BWUIHint ;
308
+ impl From < bitwarden_fido :: UIHint < ' _ , CipherView > > for UIHint {
309
+ fn from ( hint : bitwarden_fido :: UIHint < ' _ , CipherView > ) -> Self {
310
+ use bitwarden_fido :: UIHint as BWUIHint ;
312
311
match hint {
313
312
BWUIHint :: InformExcludedCredentialFound ( cipher) => {
314
313
UIHint :: InformExcludedCredentialFound ( cipher. clone ( ) )
@@ -333,12 +332,12 @@ impl From<bitwarden::fido::UIHint<'_, CipherView>> for UIHint {
333
332
}
334
333
335
334
#[ async_trait:: async_trait]
336
- impl bitwarden :: fido :: Fido2UserInterface for UniffiTraitBridge < & dyn Fido2UserInterface > {
335
+ impl bitwarden_fido :: Fido2UserInterface for UniffiTraitBridge < & dyn Fido2UserInterface > {
337
336
async fn check_user < ' a > (
338
337
& self ,
339
338
options : CheckUserOptions ,
340
- hint : bitwarden :: fido :: UIHint < ' a , CipherView > ,
341
- ) -> Result < bitwarden :: fido :: CheckUserResult , BitFido2CallbackError > {
339
+ hint : bitwarden_fido :: UIHint < ' a , CipherView > ,
340
+ ) -> Result < bitwarden_fido :: CheckUserResult , BitFido2CallbackError > {
342
341
self . 0
343
342
. check_user ( options. clone ( ) , hint. into ( ) )
344
343
. await
@@ -359,7 +358,7 @@ impl bitwarden::fido::Fido2UserInterface for UniffiTraitBridge<&dyn Fido2UserInt
359
358
& self ,
360
359
options : CheckUserOptions ,
361
360
new_credential : Fido2CredentialNewView ,
362
- ) -> Result < ( CipherView , bitwarden :: fido :: CheckUserResult ) , BitFido2CallbackError > {
361
+ ) -> Result < ( CipherView , bitwarden_fido :: CheckUserResult ) , BitFido2CallbackError > {
363
362
self . 0
364
363
. check_user_and_pick_credential_for_creation ( options, new_credential)
365
364
. await
0 commit comments