IBEX Harness
DocsBenchmarksBlogChangelogRoadmap
GitHub
IBEX Harness

Documentation

OverviewConfigurationAuthenticationAuth cachingDirectivesSessionsRate limitingRequest routingProvider adapters
Proxy›Auth caching
Proxy

Auth caching

Bloom filter + LRU auth cache with Redis revocation propagation.

New Auth caching is shipped (milestone 2.2.1). Successful ValidateToken results may be cached on the proxy behind a bloom filter + LRU, but only when a working Redis revocation channel is available.

Design: ADR-0028, ADR-0029.

Safety gate

The proxy will not wrap the auth validator with a cache unless:

  1. IBEX_AUTH_CACHE_ENABLED=true (default), and
  2. REDIS_URL is set, and
  3. Redis PING succeeds at startup.

Otherwise it logs auth cache disabled; revocation channel unavailable and calls auth gRPC on every request. Skipping the cache never weakens fail-closed auth.

Hot path

Mermaid diagram: flowchart TD
+--------------------------+                                                        
|                          |                                                        
|        Bearer PAT        |                                                        
|                          |                                                        
+--------------------------+                                                        
              |                                                                     
              |                                                                     
              |                                                                     
              |                                                                     
              v                                                                     
<-------------------------->                                                        
|                          |                                                        
|  Bloom: known-invalid?   |----------------+                                       
|                          |                |                                       
<-------------------------->               no                                       
              |                             |                                       
             yes                            |                                       
              |                             |                                       
              |                             |                                       
              v                             v                                       
+--------------------------+     <-------------------->                             
|                          |     |                    |                             
|       401 invalid        |  +--|      LRU hit?      |                             
|                          |  |  |                    |                             
+--------------------------+  |  <-------------------->                             
                              |             |                                       
                              |            no                                       
             yes--------------+             |                                       
              |                             |                                       
              v                             v                                       
+--------------------------+     +--------------------+                             
|                          |     |                    |                             
| Allow with cached claims |  +--| ValidateToken gRPC |-----------------+           
|                          |  |  |                    |                 |           
+--------------------------+  |  +--------------------+            unavailable      
                              |             |                           |           
                              |          invalid                        |           
             ok---------------+             |                           |           
              |                             |                           |           
              v                             v                           v           
+--------------------------+     +--------------------+     +----------------------+
|                          |     |                    |     |                      |
|       Store in LRU       |     | Add token to bloom |     | 503 SERVICE_DEGRADED |
|                          |     |                    |     |                      |
+--------------------------+     +--------------------+     +----------------------+

Revocation

SideBehavior
AuthAfter durable revoke, PUBLISH to ibex:token:revocations
ProxySUBSCRIBE; invalidate LRU entry by token UUID

Event schema v1: {v, token_id, org_id, revoked_at}. If auth has no Redis URL it uses a Noop publisher (local-only revoke until caches expire by TTL).

Configuration

VariableDefaultRole
IBEX_AUTH_CACHE_ENABLEDtrueMaster switch
IBEX_AUTH_CACHE_LRU_CAPACITY5000Max cached tokens
IBEX_AUTH_CACHE_LRU_MAX_TTL30sMax entry lifetime
IBEX_AUTH_CACHE_BLOOM_EXPECTED_ITEMS10000Bloom sizing
IBEX_AUTH_CACHE_BLOOM_FP_RATE0.001Bloom false-positive rate
REDIS_URL(required for wrap)Revocation channel + Ping gate

Auth also needs REDIS_URL to publish revokes promptly.

Fail-closed interaction

ConditionHTTP
Auth gRPC down / timeout503 SERVICE_DEGRADED / AUTH_UNAVAILABLE
Cached invalid / bloom hit401
Redis down at startupCache not wrapped; every request hits gRPC (still fail-closed on auth outage)

Where to look in the repo

  • packages/authcache — bloom + LRU validator wrapper
  • packages/revocation — channel constants and Redis pub/sub helpers
  • services/proxy/internal/bootstrap/redis.go — enablement gate
  • services/auth/internal/service/token_service.go — publish after revoke

Related docs

  • Proxy authentication
  • Security authentication
  • Issuing API keys
  • Roadmap findings — supersession of the old deferral note

Was this page helpful?

Edit on GitHub

Last updated on

PreviousAuthenticationNextDirectives

On this page

  • Safety gate
  • Hot path
  • Revocation
  • Configuration
  • Fail-closed interaction
  • Where to look in the repo
  • Related docs
0%