feat: complete Epic 1 production foundation

This commit is contained in:
2026-08-25 01:24:11 +03:00
parent 767428436d
commit 182bde8ac0
298 changed files with 35719 additions and 5299 deletions
+21
View File
@@ -40,6 +40,15 @@ pub enum AuthConfig {
}
impl AuthConfig {
pub const fn kind(&self) -> AuthKind {
match self {
Self::Bearer(_) => AuthKind::Bearer,
Self::Basic(_) => AuthKind::Basic,
Self::ApiKeyHeader(_) => AuthKind::ApiKeyHeader,
Self::ApiKeyQuery(_) => AuthKind::ApiKeyQuery,
}
}
pub fn secret_ids(&self) -> Vec<&SecretId> {
match self {
Self::Bearer(config) => vec![&config.secret_id],
@@ -94,4 +103,16 @@ mod tests {
assert_eq!(value["created_at"], json!("2026-03-25T12:00:00Z"));
assert_eq!(value["updated_at"], json!("2026-03-25T12:05:00Z"));
}
#[test]
fn auth_config_reports_its_semantic_kind() {
assert_eq!(
AuthConfig::ApiKeyHeader(ApiKeyHeaderAuthConfig {
header_name: "X-Api-Key".to_owned(),
secret_id: SecretId::new("secret_01"),
})
.kind(),
AuthKind::ApiKeyHeader
);
}
}