Skip to main content

StepUp

Trait StepUp 

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

Proves, or refuses to prove, that a request carries a fresh passkey ceremony for subject.

Implemented by the venture and injected with Telegram::step_up. headers are the confirm request’s own headers — the credentials the request itself presented; subject is the account the action belongs to, which the proof must be about — a ceremony by a colleague is not a ceremony by you.

The contract, in one sentence: return true only when you watched a passkey assertion for subject complete within this request or within your own freshness window; every doubt returns false, and the route answers 403 without touching the action.

Required Methods§

Source

fn passkey_verified<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, headers: &'life1 HeaderMap, subject: &'life2 str, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

true only when this request proves a fresh passkey ceremony for subject. Never asked twice for one action: the conditional update behind it is single-use.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§