summaryrefslogtreecommitdiffstats
path: root/crates/auth-service/src/server/grpc/interceptor.rs
blob: bc0bc0779786da4c0d431d967f157051145c8be0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use tonic::{
    Status,
    service::{Interceptor, interceptor::InterceptedService},
    transport::Channel,
};

pub type Intercepted = InterceptedService<Channel, MyInterceptor>;

#[derive(Clone, Copy)]
pub struct MyInterceptor;

impl Interceptor for MyInterceptor {
    fn call(&mut self, request: tonic::Request<()>) -> Result<tonic::Request<()>, Status> {
        Ok(request)
    }
}