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§
sourcefn 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 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.
sourcefn 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 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).
sourcefn redirect_uri(&self) -> &str
fn redirect_uri(&self) -> &str
Returns redirect_uri to create OauthV2AccessRequest by OauthHandlerTrait::oauth_v2_access_request_form.
Provided Methods§
sourcefn grant_type(&self) -> &str
fn grant_type(&self) -> &str
Returns grant_type to create OauthV2AccessRequest by OauthHandlerTrait::oauth_v2_access_request_form.
sourcefn oauth_v2_access_request_form<'a>(
&'a self,
slack: &'a Slack,
code: &'a str,
) -> OauthV2AccessRequest<'a>
fn oauth_v2_access_request_form<'a>( &'a self, slack: &'a Slack, code: &'a str, ) -> OauthV2AccessRequest<'a>
Creates and returns OauthV2AccessRequest.
sourcefn 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,
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.