pub trait OauthHandlerTrait: Send + Sync {
// Required methods
fn handle_oauth(
&self,
client: Client,
body: OauthV2AccessResponse,
) -> impl Future<Output = Result<Option<OauthRedirectResponse>, ResponseError>> + Send;
fn take_oauth_token_from_team_id(
&self,
team_id: &str,
) -> impl Future<Output = Result<String, ResponseError>> + Send;
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<'a>(
&'a self,
client: Client,
slack: &'a Slack,
code: &'a str,
) -> impl Future<Output = Result<OauthV2AccessResponse, ResponseError>> + Send + 'a { ... }
}Expand description
The trait representing the interface that treats about OAuth.
Required Methods§
Sourcefn handle_oauth(
&self,
client: Client,
body: OauthV2AccessResponse,
) -> impl Future<Output = Result<Option<OauthRedirectResponse>, ResponseError>> + Send
fn handle_oauth( &self, client: Client, body: OauthV2AccessResponse, ) -> impl Future<Output = Result<Option<OauthRedirectResponse>, ResponseError>> + Send
Handles OauthV2AccessResponse.
If this handler returns None, the framework will return default value.
Sourcefn take_oauth_token_from_team_id(
&self,
team_id: &str,
) -> impl Future<Output = Result<String, ResponseError>> + Send
fn take_oauth_token_from_team_id( &self, team_id: &str, ) -> impl Future<Output = Result<String, ResponseError>> + Send
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<'a>(
&'a self,
client: Client,
slack: &'a Slack,
code: &'a str,
) -> impl Future<Output = Result<OauthV2AccessResponse, ResponseError>> + Send + 'a
fn treat_oauth_redirect<'a>( &'a self, client: Client, slack: &'a Slack, code: &'a str, ) -> impl Future<Output = Result<OauthV2AccessResponse, ResponseError>> + Send + 'a
Treats redirect request.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.