pxsolver-auth 1.2.0

API-key + per-domain allowlist + audit log
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use async_trait::async_trait;
use px_errors::AppError;
use serde::{Deserialize, Serialize};

#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, Eq)]
pub struct ApiKeyRecord {
    pub id: String,
    pub argon2_hash: String,
    pub note: Option<String>,
}

#[async_trait]
pub trait KeyStore: Send + Sync {
    async fn find_by_id(&self, id: &str) -> Result<Option<ApiKeyRecord>, AppError>;
    async fn list_ids(&self) -> Result<Vec<String>, AppError>;
}