Skip to main content

AuthGate

Trait AuthGate 

Source
pub trait AuthGate:
    Send
    + Sync
    + Debug {
    // Required method
    fn is_authenticated<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Can the runtime reach a usable credential right now?

Exists so a session blocked on sign-in can wait for the human instead of dying. Before this, an expired token and a dead datacenter both surfaced as LoopFailure::Infrastructure and ended the run — discarding a worktree of real edits because a token lapsed while the operator sat at the machine. The two are not the same condition: one is unrecoverable in-session, the other is recoverable in seconds by asking.

Optional by design, mirroring AskUser: with no gate wired the loop keeps its previous behaviour exactly, so tests and the foreman/external rungs are unaffected.

Required Methods§

Source

fn is_authenticated<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Whether a credential the backbone will accept is available.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§