Trait sfr_server::OauthHandlerTrait

source ·
pub trait OauthHandlerTrait: Send + Sync {
    // Required methods
    fn handle_oauth<'life0, 'async_trait>(
        &'life0 self,
        client: Client,
        body: OauthV2AccessResponse,
    ) -> Pin<Box<dyn Future<Output = Result<Option<OauthRedirectResponse>, ResponseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn take_oauth_token_from_team_id<'life0, 'life1, 'async_trait>(
        &'life0 self,
        team_id: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<String, ResponseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn redirect_uri(&self) -> &str;

    // Provided methods
    fn grant_type(&self) -> &str { ... }
    fn oauth_v2_access_request_form<'a>(
        &'a self,
        slack: &'a Slack,
        code: &'a str,
    ) -> OauthV2AccessRequest<'a> { ... }
    fn treat_oauth_redirect<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        client: Client,
        slack: &'life1 Slack,
        code: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<OauthV2AccessResponse, ResponseError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait { ... }
}
Expand description

The trait representing the interface that treats about OAuth.

Required Methods§

source

fn handle_oauth<'life0, 'async_trait>( &'life0 self, client: Client, body: OauthV2AccessResponse, ) -> Pin<Box<dyn Future<Output = Result<Option<OauthRedirectResponse>, ResponseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Handles OauthV2AccessResponse.

If this handler returns None, the framework will return default value.

source

fn take_oauth_token_from_team_id<'life0, 'life1, 'async_trait>( &'life0 self, team_id: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<String, ResponseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Returns OAuth access_token from team_id (An ID of Workspace).

source

fn redirect_uri(&self) -> &str

Provided Methods§

source

fn grant_type(&self) -> &str

source

fn oauth_v2_access_request_form<'a>( &'a self, slack: &'a Slack, code: &'a str, ) -> OauthV2AccessRequest<'a>

Creates and returns OauthV2AccessRequest.

source

fn treat_oauth_redirect<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, client: Client, slack: &'life1 Slack, code: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<OauthV2AccessResponse, ResponseError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Treats redirect request.

Implementors§