Skip to main content

TokenGate

Trait TokenGate 

Source
pub trait TokenGate: MaybeSend + MaybeSync {
    // Required methods
    fn precheck(
        &self,
        token: &Redacted,
        now_ms: i64,
    ) -> Result<Prechecked, TokenRejected>;
    fn ttl_ms(&self) -> u64;
}
Expand description

§3 step 5, filled by WP-4.15: check a present token’s syntax, key id and signature before the repository lookup. The result is held until the repository’s visibility is known; a public repository ignores it. The token is never logged.

Required Methods§

Source

fn precheck( &self, token: &Redacted, now_ms: i64, ) -> Result<Prechecked, TokenRejected>

Retain a redacted verified statement until visibility is known.

Source

fn ttl_ms(&self) -> u64

Configured maximum token lifetime, used by stateless binding checks.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§