pub async fn authorise_app(&self, req: &str) -> Result<String> {
        let ipc_req = IpcMsg::from_string(req).map_err(|err| {
            Error::AuthenticatorError(format!("Failed to decode authorisation request: {:?}", err))
        })?;

        debug!("Auth request string decoded: {:?}", ipc_req);

        match ipc_req {
            IpcMsg::Req(IpcReq::Auth(app_auth_req)) => {
                info!("Request was recognised as an application auth request");
                debug!("Decoded request: {:?}", app_auth_req);
                self.gen_auth_response(app_auth_req).await
            }
            IpcMsg::Req(IpcReq::Unregistered(user_data)) => {
                info!("Request was recognised as an unregistered auth request");
                debug!("Decoded request: {:?}", user_data);

                self.gen_unreg_auth_response()
            }
            IpcMsg::Resp { .. } | IpcMsg::Err(..) => Err(Error::AuthError(
                "The request was not recognised as a valid auth request".to_string(),
            )),
        }
    }
/// Decode requests and trigger application authorisation against the current client
Decode requests and trigger application authorisation against the current client
Decode requests and trigger application authorisation against the current client
pub async fn authorise_app(&self, req: &str) -> Result<String> {
        let ipc_req = IpcMsg::from_string(req).map_err(|err| {
            Error::AuthenticatorError(format!("Failed to decode authorisation request: {:?}", err))
        })?;
        debug!("Auth request string decoded: {:?}", ipc_req);
        match ipc_req {
            IpcMsg::Req(IpcReq::Auth(app_auth_req)) => {
                info!("Request was recognised as an application auth request");
                debug!("Decoded request: {:?}", app_auth_req);
                self.gen_auth_response(app_auth_req).await
            }
            IpcMsg::Req(IpcReq::Unregistered(user_data)) => {
                info!("Request was recognised as an unregistered auth request");
                debug!("Decoded request: {:?}", user_data);
                self.gen_unreg_auth_response()
            }
            IpcMsg::Resp { .. } | IpcMsg::Err(..) => Err(Error::AuthError(
                "The request was not recognised as a valid auth request".to_string(),
            )),
        }
    }
pub async fn authorise_app ( & self , req : & str ) -> Result < String > { let ipc_req = IpcMsg :: from_string ( req ) . map_err ( | err | { Error :: AuthenticatorError ( format ! ( " " err ) ) } ) ? ; debug ! ( " " ipc_req ) ; match ipc_req { IpcMsg :: Req ( IpcReq :: Auth ( app_auth_req ) ) => { info ! ( " " ) ; debug ! ( " " app_auth_req ) ; self . gen_auth_response ( app_auth_req ) . await } IpcMsg :: Req ( IpcReq :: Unregistered ( user_data ) ) => { info ! ( " " ) ; debug ! ( " " user_data ) ; self . gen_unreg_auth_response ( ) } IpcMsg :: Resp { .. } | IpcMsg :: Err ( .. ) => Err ( Error :: AuthError ( " " . to_string ( ) , ) ) , } }
Decode requests and trigger application authorisation against the current client
Decode requests and trigger application authorisation against the current client
&self
req
&str