pub struct ApiKey(pub ApiKeyRecord);Expand description
API-key extractor. Reads the key from Authorization: Bearer <key> (checked
first) or X-API-Key: <key>, hashes it, looks it up in the provided
ApiKeys store, and yields the matching ApiKeyRecord. A missing,
malformed, or unknown key is a 401. Scope checks are a separate, explicit
step (ApiKeyRecord::require_scope) so a handler decides what it needs.
Tuple Fields§
§0: ApiKeyRecordTrait Implementations§
Source§impl FromRequest for ApiKey
impl FromRequest for ApiKey
async fn from_request(ctx: &mut RequestCtx) -> Result<Self>
Auto Trait Implementations§
impl Freeze for ApiKey
impl RefUnwindSafe for ApiKey
impl Send for ApiKey
impl Sync for ApiKey
impl Unpin for ApiKey
impl UnsafeUnpin for ApiKey
impl UnwindSafe for ApiKey
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