From d797a21a6ad04cc973b11cc54735ade036f7c2c0 Mon Sep 17 00:00:00 2001 From: Ari Date: Mon, 11 Mar 2024 10:48:04 +0100 Subject: [PATCH] feat: Add Send bound to interceptors (#532) Autoderived Send implementations are lost when using trait objects. Missing Send bounds can be an issue in async contexts and there doesn't appear to be a reason not to introduce it within this repo. --- src/api/clients.rs | 4 ++-- src/oidc/introspection/cache/in_memory.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/api/clients.rs b/src/api/clients.rs index 784b9986..f0a44d5d 100644 --- a/src/api/clients.rs +++ b/src/api/clients.rs @@ -46,7 +46,7 @@ enum AuthType { /// stays the same and is not dependent on the authentication type used. /// The builder can always return `Client>`. pub struct ChainedInterceptor { - interceptors: Vec>, + interceptors: Vec>, } impl ChainedInterceptor { @@ -56,7 +56,7 @@ impl ChainedInterceptor { } } - pub(crate) fn add_interceptor(mut self, interceptor: Box) -> Self { + pub(crate) fn add_interceptor(mut self, interceptor: Box) -> Self { self.interceptors.push(interceptor); self } diff --git a/src/oidc/introspection/cache/in_memory.rs b/src/oidc/introspection/cache/in_memory.rs index 618ce409..657c98d4 100644 --- a/src/oidc/introspection/cache/in_memory.rs +++ b/src/oidc/introspection/cache/in_memory.rs @@ -61,7 +61,7 @@ mod tests { #![allow(clippy::all)] use crate::oidc::introspection::cache::IntrospectionCache; - use chrono::{Duration, Utc}; + use chrono::{TimeDelta, Utc}; use super::*; @@ -120,7 +120,7 @@ mod tests { let t = &c as &dyn IntrospectionCache; let mut response = Response::new(true, Default::default()); - response.set_exp(Some(Utc::now() - Duration::seconds(10))); + response.set_exp(Some(Utc::now() - TimeDelta::try_seconds(10).unwrap())); t.set("token1", response.clone()).await; t.set("token2", response.clone()).await;