Enum Credential
#[non_exhaustive]pub enum Credential {
None,
Bearer(String),
SshSignature {
username: String,
nonce: Vec<u8>,
signature: Vec<u8>,
},
Peercred {
uid: u32,
},
}Expand description
A credential presented for verification (the input to the initialize
handshake). Secret material is redacted in Debug — never log it raw.
Scoped to the accepted RFC provider set (bearer for native/OIDC, SSH signature, peer uid). Not-yet-accepted credential kinds (e.g. a local username/password) are added by their own scoped change, so this seam never silently carries an unaccepted credential shape.
SECURITY follow-up: the secret-bearing arms are redacted in Debug
and never Eq-compared here, but the plaintext is not yet zeroized on drop.
In-memory secret scrubbing is currently absent tree-wide (even the encrypted
config::secrets store keeps plaintext un-scrubbed), so a Zeroizing/
SecretString convention is a separate, repo-wide hardening tracked under the
auth-provider work, not bolted onto this one type.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
None
No credential was presented.
Bearer(String)
A bearer token (native pairing token, or an OIDC access/ID token).
SshSignature
An SSH challenge signature over a server-issued nonce.
Peercred
A local transport peer credential (Unix-socket uid).
Trait Implementations§
Source§impl Clone for Credential
impl Clone for Credential
Source§fn clone(&self) -> Credential
fn clone(&self) -> Credential
1.0.0 (const: unstable) · §fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for Credential
impl RefUnwindSafe for Credential
impl Send for Credential
impl Sync for Credential
impl Unpin for Credential
impl UnsafeUnpin for Credential
impl UnwindSafe for Credential
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
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>
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