From 44c47b3c2a2ec3e9c9c0efac4dceaec082a62d60 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Thu, 30 May 2024 00:06:08 +0200 Subject: document cookie auth and such --- src/filters/auth/cookie.html | 35 ----------------------------------- src/filters/auth/cookie.rs | 3 ++- src/filters/auth/login.html | 35 +++++++++++++++++++++++++++++++++++ src/main.rs | 2 -- 4 files changed, 37 insertions(+), 38 deletions(-) delete mode 100644 src/filters/auth/cookie.html create mode 100644 src/filters/auth/login.html (limited to 'src') diff --git a/src/filters/auth/cookie.html b/src/filters/auth/cookie.html deleted file mode 100644 index 40bb157..0000000 --- a/src/filters/auth/cookie.html +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - Document - - - -
-
-
-
-
- -
- - diff --git a/src/filters/auth/cookie.rs b/src/filters/auth/cookie.rs index c1847ce..620911d 100644 --- a/src/filters/auth/cookie.rs +++ b/src/filters/auth/cookie.rs @@ -52,7 +52,7 @@ impl Node for CookieAuth { request: NodeRequest, ) -> Pin> + Send + Sync + 'a>> { Box::pin(async move { - if request.method() == Method::POST { + if request.method() == Method::POST && request.uri().path() == "/_gnix_login" { let referrer = request.headers().get(REFERER).cloned(); let d = request .into_body() @@ -62,6 +62,7 @@ impl Node for CookieAuth { .unwrap(); let d = String::from_utf8(d.to_bytes().to_vec()).unwrap(); + // TODO proper parser let mut username = "user"; let mut password = ""; for kv in d.split("&") { diff --git a/src/filters/auth/login.html b/src/filters/auth/login.html new file mode 100644 index 0000000..c7782bd --- /dev/null +++ b/src/filters/auth/login.html @@ -0,0 +1,35 @@ + + + + + + Gnix Login + + + +
+
+
+
+
+ +
+ + diff --git a/src/main.rs b/src/main.rs index 5a88ad1..045440e 100644 --- a/src/main.rs +++ b/src/main.rs @@ -7,8 +7,6 @@ pub mod config; pub mod error; pub mod filters; pub mod helper; -#[cfg(feature = "mond")] -pub mod reporting; use aes_gcm_siv::{aead::generic_array::GenericArray, Aes256GcmSiv, KeyInit}; use anyhow::{anyhow, Context, Result}; -- cgit v1.2.3-70-g09d2