TODO: move into api/ fix: test chore: move JWTAuthenticated into extract chore: fmt
42 lines
858 B
Rust
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;
|