pub struct ApiKeyEntry {
pub name: String,
pub hash: String,
pub expires_at: Option<u64>,
pub created_at: u64,
pub namespaces: Vec<String>,
pub admin: bool,
}Expand description
A stored API key entry with metadata.
Fields§
§name: StringHuman-readable name for this key.
hash: StringArgon2 hash of the key.
expires_at: Option<u64>Optional Unix timestamp (seconds) when this key expires.
created_at: u64When the key was created (Unix seconds).
namespaces: Vec<String>Namespaces this key may act in.
Empty means unrestricted — the key may name any namespace. That is
the right default for a single-tenant deployment, where the header is
always default and binding it would be ceremony. It is the wrong
default for a multi-tenant one, which is why chronixd refuses to
start multi-tenant with an unrestricted key rather than silently
handing every tenant’s data to every key.
admin: boolWhether this key may perform administrative operations.
Restore, namespace management and key management are all reachable with an ordinary key otherwise, because the Cedar authorization engine is optional and its absence used to mean “permit”.
Implementations§
Source§impl ApiKeyEntry
impl ApiKeyEntry
Sourcepub fn allows_namespace(&self, namespace: &str) -> bool
pub fn allows_namespace(&self, namespace: &str) -> bool
Whether this key may act in namespace.
Trait Implementations§
Source§impl Clone for ApiKeyEntry
impl Clone for ApiKeyEntry
Source§fn clone(&self) -> ApiKeyEntry
fn clone(&self) -> ApiKeyEntry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ApiKeyEntry
impl Debug for ApiKeyEntry
Source§impl<'de> Deserialize<'de> for ApiKeyEntry
impl<'de> Deserialize<'de> for ApiKeyEntry
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for ApiKeyEntry
impl RefUnwindSafe for ApiKeyEntry
impl Send for ApiKeyEntry
impl Sync for ApiKeyEntry
impl Unpin for ApiKeyEntry
impl UnsafeUnpin for ApiKeyEntry
impl UnwindSafe for ApiKeyEntry
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> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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> ⓘ
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