pub struct InMemoryHandler {
pub local: Option<String>,
pub peer: Option<String>,
}Expand description
A simulated transport that authenticates a fixed local-and-peer VID pair.
On the consumer side it reports the configured peer as the transport-authenticated issuer and the configured local party as the transport-authenticated recipient. On the producer side it strips in-band members that match the configured local-as-issuer / peer-as-recipient assignment — modelling the §9.2 item 1 behavior of a transport that conveys authenticated identity end-to-end.
Use it for tests and examples that want to exercise the
TransportHandler contract without standing up a real binding.
Fields§
§local: Option<String>Authenticated identity of the party running this handler.
peer: Option<String>Authenticated identity of the peer this handler is talking to.
Implementations§
Source§impl InMemoryHandler
impl InMemoryHandler
Sourcepub fn new() -> InMemoryHandler
pub fn new() -> InMemoryHandler
Construct a handler with no configured parties (equivalent to
NoopHandler for consumer-side
resolution).
Sourcepub fn with_local(self, vid: impl Into<String>) -> InMemoryHandler
pub fn with_local(self, vid: impl Into<String>) -> InMemoryHandler
Set the local party identity. Builder-style.
Sourcepub fn with_peer(self, vid: impl Into<String>) -> InMemoryHandler
pub fn with_peer(self, vid: impl Into<String>) -> InMemoryHandler
Set the peer party identity. Builder-style.
Trait Implementations§
Source§impl Clone for InMemoryHandler
impl Clone for InMemoryHandler
Source§fn clone(&self) -> InMemoryHandler
fn clone(&self) -> InMemoryHandler
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InMemoryHandler
impl Debug for InMemoryHandler
Source§impl Default for InMemoryHandler
impl Default for InMemoryHandler
Source§fn default() -> InMemoryHandler
fn default() -> InMemoryHandler
Source§impl TransportHandler for InMemoryHandler
impl TransportHandler for InMemoryHandler
Source§fn binding_uri(&self) -> &str
fn binding_uri(&self) -> &str
Source§fn derive_parties(&self) -> TransportContext
fn derive_parties(&self) -> TransportContext
Source§fn prepare_outbound<P>(&self, doc: &mut TrustTask<P>)where
P: Serialize,
fn prepare_outbound<P>(&self, doc: &mut TrustTask<P>)where
P: Serialize,
Source§fn resolve_parties<P>(
&self,
doc: &TrustTask<P>,
) -> Result<ResolvedParties, ConsistencyError>
fn resolve_parties<P>( &self, doc: &TrustTask<P>, ) -> Result<ResolvedParties, ConsistencyError>
ResolvedParties for an inbound document. Read moreSource§fn reject<P>(
&self,
doc: &TrustTask<P>,
id: impl Into<String>,
reason: RejectReason,
) -> Option<TrustTask<ErrorPayload>>
fn reject<P>( &self, doc: &TrustTask<P>, id: impl Into<String>, reason: RejectReason, ) -> Option<TrustTask<ErrorPayload>>
trust-task-error response for doc that satisfies the
SPEC.md §8.1 routing rules — most importantly, the rule that under
RejectReason::IdentityMismatch the error MUST address the
transport-authenticated sender and MUST NOT address the contested
in-band issuer. Read moreAuto Trait Implementations§
impl Freeze for InMemoryHandler
impl RefUnwindSafe for InMemoryHandler
impl Send for InMemoryHandler
impl Sync for InMemoryHandler
impl Unpin for InMemoryHandler
impl UnsafeUnpin for InMemoryHandler
impl UnwindSafe for InMemoryHandler
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> BorrowUnordered for T
impl<T> BorrowUnordered for T
fn as_unordered(&self) -> &Unordered<T>
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
impl<T> Clear for Twhere
T: InitializableFromZeroed + ?Sized,
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> InitializableFromZeroed for Twhere
T: Default,
impl<T> InitializableFromZeroed for Twhere
T: Default,
Source§unsafe fn initialize(place: *mut T)
unsafe fn initialize(place: *mut T)
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> 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::RequestSource§impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
impl<T, U, C> IntoWithContext<U, C> for Twhere
U: FromWithContext<T, C>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> ResourceProvider<()> for T
impl<T> ResourceProvider<()> for T
Source§fn get_resource(&self) -> &()
fn get_resource(&self) -> &()
T.