/// Handles a single request to the TokenManager by dispatching to more specific functions for
/// each method.
Handles a single request to the TokenManager by dispatching to more specific functions for
each method.
Handles a single request to the TokenManager by dispatching to more specific functions for each method .
pub async fn handle_request<'a>(
        &'a self,
        context: &'a TokenManagerContext,
        req: TokenManagerRequest,
    ) -> Result<(), failure::Error> {
        // TODO(jsankey): Determine how best to enforce the application_url in context.
        match req {
            TokenManagerRequest::Authorize {
                app_config,
                auth_ui_context,
                user_profile_id,
                app_scopes,
                auth_code,
                responder,
            } => responder.send_result(await!(self.authorize(
                context,
                app_config,
                auth_ui_context,
                user_profile_id,
                app_scopes,
                auth_code
            ))),
            TokenManagerRequest::GetAccessToken {
                app_config,
                user_profile_id,
                app_scopes,
                responder,
            } => responder.send_result(await!(self.get_access_token(
                app_config,
                user_profile_id,
                app_scopes
            ))),
            TokenManagerRequest::GetIdToken {
                app_config,
                user_profile_id,
                audience,
                responder,
            } => responder.send_result(await!(self.get_id_token(
                app_config,
                user_profile_id,
                audience
            ))),
            TokenManagerRequest::GetFirebaseToken {
                app_config,
                user_profile_id,
                audience,
                firebase_api_key,
                responder,
            } => responder.send_result(await!(self.get_firebase_token(
                app_config,
                user_profile_id,
                audience,
                firebase_api_key
            ))),
            TokenManagerRequest::DeleteAllTokens {
                app_config,
                user_profile_id,
                force,
                responder,
            } => responder.send_result(await!(self.delete_all_tokens(
                app_config,
                user_profile_id,
                force
            ))),
            TokenManagerRequest::ListProfileIds { app_config, responder } => {
                responder.send_result(self.list_profile_ids(app_config))
            }
        }
    }
pub async fn handle_request < ' a > ( & ' a self , context : & ' a TokenManagerContext , req : TokenManagerRequest , ) -> Result < ( ) , failure :: Error > { // TODO(jsankey): Determine how best to enforce the application_url in context. match req { TokenManagerRequest :: Authorize { app_config , auth_ui_context , user_profile_id , app_scopes , auth_code , responder , } => responder . send_result ( await ! ( self authorize ( context app_config auth_ui_context user_profile_id app_scopes auth_code ) ) ) , TokenManagerRequest :: GetAccessToken { app_config , user_profile_id , app_scopes , responder , } => responder . send_result ( await ! ( self get_access_token ( app_config user_profile_id app_scopes ) ) ) , TokenManagerRequest :: GetIdToken { app_config , user_profile_id , audience , responder , } => responder . send_result ( await ! ( self get_id_token ( app_config user_profile_id audience ) ) ) , TokenManagerRequest :: GetFirebaseToken { app_config , user_profile_id , audience , firebase_api_key , responder , } => responder . send_result ( await ! ( self get_firebase_token ( app_config user_profile_id audience firebase_api_key ) ) ) , TokenManagerRequest :: DeleteAllTokens { app_config , user_profile_id , force , responder , } => responder . send_result ( await ! ( self delete_all_tokens ( app_config user_profile_id force ) ) ) , TokenManagerRequest :: ListProfileIds { app_config , responder } => { responder . send_result ( self . list_profile_ids ( app_config ) ) } } }
Handles a single request to the TokenManager by dispatching to more specific functions for
each method.
Handles a single request to the TokenManager by dispatching to more specific functions for each method .
&'a self
context
&'a TokenManagerContext
req
TokenManagerRequest