1
0
Fork 0

Update JWT Validator examples and documentation with key generation steps

- Updated `docker-compose-jwt-validator.yml` to reference `generate-keys.sh` for key generation.
- Revised plugin documentation to include detailed steps for generating JWT keys directly.
- Simplified configuration instructions to improve clarity and consistency.
This commit is contained in:
Joao Gilberto Magalhaes 2025-12-04 10:33:38 -05:00
parent e1d2cb3b59
commit 0add881a87
3 changed files with 15 additions and 8 deletions

View file

@ -15,6 +15,14 @@ The JWT Validator plugin validates JWT (JSON Web Token) authentication tokens us
Protect APIs and services with JWT authentication without needing application-level code. Protect APIs and services with JWT authentication without needing application-level code.
## Generating JWT Keys
```bash
# Generate RSA key pair (idempotent - skips if exists)
[ -f jwt_private.pem ] || openssl genrsa -out jwt_private.pem 2048
[ -f jwt_pubkey.pem ] || openssl rsa -in jwt_private.pem -pubout -out jwt_pubkey.pem
```
## Configuration Options ## Configuration Options
| Option | Description | Default | | Option | Description | Default |

View file

@ -10,9 +10,8 @@
# #
# REQUIREMENTS (run these first): # REQUIREMENTS (run these first):
# ```bash # ```bash
# # Generate RSA key pair (idempotent - skips if exists) # # Generate SSL certificates and JWT keys (from project root)
# [ -f jwt_private.pem ] || openssl genrsa -out jwt_private.pem 2048 # cd ../.. && ./examples/generate-keys.sh && cd examples/docker
# [ -f jwt_pubkey.pem ] || openssl rsa -in jwt_private.pem -pubout -out jwt_pubkey.pem
# #
# # Add to /etc/hosts (idempotent) # # Add to /etc/hosts (idempotent)
# grep -q "api.local" /etc/hosts || echo "127.0.0.1 api.local" | sudo tee -a /etc/hosts # grep -q "api.local" /etc/hosts || echo "127.0.0.1 api.local" | sudo tee -a /etc/hosts

View file

@ -12,12 +12,12 @@
# #
# REQUIREMENTS (run these first): # REQUIREMENTS (run these first):
# ```bash # ```bash
# # Generate JWT keys (idempotent - skips if exists) # # Generate SSL certificates and JWT keys (from project root)
# [ -f jwt_private.pem ] || openssl genrsa -out jwt_private.pem 2048 # cd ../.. && ./examples/generate-keys.sh && cd examples/docker
# [ -f jwt_pubkey.pem ] || openssl rsa -in jwt_private.pem -pubout -out jwt_pubkey.pem
# #
# # Download Cloudflare IPs (idempotent - overwrites if exists) # # Download Cloudflare IPs (idempotent - overwrites if exists)
# curl -s https://www.cloudflare.com/ips-v4 > cloudflare_ips.lst # curl -s https://www.cloudflare.com/ips-v4 > cloudflare_ips.lst
# echo "" >> cloudflare_ips.lst
# curl -s https://www.cloudflare.com/ips-v6 >> cloudflare_ips.lst # curl -s https://www.cloudflare.com/ips-v6 >> cloudflare_ips.lst
# #
# # Add to /etc/hosts (idempotent) # # Add to /etc/hosts (idempotent)
@ -133,6 +133,6 @@ services:
# IP whitelist only (strictest security) # IP whitelist only (strictest security)
easyhaproxy.http.plugins: ip_whitelist easyhaproxy.http.plugins: ip_whitelist
# Only allow local and private networks # Only allow local and private networks (including Docker bridge)
easyhaproxy.http.plugin.ip_whitelist.allowed_ips: 127.0.0.1,192.168.0.0/16,10.0.0.0/8 easyhaproxy.http.plugin.ip_whitelist.allowed_ips: 127.0.0.1,192.168.0.0/16,10.0.0.0/8,172.16.0.0/12
easyhaproxy.http.plugin.ip_whitelist.status_code: 403 easyhaproxy.http.plugin.ip_whitelist.status_code: 403