11//! This module implements the service to allow the user to control the flow of
22//! the credential request through the trusted UI.
33
4- use std:: future:: Future ;
54use std:: { collections:: VecDeque , fmt:: Debug , sync:: Arc } ;
65
6+ use async_trait:: async_trait;
77use credentialsd_common:: model:: {
88 BackgroundEvent , Device , Error as CredentialServiceError , RequestingApplication , WebAuthnError ,
99} ;
@@ -341,13 +341,16 @@ enum SignalState {
341341 Active ,
342342}
343343
344+ /// Coordinates between user and various devices connected to the machine to
345+ /// fulfill credential requests.
346+ #[ async_trait]
344347pub trait CredentialRequestController {
345- fn request_credential (
348+ async fn request_credential (
346349 & self ,
347350 requesting_app : Option < RequestingApplication > ,
348351 request : CredentialRequest ,
349352 window_handle : Option < WindowHandle > ,
350- ) -> impl Future < Output = Result < CredentialResponse , WebAuthnError > > + Send ;
353+ ) -> Result < CredentialResponse , WebAuthnError > ;
351354}
352355
353356pub struct CredentialRequestControllerClient {
@@ -359,6 +362,7 @@ pub struct CredentialRequestControllerClient {
359362 ) > ,
360363}
361364
365+ #[ async_trait]
362366impl CredentialRequestController for CredentialRequestControllerClient {
363367 async fn request_credential (
364368 & self ,
0 commit comments