MCPcopy Create free account
hub / github.com/cosdata/cosdata / call

Method call

src/api/auth/authentication_middleware.rs:65–80  ·  view source on GitHub ↗
(&self, req: ServiceRequest)

Source from the content-addressed store, hash-verified

63 forward_ready!(service);
64
65 fn call(&self, req: ServiceRequest) -> Self::Future {
66 let claims = authentication_middleware(&req, &self.active_sessions);
67
68 let claims = match claims {
69 Ok(claims) => claims,
70 Err(e) => return Box::pin(async move { Err(e.into()) }),
71 };
72
73 req.extensions_mut().insert(claims);
74
75 let fut = self.service.call(req);
76 Box::pin(async move {
77 let res = fut.await?;
78 Ok(res)
79 })
80 }
81}
82
83fn authentication_middleware(

Callers

nothing calls this directly

Calls 2

insertMethod · 0.45

Tested by

no test coverage detected