feat(router): implement ApiKeyInterface for MockDb (#1101)

Co-authored-by: Derek Leverenz <derel@dereleverenz.com>
Co-authored-by: Sanchith Hegde <22217505+SanchithHegde@users.noreply.github.com>
This commit is contained in:
Derek Leverenz
2023-05-16 11:35:50 -07:00
committed by GitHub
parent 236124d199
commit 95c7ca99d1
3 changed files with 225 additions and 26 deletions

View File

@ -3,7 +3,7 @@ use time::PrimitiveDateTime;
use crate::schema::api_keys;
#[derive(Debug, Identifiable, Queryable)]
#[derive(Debug, Clone, Identifiable, Queryable)]
#[diesel(table_name = api_keys, primary_key(key_id))]
pub struct ApiKey {
pub key_id: String,
@ -77,7 +77,7 @@ impl From<ApiKeyUpdate> for ApiKeyUpdateInternal {
}
}
#[derive(Debug, AsExpression)]
#[derive(Debug, Clone, AsExpression, PartialEq)]
#[diesel(sql_type = diesel::sql_types::Text)]
pub struct HashedApiKey(String);