feat: Create API endpoints for register, approve and poll

This commit is contained in:
2026-06-25 16:06:00 +05:30
parent 122f6dc617
commit 977e5bc2c8
5 changed files with 249 additions and 8 deletions

22
test_axum_age.rs Normal file
View File

@@ -0,0 +1,22 @@
use axum::{extract::State, http::StatusCode, Json, response::IntoResponse, routing::post, Router};
use std::str::FromStr;
#[derive(Clone)]
struct AppState {}
async fn handler(State(_s): State<AppState>) -> Result<Json<()>, (StatusCode, String)> {
Ok(Json(()))
}
fn test_age() {
let pk = "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIH0b9c/A... user@host";
let recipient: age::ssh::Recipient = pk.parse().unwrap();
let r: &dyn age::Recipient = &recipient;
let encryptor = age::Encryptor::with_recipients(vec![r].into_iter());
let _ = encryptor.unwrap();
}
fn main() {
let state = AppState {};
let app = Router::new().route("/", post(handler)).with_state(state);
}