pub struct Sessions<'a> { /* private fields */ }Expand description
Session mode: the credentials the proxy accepts and where their taint is read.
Implementations§
Source§impl<'a> Sessions<'a>
impl<'a> Sessions<'a>
Sourcepub fn new(credentials: Vec<Credential>, taint: &'a dyn TaintLookup) -> Self
pub fn new(credentials: Vec<Credential>, taint: &'a dyn TaintLookup) -> Self
Accept credentials; look each session’s taint up in taint.
Sourcepub fn verify<T: AsRef<[u8]>>(&self, headers: &[T]) -> Result<&str, AuthError>
pub fn verify<T: AsRef<[u8]>>(&self, headers: &[T]) -> Result<&str, AuthError>
The session that headers (every Proxy-Authorization value of the
request) authenticate. Every credential is compared in full, in time
that does not depend on where a guess first differs.
Sourcepub fn taint(&self, session: &str) -> Result<Taint, String>
pub fn taint(&self, session: &str) -> Result<Taint, String>
The taint of session, from the lookup.
Sourcepub fn taint_within(
&self,
session: &str,
max_age: Duration,
) -> Result<Taint, String>
pub fn taint_within( &self, session: &str, max_age: Duration, ) -> Result<Taint, String>
The taint of session as looked up at most max_age ago, looked up
again when it is older. Each open connection of a session is checked
against its taint every so often; this keeps that to one lookup per
max_age for the whole session. A new connection uses Self::taint.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !Freeze for Sessions<'a>
impl<'a> !RefUnwindSafe for Sessions<'a>
impl<'a> !UnwindSafe for Sessions<'a>
impl<'a> Send for Sessions<'a>
impl<'a> Sync for Sessions<'a>
impl<'a> Unpin for Sessions<'a>
impl<'a> UnsafeUnpin for Sessions<'a>
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