Skip to main content

IP Binding

When an API token is created, Enver records the IP address of the request. Every subsequent request using that token is validated against the stored IP. A stolen token cannot be used from a different machine.

How it works

IP source headers

The middleware reads the IP from these headers in order:
  1. x-forwarded-for (set by reverse proxies / load balancers)
  2. x-real-ip (set by Nginx)
  3. Falls back to "unknown"

Known edge cases

Best practices

  • Create dedicated tokens per machine / CI runner
  • Use short TTL (ttlDays: 7) for short-lived jobs
  • Revoke tokens immediately if a machine is decommissioned or compromised