Files
ssh-cert-dist/common/src/routes.rs
shimun f47c57c1c0 wip: JWTAuthenticated
TODO: move into api/

fix: test

chore: move JWTAuthenticated into extract

chore: fmt
2023-03-12 16:25:17 +01:00

42 lines
858 B
Rust

use axum_extra::routing::TypedPath;
use serde::{Deserialize, Serialize};
use ssh_key::Fingerprint;
#[derive(TypedPath, Deserialize)]
#[typed_path("/certs")]
pub struct CertList;
#[derive(TypedPath, Deserialize)]
#[typed_path("/cert/:identifier")]
pub struct GetCert {
pub identifier: String,
}
#[derive(TypedPath, Deserialize)]
#[typed_path("/certs/:pubkey_hash")]
pub struct GetCertsPubkey {
pub pubkey_hash: Fingerprint,
}
#[derive(Debug, Serialize, Deserialize, Default)]
pub struct CertIds {
pub ids: Vec<String>,
}
#[derive(TypedPath, Deserialize)]
#[typed_path("/cert/:identifier/info")]
pub struct GetCertInfo {
pub identifier: String,
}
#[derive(TypedPath, Deserialize)]
#[typed_path("/cert/:identifier")]
pub struct PostCertInfo {
pub identifier: String,
}
#[derive(TypedPath)]
#[typed_path("/cert")]
pub struct PutCert;