use Pin;
use crateResult;
/// Optional trait for JWT token revocation checks.
///
/// Implement this against your storage backend (DB, Redis, `LruCache`, etc.).
/// Register with [`JwtLayer::with_revocation()`](super::middleware::JwtLayer::with_revocation) —
/// the middleware skips the check when no backend is registered.
///
/// # Behavior
///
/// - Only called when a revocation backend is registered AND the token has a `jti` claim.
/// - Token without `jti` + registered backend: accepted without calling `is_revoked`.
/// - `Ok(true)`: token rejected with `jwt:revoked`.
/// - `Ok(false)`: token accepted.
/// - `Err(_)`: token rejected with `jwt:revocation_check_failed` (fail-closed).