Skip to main content

Approver

Trait Approver 

Source
pub trait Approver: Send + Sync {
    // Required method
    fn approve<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        headers: &'life1 HeaderMap,
        return_to: &'life2 str,
    ) -> Pin<Box<dyn Future<Output = Result<Approval, ApproverError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait,
             'life2: 'async_trait;
}
Expand description

Decides who may approve a device. The browser cannot reach the approval page or submit a decision without passing through one of these.

Required Methods§

Source

fn approve<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, headers: &'life1 HeaderMap, return_to: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Approval, ApproverError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Identifies the caller, or says where to send them to sign in.

headers is the whole browser request’s headers — a session cookie lives there and in nowhere else. return_to is the same-site path and query of the device page (never an absolute URL, which a sign-in flow would refuse as an open redirect), including the user_code query when there is one, so a sign-in flow can come straight back to the decision.

§Errors

Whatever a sign-in implementation could not answer.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§