Skip to main content

get_owned_api_key

Function get_owned_api_key 

Source
pub async fn get_owned_api_key<DB: DatabaseAdapter>(
    ctx: &AuthContext<DB>,
    key_id: &str,
    user_id: &str,
) -> AuthResult<DB::ApiKey>
Expand description

Fetch an API key by ID and verify that it belongs to the given user.

Returns AuthError::not_found if the key does not exist or belongs to another user. This pattern was duplicated in handle_get, handle_update, and handle_delete.