Method
call
(
&mut self,
mut request: tonic::Request<()>,
)
Source from the content-addressed store, hash-verified
| 50 | |
| 51 | impl tonic::service::Interceptor for TokenInterceptor { |
| 52 | fn call( |
| 53 | &mut self, |
| 54 | mut request: tonic::Request<()>, |
| 55 | ) -> Result<tonic::Request<()>, tonic::Status> { |
| 56 | if let Some(token) = &self.0 { |
| 57 | request |
| 58 | .metadata_mut() |
| 59 | .insert_bin(SANDBOX_TOKEN_METADATA, token.clone()); |
| 60 | } |
| 61 | Ok(request) |
| 62 | } |
| 63 | } |
| 64 | |
| 65 | /// A channel whose every request carries the sandbox token. |
Callers
nothing calls this directly
Tested by
no test coverage detected