pub struct GatewayKeys { /* private fields */ }Expand description
Loaded, lookup-ready key set. One instance per proxy process, loaded at startup (key rotation = redeploy/restart, the standard secret-mount flow).
Implementations§
Source§impl GatewayKeys
impl GatewayKeys
Sourcepub fn default_path() -> PathBuf
pub fn default_path() -> PathBuf
Resolve the keys file path: LEAN_CTX_GATEWAY_KEYS env wins, else
<config_dir>/gateway-keys.toml (next to config.toml).
Sourcepub fn load_default() -> Result<Self>
pub fn load_default() -> Result<Self>
Load from the default path; a missing file is an empty key set (the common local case), a malformed file is a loud startup error.
pub fn load(path: &Path) -> Result<Self>
Sourcepub fn parse(raw: &str, origin: &Path) -> Result<Self>
pub fn parse(raw: &str, origin: &Path) -> Result<Self>
Parses a key-file body without touching disk. origin is only used in
error messages. Callers that assemble a file body by hand validate it
through this BEFORE the atomic write, so an invalid assembly can never
replace a good file on disk (#716).
pub fn is_empty(&self) -> bool
pub fn len(&self) -> usize
Sourcepub fn lookup(&self, bearer_key: &str) -> Option<GatewayTags>
pub fn lookup(&self, bearer_key: &str) -> Option<GatewayTags>
Authenticate a bearer key: SHA-256 it and look the hash up. Returns the identity tags on a match.
Trait Implementations§
Source§impl Debug for GatewayKeys
impl Debug for GatewayKeys
Source§impl Default for GatewayKeys
impl Default for GatewayKeys
Source§fn default() -> GatewayKeys
fn default() -> GatewayKeys
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for GatewayKeys
impl RefUnwindSafe for GatewayKeys
impl Send for GatewayKeys
impl Sync for GatewayKeys
impl Unpin for GatewayKeys
impl UnsafeUnpin for GatewayKeys
impl UnwindSafe for GatewayKeys
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
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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