Skip to main content

IntrospectionClient

Trait IntrospectionClient 

Source
pub trait IntrospectionClient:
    Send
    + Sync
    + Debug {
    // Required methods
    fn introspect<'life0, 'life1, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Value, IntrospectionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn userinfo<'life0, 'life1, 'async_trait>(
        &'life0 self,
        token: &'life1 str,
    ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, IntrospectionError>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
}
Expand description

HTTP transport contract for RFC 7662 introspection + OIDC userinfo.

This trait lives in this crate to keep crates/security as the validator surface. The concrete reqwest-backed impl lives in crates/broker, in oauth_introspection.rs, so this crate stays I/O-free.

Required Methods§

Source

fn introspect<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Value, IntrospectionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

POST the IdP’s introspection endpoint with token in a form-encoded body. The caller checks active + claims.

Source

fn userinfo<'life0, 'life1, 'async_trait>( &'life0 self, token: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Value>, IntrospectionError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

GET the IdP’s userinfo endpoint with Authorization: Bearer <token>. Ok(None) when the validator is configured without userinfo enrichment.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§