Struct oxide_auth::endpoint::AuthorizationFlow
source · pub struct AuthorizationFlow<E, R>where
E: Endpoint<R>,
R: WebRequest,{ /* private fields */ }
Expand description
All relevant methods for handling authorization code requests.
Implementations§
source§impl<E, R> AuthorizationFlow<E, R>where
E: Endpoint<R>,
R: WebRequest,
impl<E, R> AuthorizationFlow<E, R>where E: Endpoint<R>, R: WebRequest,
sourcepub fn prepare(endpoint: E) -> Result<Self, E::Error>
pub fn prepare(endpoint: E) -> Result<Self, E::Error>
Check that the endpoint supports the necessary operations for handling requests.
Binds the endpoint to a particular type of request that it supports, for many implementations this is probably single type anyways.
Panics
Indirectly execute
may panic when this flow is instantiated with an inconsistent
endpoint, for details see the documentation of Endpoint
. For consistent endpoints,
the panic is instead caught as an error here.
sourcepub fn execute(&mut self, request: R) -> Result<R::Response, E::Error>
pub fn execute(&mut self, request: R) -> Result<R::Response, E::Error>
Use the checked endpoint to execute the authorization flow for a request.
In almost all cases this is followed by executing finish
on the result but some users may
instead want to inspect the partial result.
Panics
When the registrar or the authorizer returned by the endpoint is suddenly None
when
previously it was Some(_)
.