tenants:
- name: "my-app"
path_prefix: "/api/"
lua_script: |
-- Custom authentication
if not check_api_key(request.headers["X-API-Key"]) then
return reject(401, "Unauthorized")
end
-- Rate limiting
if rate_limit_exceeded(client_ip, 100) then
return reject(429, "Too Many Requests")
end
Entwickelt für KMUs, die moderne Infrastruktur brauchen – ohne Komplexität.
Automatische Weiterleitung nur an gesunde Backends. Null Downtime durch intelligente Failover-Logik.
Pro Mandant eigene Routen und Services. Perfekt für Agenturen mit mehreren Kunden.
Kein komplizierter JSON oder Caddyfile. Einfach, lesbar, git-versionierbar.
Blitzschnell, ressourcenschonend, single binary. Läuft überall ohne Dependencies.
Prometheus-Export, Grafana-ready. Detaillierte Performance-Überwachung out of the box.
Alpine-basiert, optimiert, production-ready. Einfache Deployment-Strategien.
Mit der integrierten Lua Engine wird Keystone Gateway zur programmierbaren Infrastruktur. Schreibe Custom Logic direkt in der Konfiguration – ohne externe Dependencies.
JWT-Validierung, API-Key-Checks, OAuth-Flows – alles in Lua.
Intelligente Rate Limits pro Client, IP oder API-Key.
Headers manipulieren, Payloads transformieren, Routing-Logic.
-- JWT Token Validation function validate_jwt(token) local payload = jwt.decode(token, secret_key) if payload.exp < os.time() then return false, "Token expired" end return true, payload end -- Custom Rate Limiting function rate_limit(client_ip, limit) local current = redis.get(client_ip) or 0 if current >= limit then return false end redis.incr(client_ip, 60) -- 60s TTL return true end -- Main Request Handler local auth_header = request.headers["Authorization"] local valid, payload = validate_jwt(auth_header) if not valid then return reject(401, "Unauthorized") end if not rate_limit(client_ip, 100) then return reject(429, "Too Many Requests") end -- Add custom headers request.headers["X-User-ID"] = payload.user_id request.headers["X-Tenant"] = payload.tenant
Ein Docker-Command und du bist ready to go.
Bearbeite configs/gateway.yaml
nach deinen Bedürfnissen.
Gateway läuft auf localhost:8080