Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Send bound to interceptors #532

Merged
merged 2 commits into from
Mar 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/api/clients.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ enum AuthType {
/// stays the same and is not dependent on the authentication type used.
/// The builder can always return `Client<InterceptedService<Channel, ChainedInterceptor>>`.
pub struct ChainedInterceptor {
interceptors: Vec<Box<dyn Interceptor>>,
interceptors: Vec<Box<dyn Interceptor + Send>>,
}

impl ChainedInterceptor {
Expand All @@ -56,7 +56,7 @@ impl ChainedInterceptor {
}
}

pub(crate) fn add_interceptor(mut self, interceptor: Box<dyn Interceptor>) -> Self {
pub(crate) fn add_interceptor(mut self, interceptor: Box<dyn Interceptor + Send>) -> Self {
self.interceptors.push(interceptor);
self
}
Expand Down
4 changes: 2 additions & 2 deletions src/oidc/introspection/cache/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::*;

Expand Down Expand Up @@ -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;
Expand Down
Loading