pub struct AuthorizationMiddleware { /* private fields */ }Expand description
Authorization middleware
Implementations§
Source§impl AuthorizationMiddleware
impl AuthorizationMiddleware
Sourcepub fn new(config: AuthorizationConfig) -> Self
pub fn new(config: AuthorizationConfig) -> Self
Create new authorization middleware
Sourcepub fn add_policy(&mut self, policy: AccessPolicy)
pub fn add_policy(&mut self, policy: AccessPolicy)
Add access policy
Check authorization
Trait Implementations§
Source§impl PipelineMiddleware for AuthorizationMiddleware
impl PipelineMiddleware for AuthorizationMiddleware
Source§fn before_process(
&self,
context: &mut MiddlewareContext,
_input: &Array2<Float>,
) -> SklResult<()>
fn before_process( &self, context: &mut MiddlewareContext, _input: &Array2<Float>, ) -> SklResult<()>
Execute before pipeline processing
Source§fn after_process(
&self,
_context: &mut MiddlewareContext,
_output: &Array2<Float>,
) -> SklResult<()>
fn after_process( &self, _context: &mut MiddlewareContext, _output: &Array2<Float>, ) -> SklResult<()>
Execute after pipeline processing
Source§fn on_error(
&self,
_context: &mut MiddlewareContext,
_error: &SklearsError,
) -> SklResult<ErrorAction>
fn on_error( &self, _context: &mut MiddlewareContext, _error: &SklearsError, ) -> SklResult<ErrorAction>
Handle errors during pipeline execution
Source§fn should_execute(&self, context: &MiddlewareContext) -> bool
fn should_execute(&self, context: &MiddlewareContext) -> bool
Whether middleware should be executed
Auto Trait Implementations§
impl Freeze for AuthorizationMiddleware
impl RefUnwindSafe for AuthorizationMiddleware
impl Send for AuthorizationMiddleware
impl Sync for AuthorizationMiddleware
impl Unpin for AuthorizationMiddleware
impl UnwindSafe for AuthorizationMiddleware
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> 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