pub struct DefaultAuthorizer { /* private fields */ }Expand description
Default authorizer: public streams are open, private streams are policy-gated, and unknown classification fails closed for safety.
- If
Visibility::Public→ alwaysSubscribeDecision::Allow(preserves the working same-tenant open-subscribe model). - If
Visibility::Private→ delegate to thePolicyGate; allow iff the gate returnstrue. With no gate installed, private subscribes are denied (fail-closed) — we never invent fail-dangerous behaviour.
When constructed with DefaultAuthorizer::permissive, every track is
treated as public (the pre-#276 behaviour) — used as the default until a
deployment opts into private-stream classification.
Implementations§
Source§impl DefaultAuthorizer
impl DefaultAuthorizer
Sourcepub fn permissive() -> Self
pub fn permissive() -> Self
Permissive default: every track is treated as public (open subscribe). Per-tenant announce scoping still applies independently.
Sourcepub fn new(visibility: VisibilityFn, policy: Option<PolicyGate>) -> Self
pub fn new(visibility: VisibilityFn, policy: Option<PolicyGate>) -> Self
Build with a custom visibility classifier and a policy gate for private streams. Private + (no gate or gate-denied) → denied.
Sourcepub fn with_visibility(self, visibility: VisibilityFn) -> Self
pub fn with_visibility(self, visibility: VisibilityFn) -> Self
Set/replace the visibility classifier.
Sourcepub fn with_policy(self, policy: PolicyGate) -> Self
pub fn with_policy(self, policy: PolicyGate) -> Self
Set/replace the policy gate used for private streams.
Trait Implementations§
Source§impl Clone for DefaultAuthorizer
impl Clone for DefaultAuthorizer
Source§fn clone(&self) -> DefaultAuthorizer
fn clone(&self) -> DefaultAuthorizer
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl SubscribeAuthorizer for DefaultAuthorizer
impl SubscribeAuthorizer for DefaultAuthorizer
Decide whether
peer may subscribe to track_name.Decide admission while moq-net provides no track name callback (#276). Read more
Auto Trait Implementations§
impl Freeze for DefaultAuthorizer
impl !RefUnwindSafe for DefaultAuthorizer
impl Send for DefaultAuthorizer
impl Sync for DefaultAuthorizer
impl Unpin for DefaultAuthorizer
impl UnsafeUnpin for DefaultAuthorizer
impl !UnwindSafe for DefaultAuthorizer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§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