Skip to content

Commit 6bd1799

Browse files
committed
Add persistent session support and logout functionality. This project is now by definition feature-complete.
1 parent 5445492 commit 6bd1799

File tree

7 files changed

+542
-180
lines changed

7 files changed

+542
-180
lines changed

Cargo.lock

Lines changed: 213 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "nginx-auth-server"
3-
version = "0.3.0"
3+
version = "1.0.0"
44
authors = ["Steffen Manzer"]
55
edition = '2024'
66

@@ -14,12 +14,13 @@ strip = true # Strip symbols from binary
1414
[dependencies]
1515
axum = "0.8"
1616
axum-extra = { version = "0.10", features = ["cookie"] }
17-
cookie = "0.18"
17+
chrono = { version = "0.4", features = ["serde"] }
1818
clap = { version = "4.5", features = ["derive"] }
19-
tokio = { version = "1", features = ["full"] }
20-
serde = { version = "1", features = ["derive"] }
21-
#pam = "0.8" # uses `users`, see RUSTSEC-2023-0059 and commit #0f6862e
22-
pam = { git = "https://github.com/1wilkens/pam.git", rev = "daf26ae3512d8e5a7478ccff1e4232ef5ebf9b03" }
19+
cookie = "0.18"
20+
once_cell = "1.21"
2321
otpauth = "0.5"
22+
pam = { git = "https://github.com/1wilkens/pam.git", rev = "daf26ae3512d8e5a7478ccff1e4232ef5ebf9b03" } # latest release 0.8 still uses deprecated `users` crate, this rev switched to `uzers`
23+
serde = { version = "1", features = ["derive"] }
24+
serde_json = "1.0"
25+
tokio = { version = "1", features = ["full"] }
2426
uuid = { version = "1", features = ["v4"] }
25-
once_cell = "1.21"

README.md

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# nginx auth request server
22

3-
This is a **small and lightweight** http server, to be used by nginx to authenticate users against linux system users via PAM and an auxiliary totp file with `ngx_http_auth_request_module`.
3+
This is a **small and lightweight** http authentication server, to be used by nginx with `ngx_http_auth_request_module` to authenticate your website visitors against linux system users via PAM, providing additional security with two-factor-authentication.
44

55
## Request flow
66

@@ -12,17 +12,11 @@ This is a **small and lightweight** http server, to be used by nginx to authenti
1212

1313
Everything is *intentionally* kept as simple and minimal as viable.
1414
This project is more a simple to understand tech-demo and minimal working example rather than a full-featured user and session manager.
15+
If you really do want to add features, please open a *discussion* first before you create a PR.
16+
Otherwise, feel free to create a fork for your personal requirements.
1517

16-
This code is provided as-is without support.
17-
Since this is my first rust project, the code quality may vary and be suboptimal to some extent.
18-
Feel free to open a PR to improve potential issues. :-)
19-
20-
Use at your own risk, error handling is very, very basic.
21-
22-
### Planned features
23-
24-
- Session expiration
25-
- Logout functionality
18+
Since this is my very first rust project, code may be suboptimal or even insecure to some extent - use at your own risk.
19+
PRs to improve code quality and security are highly appreciated.
2620

2721
## Recommended usage
2822

0 commit comments

Comments
 (0)