From 41b173de407199ec4232c3d39faf90ca5ac970d9 Mon Sep 17 00:00:00 2001 From: PlexSheep Date: Wed, 11 Sep 2024 21:13:57 +0200 Subject: [PATCH] feat: show secret on admin detail page #12 --- data/www/admin/details.html | 1 + src/meta/admin.rs | 1 + src/vault.rs | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/www/admin/details.html b/data/www/admin/details.html index 1af3399..9146827 100644 --- a/data/www/admin/details.html +++ b/data/www/admin/details.html @@ -37,6 +37,7 @@ {{challenge.solution}}

+ {{secret}} diff --git a/src/meta/admin.rs b/src/meta/admin.rs index 57a26ad..164ccca 100644 --- a/src/meta/admin.rs +++ b/src/meta/admin.rs @@ -58,6 +58,7 @@ async fn details( ..default_context(), ..context!( challenge => challenge, + secret => vault.secret(), title => "Wooly-Vault Admin Interface", contestants => vault.contestants().await.iter().collect::>(), winners => vault.winners().await.iter().collect::>(), diff --git a/src/vault.rs b/src/vault.rs index b066fb2..4051a95 100644 --- a/src/vault.rs +++ b/src/vault.rs @@ -17,7 +17,7 @@ use tokio::sync::Mutex; /// This type is used to share a [`Vault`] instance across multiple parts of the application. pub type VaultRef = Arc; -#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize, PartialOrd, Ord)] pub struct Contestant { ip: IpAddr, }