pub struct PasswordVerifier { /* private fields */ }Expand description
One password that proves the person signing in is the server’s owner, compared in constant
time. It is not carried: tools use the server’s own upstream
configuration. This is what SignIn::OwnerPassword
builds from OAUTH_ADMIN_PASSWORD.
Implementations§
Source§impl PasswordVerifier
impl PasswordVerifier
Sourcepub fn new(password: SecretString) -> Self
pub fn new(password: SecretString) -> Self
Accepts exactly password. Changing it signs everyone out.
Trait Implementations§
Source§impl CredentialVerifier for PasswordVerifier
impl CredentialVerifier for PasswordVerifier
Source§fn label(&self) -> &str
fn label(&self) -> &str
The credential’s name in lower case, as it reads in a sentence and on the sign-in page,
e.g. “password” or “Companies House API key”. It also tells verifiers apart in the
sign-in version, so changing it signs everyone out.
Source§fn prepare<'a>(&self, entered: &'a str) -> &'a str
fn prepare<'a>(&self, entered: &'a str) -> &'a str
Turns what was typed on the sign-in page into the credential to check. Defaults to
trimming surrounding whitespace, which pasted keys often carry; a password keeps it.
Source§fn plausible(&self, credential: &str) -> bool
fn plausible(&self, credential: &str) -> bool
Whether
credential has the shape of one, checked before anything else. Defaults to
plausible; narrow it when the upstream service’s credentials have a known form, so
other tokens are refused locally instead of being forwarded. Implausible input is refused
without counting as a failed attempt.Source§fn check<'a>(&'a self, credential: &'a str) -> CheckFuture<'a>
fn check<'a>(&'a self, credential: &'a str) -> CheckFuture<'a>
Checks
credential.Source§fn carried(&self) -> bool
fn carried(&self) -> bool
Whether the credential is the person’s own key to the upstream service: sealed into their
tokens and handed to tools as a
Credential. false for a password that only proves
who may sign in. Defaults to true.Source§fn generation(&self) -> &[u8] ⓘ
fn generation(&self) -> &[u8] ⓘ
Bytes that change whenever every earlier sign-in should end, such as a hash of the
password, or a new upstream service or environment. Tokens carry a keyed hash of them and
of
label, so a change to either signs everyone out. Defaults to none.Source§fn help(&self) -> &str
fn help(&self) -> &str
One sentence of help under the field, plain text: what it is and where to get one.
Source§fn accepts_bearer(&self) -> bool
fn accepts_bearer(&self) -> bool
Whether a client may send the credential itself as its bearer token instead of signing in
with OAuth. Defaults to
carried.Source§fn subject(&self, credential: &str) -> Option<String>
fn subject(&self, credential: &str) -> Option<String>
Who signed in with
credential: the sub of their tokens, the audit log’s subject and a
Caller’s subject. It must not reveal the credential, and is
readable by anyone who sees a token or a log line. Defaults to None, which lets the
server name them: key: and 16 hex digits of a hash of the credential keyed by
OAUTH_SIGNING_KEY when credentials are carried (one subject per person), and owner
otherwise.Source§fn upstream(&self) -> Option<&dyn UpstreamSignIn>
fn upstream(&self) -> Option<&dyn UpstreamSignIn>
The upstream OAuth provider people sign in through instead of typing a credential, if
any: the sign-in page then sends them to the provider, and the credential it grants is
sealed into their tokens. Defaults to
None. UpstreamVerifier
builds a verifier around one; see crate::upstream.Auto Trait Implementations§
impl Forget for PasswordVerifier
impl Freeze for PasswordVerifier
impl RefUnwindSafe for PasswordVerifier
impl Send for PasswordVerifier
impl Sync for PasswordVerifier
impl Unpin for PasswordVerifier
impl UnsafeUnpin for PasswordVerifier
impl UnwindSafe for PasswordVerifier
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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