| Crates.io | proxyauth |
| lib.rs | proxyauth |
| version | 0.8.8 |
| created_at | 2025-04-24 05:38:27.784614+00 |
| updated_at | 2025-08-24 17:47:55.685843+00 |
| description | Universal Proxy Authentication |
| homepage | |
| repository | https://github.com/ProxyAuth/ProxyAuth |
| max_upload_size | |
| id | 1646666 |
| size | 517,921 |
💣 ProxyAuth is now a universal reverse proxy system, capable of handling authentication and access control for any backend application or dashboard.
ProxyAuth secures backend APIs/Dashboard through a fast authentication gateway. It encrypts tokens using ChaCha20 + HMAC-BLAKE3, with config-defined secrets. It features built-in rate limiting (on proxy and auth routes) and uses Argon2 with auto-generated salts for secure password hashing. The service is extremely fast, handling ~ 180,000+ requests per second under load.
Views the documentation
Possible to contribute the documentation: ProxyAuth Docs :heart:
Please enter your password in config.json. The application will automatically generate the Argon2 salt on first startup and rewrite the file with the hashed password.
Configuration file
routes:
- prefix: "/redoc"
target: "http://127.0.0.1:8000/redoc"
secure: false
- prefix: "/api_test/openapi.json"
target: "http://localhost:8000/api_test/openapi.json"
secure: false
- prefix: "/api_test"
target: "http://localhost:8000/api_test"
username: ["admin", "alice1", "alice15", "alice30"]
proxy: true/false # --> configure proxy
proxy_config: "http://myproxyurl:8888" # --> pass via proxy for call the target.
cert: {"file": "certificat.pk12", "password": "1234"} # /!\ this fonctionnality is experimental untested version 0.5.0 /!\
{
"token_expiry_seconds": 3600,
"secret": "supersecretvalue",
"host": "127.0.0.1",
"port": 8080,
log: {"type": "local"}, --> use for loki {"type": "loki", "host": "http://host_loki:port"}
"ratelimit_proxy": {
"burst": 100,
"block_delay": 500,
"requests_per_second": 10
},
"ratelimit_auth": {
"burst": 10,
"block_delay": 500,
"requests_per_second": 10
},
"worker": 4,
"users": [
{ "username": "admin", "password": "admin123" },
{ "username": "bob", "password": "bobpass" },
{ "username": "alice1", "password": "alicepass" }
]
}
curl -fsSL https://proxyauth.app/sh/install | bash
curl -fsSL https://proxyauth.app/sh/uninstall | bash
sudo systemd start proxyauth
docker compose build
docker compose up -d
Change configuration on docker-compose.yml overwrite configuration
volumes:
- ./config/config.json:/app/config/config.json
- ./config/routes.yml:/app/config/routes.yml
restart container
docker compose restart
tracing (Rust log lib) [still being deployed]If someone can reverse-engineer the hash, they could potentially access services. This is why you must define a secure secret (over 64 characters!) in the config. This method is used in Django for password hashing via PBKDF2: https://docs.djangoproject.com/en/5.1/ref/settings/#std-setting-SECRET_KEY
The server behaves like an authentication proxy.
Refresh token route:
sequenceDiagram
autonumber
participant C as Client
participant P as ProxyAuth
C->>+P: POST http://127.0.0.1:8080/auth<br>-H "Content-Type: application/json"<br>-d {"username": "user", "password": "pass"}
P->>+P: Check credential
P->>+C: return json format <br>{"expires_at":"2025-04-12 16:15:20","token":"4GJeCUwOzILd..."}
sequenceDiagram
autonumber
participant C as Client
participant P as ProxyAuth
participant A as API/Service
C->>+P: Send token Header <br> -X POST http://127.0.0.1:8080/api -H "Content-Type: application/json" <br>-H "Authorization: Bearer UmbC0ZgATdXE..." -d {"data": "test"}
P->>+P: Check token send by client
P->>+A: Forward original request <br> POST http://192.168.1.80/api_test <br>-H "Content-Type: application/json" <br>-d {"data": "test"}
A-->>-P: Response
P-->>-C: Response
sequenceDiagram
autonumber
participant C as Client
participant P as ProxyAuth
participant E as API/Service
C->>+P: Send token Header<br> -H "Authorization: Bearer UmbC0ZgATdXE..."
P->>+P: Check token send by client
P-->>-C: Invalid Token
Note over E: No external request made
This application allows applying global authentication tokens to any application, removing the need for them to implement token validation themselves, which simplifies future development.