Split into libs
This commit is contained in:
parent
f88064d4e9
commit
367105479e
13
identity/Cargo.toml
Normal file
13
identity/Cargo.toml
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
[package]
|
||||||
|
name = "identity"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2024"
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
axum = "0.8.1"
|
||||||
|
log = "0.4.25"
|
||||||
|
serde = { version = "1.0.217", features = ["derive"] }
|
||||||
|
tokio = { version = "1.43.0", features = ["full"] }
|
||||||
|
tracing = "0.1.41"
|
||||||
|
tracing-subscriber = "0.3.19"
|
||||||
|
sigma = { path = "../sigma" }
|
||||||
28
identity/src/lib.rs
Normal file
28
identity/src/lib.rs
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
use axum::{routing::get, Json, Router};
|
||||||
|
#[allow(unused)]
|
||||||
|
use log::{info, debug, warn, error, trace};
|
||||||
|
use sigma::repsonse::SigmaInformation;
|
||||||
|
use tracing::instrument;
|
||||||
|
|
||||||
|
|
||||||
|
const NAME: &str = "TinyIdentity";
|
||||||
|
const VERSION: &str = "0.0.0.1";
|
||||||
|
|
||||||
|
pub fn router() -> Router {
|
||||||
|
info!("Loading {NAME} app routes");
|
||||||
|
debug!("{NAME} version is {VERSION}");
|
||||||
|
Router::new()
|
||||||
|
.route("/", get(information))
|
||||||
|
.route("/setup", get(dummy))
|
||||||
|
.route("/me", get(dummy))
|
||||||
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
|
async fn dummy() -> Json<()> {
|
||||||
|
Json(())
|
||||||
|
}
|
||||||
|
|
||||||
|
#[instrument]
|
||||||
|
async fn information() -> Json<SigmaInformation> {
|
||||||
|
Json(SigmaInformation::new(NAME, VERSION))
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user