Zero-trust auth & traffic policy

Protect internal dashboards and microservice APIs directly at the aditd edge before a single byte crosses the tunnel — using API keys, Bearer JWT / JWKS verification, OIDC / OAuth2 browser login, automatic CORS, body limits, edge mocks, and linear-time WAF filtering.

API key protection

Require a static key in X-Api-Key, Authorization: Bearer, or a custom header. Validated in constant time and stripped before forwarding so the edge secret never leaks to your app:

tunl http 3000 --api-key super-secret-key
tunl http 3000 --api-key X-Internal-Token:super-secret-key

Bearer JWT & JWKS verification

Verify HS256/384/512 tokens with a shared secret, or RS256/ES256/EdDSA tokens against an identity provider's HTTPS JWKS endpoint (Auth0, Keycloak, Clerk, Supabase, Google). Verified principals are injected as X-Tunl-Identity:

tunl http 8080 --jwt-secret my-hmac-secret-key --jwt-iss api.example.com
tunl http 8080 --jwt-jwks-url https://tenant.auth0.com/.well-known/jwks.json --jwt-aud https://api.example.com

OIDC & OAuth2 browser login

When the server operator configures --oidc-issuer, --oidc-client-id, and --oidc-client-secret on aditd, any HTTP tunnel can require interactive browser sign-in with PKCE and email/domain allowlists:

tunl http 3000 --oauth oidc --oauth-allow-domain company.com
tunl http 3000 --oauth github --oauth-allow-email [email protected]

CORS, body size, WAF & edge mock

# Answer CORS preflight OPTIONS at the edge with 204
tunl http 3000 --cors "*"
tunl http 3000 --cors "https://app.example.com,http://localhost:5173"

# Enforce payload caps and linear-time edge WAF
tunl http 3000 --max-body 10m --waf

# Serve a mock response directly from the edge (even with local app offline)
tunl http 3000 --mock '200:{"ok":true,"env":"staging"}'