pub trait InvalidatedJWTsReader<T = String> {
    fn read<'life0, 'life1, 'async_trait>(
        &'life0 self,
        tag: Option<&'life1 InvalidatedTokensTag<T>>
    ) -> Pin<Box<dyn Future<Output = Result<InvalidatedTokens<T>>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; }
Expand description

A reader for invalidated JWTs, for instance from an external shared data store.

Required Methods

Reads invalidated JWTs

The tokens returned should be unexpired JWTs. Removing expired JWTs from the data source is something that is handled out of band, as it could be done in different ways (e.g. when inserting the JWTs, as a cron job, as part of the built-in capabilities of a datastore).

The read method will receive the last InvalidatedTokensTag that the middleware received as an argument, and must return either a variant of InvalidatedTokens or an IO error.

Implementors