pub struct SecurityContext {
pub policy: Arc<dyn SecurityPolicy>,
pub authenticator: Arc<dyn TokenAuthenticator>,
pub credential_sources: Vec<CredentialSource>,
}Expand description
Security context passed to a consumer before start().
Carries the SecurityPolicy and TokenAuthenticator from the route
controller so consumers (e.g. WebSocket) can register auth state
before accepting connections.
Fields§
§policy: Arc<dyn SecurityPolicy>§authenticator: Arc<dyn TokenAuthenticator>§credential_sources: Vec<CredentialSource>Implementations§
Source§impl SecurityContext
impl SecurityContext
pub fn new( policy: impl SecurityPolicy + 'static, authenticator: Arc<dyn TokenAuthenticator>, ) -> Self
pub fn from_arc( policy: Arc<dyn SecurityPolicy>, authenticator: Arc<dyn TokenAuthenticator>, ) -> Self
pub fn with_credential_sources(self, sources: Vec<CredentialSource>) -> Self
Trait Implementations§
Source§impl Clone for SecurityContext
impl Clone for SecurityContext
Auto Trait Implementations§
impl Freeze for SecurityContext
impl !RefUnwindSafe for SecurityContext
impl Send for SecurityContext
impl Sync for SecurityContext
impl Unpin for SecurityContext
impl UnsafeUnpin for SecurityContext
impl !UnwindSafe for SecurityContext
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