pub struct ApiKeyMeta {
pub id: String,
pub tenant_id: String,
pub name: String,
pub scopes: Vec<String>,
pub expires_at: Option<String>,
pub last_used_at: Option<String>,
pub created_at: String,
}Expand description
Public metadata extracted by super::ApiKeyLayer middleware.
Available as an axum extractor in handlers (implements
FromRequestParts and
OptionalFromRequestParts).
Does not contain the key hash or revocation timestamp.
Fields§
§id: StringULID primary key.
tenant_id: StringTenant this key belongs to.
name: StringHuman-readable name.
scopes: Vec<String>Scopes this key grants.
expires_at: Option<String>Expiration timestamp (ISO 8601), or None for lifetime.
last_used_at: Option<String>Last time this key was used (ISO 8601).
created_at: StringCreation timestamp (ISO 8601).
Trait Implementations§
Source§impl Clone for ApiKeyMeta
impl Clone for ApiKeyMeta
Source§fn clone(&self) -> ApiKeyMeta
fn clone(&self) -> ApiKeyMeta
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApiKeyMeta
impl Debug for ApiKeyMeta
Source§impl<S: Send + Sync> FromRequestParts<S> for ApiKeyMeta
impl<S: Send + Sync> FromRequestParts<S> for ApiKeyMeta
Source§impl<S: Send + Sync> OptionalFromRequestParts<S> for ApiKeyMeta
impl<S: Send + Sync> OptionalFromRequestParts<S> for ApiKeyMeta
Auto Trait Implementations§
impl Freeze for ApiKeyMeta
impl RefUnwindSafe for ApiKeyMeta
impl Send for ApiKeyMeta
impl Sync for ApiKeyMeta
impl Unpin for ApiKeyMeta
impl UnsafeUnpin for ApiKeyMeta
impl UnwindSafe for ApiKeyMeta
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<S, T> FromRequest<S, ViaParts> for T
impl<S, T> FromRequest<S, ViaParts> for T
Source§type Rejection = <T as FromRequestParts<S>>::Rejection
type Rejection = <T as FromRequestParts<S>>::Rejection
If the extractor fails it’ll use this “rejection” type. A rejection is
a kind of error that can be converted into a response.
Source§fn from_request(
req: Request<Body>,
state: &S,
) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
fn from_request( req: Request<Body>, state: &S, ) -> impl Future<Output = Result<T, <T as FromRequest<S, ViaParts>>::Rejection>>
Perform the extraction.