pub struct FederationAdmissionGate<O: OriginAdmission, R: DidDocResolve> { /* private fields */ }Expand description
The federation admission gate: stage 1 (origin) then stage 2 (key binding), fail-closed if either fails.
Transport-agnostic: construct it once with the origin-admission handle and a
DID-doc resolver, then call admit from
any transport accept path with the per-connection (origin, application signer key, did,
optional federation JWKS).
Implementations§
Source§impl<O: OriginAdmission, R: DidDocResolve> FederationAdmissionGate<O, R>
impl<O: OriginAdmission, R: DidDocResolve> FederationAdmissionGate<O, R>
Sourcepub fn new(origin_admission: O, resolver: R) -> Self
pub fn new(origin_admission: O, resolver: R) -> Self
Construct a gate over an origin-admission handle and a DID-doc resolver.
Sourcepub async fn admit(
&self,
origin: &str,
application_signer: VerifiedApplicationSigner,
trust_surface: AdmissionTrustSurface,
did: &str,
federation_jwks: Option<&Value>,
) -> Result<AdmittedIdentity>
pub async fn admit( &self, origin: &str, application_signer: VerifiedApplicationSigner, trust_surface: AdmissionTrustSurface, did: &str, federation_jwks: Option<&Value>, ) -> Result<AdmittedIdentity>
Run the two-stage gate for an inbound peer.
origin— the peer’s RFC 6454 origin (caller extracts it from the peer DID / advertised issuer withextract_origin).application_signer— the verified application-envelope signer key and assurance (seeVerifiedApplicationSigner).trust_surface— explicit native/SPINE vs third-party interop classification. Native admission requires PQ-hybrid proof.did— the peer’s DID identifier for stage 2 (did:web:…resolved via the DID-doc resolver, ordid:key:…self-certifying / no fetch — #281).federation_jwks— an optional already-resolved federation JWKS document (e.g. from the existingjwks_uricache) used as a fallback key source when the DID document carries no matching Ed25519 VM. Reuses the caller’s JWKS cache; this module never fetches JWKS itself.
Returns the AdmittedIdentity on success; Err (reject) if stage 1
denies, if DID resolution fails, or if no VM/JWKS key matches the application signer key.
Auto Trait Implementations§
impl<O, R> Freeze for FederationAdmissionGate<O, R>
impl<O, R> RefUnwindSafe for FederationAdmissionGate<O, R>where
O: RefUnwindSafe,
R: RefUnwindSafe,
impl<O, R> Send for FederationAdmissionGate<O, R>
impl<O, R> Sync for FederationAdmissionGate<O, R>
impl<O, R> Unpin for FederationAdmissionGate<O, R>
impl<O, R> UnsafeUnpin for FederationAdmissionGate<O, R>where
O: UnsafeUnpin,
R: UnsafeUnpin,
impl<O, R> UnwindSafe for FederationAdmissionGate<O, R>where
O: UnwindSafe,
R: UnwindSafe,
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ServiceExt for T
impl<T> ServiceExt for T
§fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
fn map_response_body<F>(self, f: F) -> MapResponseBody<Self, F>where
Self: Sized,
Apply a transformation to the response body. Read more
§fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
fn trace_for_http(self) -> Trace<Self, SharedClassifier<ServerErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using HTTP status codes. Read more
§fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
fn trace_for_grpc(self) -> Trace<Self, SharedClassifier<GrpcErrorsAsFailures>>where
Self: Sized,
High level tracing that classifies responses using gRPC headers. Read more