pub struct RpcMiddlewareRequest {
pub request_id: u64,
pub raw_macaroon: Vec<u8>,
pub custom_caveat_condition: String,
pub msg_id: u64,
pub metadata_pairs: HashMap<String, MetadataValues>,
pub intercept_type: Option<InterceptType>,
}Fields§
§request_id: u64The unique ID of the intercepted original gRPC request. Useful for mapping request to response when implementing full duplex message interception. For streaming requests, this will be the same ID for all incoming and outgoing middleware intercept messages of the same stream.
raw_macaroon: Vec<u8>The raw bytes of the complete macaroon as sent by the gRPC client in the original request. This might be empty for a request that doesn’t require macaroons such as the wallet unlocker RPCs.
custom_caveat_condition: StringThe parsed condition of the macaroon’s custom caveat for convenient access. This field only contains the value of the custom caveat that the handling middleware has registered itself for. The condition must be validated for messages of intercept_type stream_auth and request!
msg_id: u64The unique message ID of this middleware intercept message. There can be multiple middleware intercept messages per single gRPC request (one for the incoming request and one for the outgoing response) or gRPC stream (one for each incoming message and one for each outgoing response). This message ID must be referenced when responding (accepting/rejecting/modifying) to an intercept message.
metadata_pairs: HashMap<String, MetadataValues>The metadata pairs that were sent along with the original gRPC request via the golang context.Context using explicit gRPC metadata. Context values are not propagated via gRPC and so we send any pairs along explicitly here so that the interceptor can access them.
intercept_type: Option<InterceptType>There are three types of messages that will be sent to the middleware for inspection and approval: Stream authentication, request and response interception. The first two can only be accepted (=forward to main RPC server) or denied (=return error to client). Intercepted responses can also be replaced/overwritten.
Trait Implementations§
Source§impl Clone for RpcMiddlewareRequest
impl Clone for RpcMiddlewareRequest
Source§fn clone(&self) -> RpcMiddlewareRequest
fn clone(&self) -> RpcMiddlewareRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for RpcMiddlewareRequest
impl Debug for RpcMiddlewareRequest
Source§impl Default for RpcMiddlewareRequest
impl Default for RpcMiddlewareRequest
Source§impl Message for RpcMiddlewareRequest
impl Message for RpcMiddlewareRequest
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
fn encode(&self, buf: &mut impl BufMut) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
fn encode_length_delimited(
&self,
buf: &mut impl BufMut,
) -> Result<(), EncodeError>where
Self: Sized,
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Source§fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
fn decode_length_delimited(buf: impl Buf) -> Result<Self, DecodeError>where
Self: Default,
Source§fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self. Read moreSource§fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
fn merge_length_delimited(&mut self, buf: impl Buf) -> Result<(), DecodeError>where
Self: Sized,
self.Source§impl PartialEq for RpcMiddlewareRequest
impl PartialEq for RpcMiddlewareRequest
impl StructuralPartialEq for RpcMiddlewareRequest
Auto Trait Implementations§
impl Freeze for RpcMiddlewareRequest
impl RefUnwindSafe for RpcMiddlewareRequest
impl Send for RpcMiddlewareRequest
impl Sync for RpcMiddlewareRequest
impl Unpin for RpcMiddlewareRequest
impl UnwindSafe for RpcMiddlewareRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request