Skip to main content

build_postgres_revocation_manager

Function build_postgres_revocation_manager 

Source
pub async fn build_postgres_revocation_manager(
    database_url: &str,
    schema: &CompiledSchema,
) -> Result<Option<Arc<TokenRevocationManager>>, String>
Expand description

Build a PostgreSQL-backed TokenRevocationManager from the compiled schema’s security.token_revocation config, connecting a dedicated metadata pool from database_url.

Returns Ok(None) when token revocation is disabled or the backend is not "postgres" (the memory/redis backends are built on the generic construction path by revocation_manager_from_schema). Call this on the PostgreSQL runtime path and install the result with Server::with_revocation_manager.

§Errors

Returns an error message when the token_revocation config is invalid, the database cannot be reached, or the backing table cannot be created.