pub struct Gatekeeper<R, A = NoopAuditSink, C = IdentityReasonCatalog, W = NoopPolicyObserver> { /* private fields */ }Expand description
Axum-friendly authorization boundary.
Implementations§
Source§impl<R> Gatekeeper<R>
impl<R> Gatekeeper<R>
Source§impl<R, A, C, W> Gatekeeper<R, A, C, W>
impl<R, A, C, W> Gatekeeper<R, A, C, W>
Sourcepub fn with_audit_sink<NextAudit>(
self,
audit_sink: NextAudit,
) -> Gatekeeper<R, NextAudit, C, W>
pub fn with_audit_sink<NextAudit>( self, audit_sink: NextAudit, ) -> Gatekeeper<R, NextAudit, C, W>
Replaces the audit sink.
Sourcepub fn with_reason_catalog<NextCatalog>(
self,
reason_catalog: NextCatalog,
) -> Gatekeeper<R, A, NextCatalog, W>
pub fn with_reason_catalog<NextCatalog>( self, reason_catalog: NextCatalog, ) -> Gatekeeper<R, A, NextCatalog, W>
Replaces the reason catalog used for forbidden denials.
Sourcepub fn with_observer<NextObserver>(
self,
observer: NextObserver,
) -> Gatekeeper<R, A, C, NextObserver>
pub fn with_observer<NextObserver>( self, observer: NextObserver, ) -> Gatekeeper<R, A, C, NextObserver>
Replaces the side-channel decision observer.
Sourcepub fn with_denial_response(self, denial_response: DenialResponseConfig) -> Self
pub fn with_denial_response(self, denial_response: DenialResponseConfig) -> Self
Replaces denial presentation settings.
Sourcepub const fn with_audit_subjects(self, audit_subjects: AuditSubjects) -> Self
pub const fn with_audit_subjects(self, audit_subjects: AuditSubjects) -> Self
Controls whether audit entries include tenant and principal identifiers.
Source§impl<R, A, C, W> Gatekeeper<R, A, C, W>
impl<R, A, C, W> Gatekeeper<R, A, C, W>
Resolves facts, evaluates the policy, observes and audits the decision, and returns an axum rejection for denied requests.
§Errors
Returns GatekeepRejection when policy hashing, fact resolution,
trace conversion, or audit persistence fails, or when the policy denies
the request.
Trait Implementations§
Auto Trait Implementations§
impl<R, A, C, W> Freeze for Gatekeeper<R, A, C, W>
impl<R, A, C, W> RefUnwindSafe for Gatekeeper<R, A, C, W>
impl<R, A, C, W> Send for Gatekeeper<R, A, C, W>
impl<R, A, C, W> Sync for Gatekeeper<R, A, C, W>
impl<R, A, C, W> Unpin for Gatekeeper<R, A, C, W>
impl<R, A, C, W> UnsafeUnpin for Gatekeeper<R, A, C, W>
impl<R, A, C, W> UnwindSafe for Gatekeeper<R, A, C, W>
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