Skip to content

perf(auth): enforce session revocation with short-ttl in-memory cache…#8

Merged
AlpNuhoglu merged 1 commit into
mainfrom
perf/matchmaking-presence-io-batching
Jun 23, 2026
Merged

perf(auth): enforce session revocation with short-ttl in-memory cache…#8
AlpNuhoglu merged 1 commit into
mainfrom
perf/matchmaking-presence-io-batching

Conversation

@AlpNuhoglu

Copy link
Copy Markdown
Owner

… decorator

  • Implemented structural typing SessionChecker interface in middleware to decouple auth from internal/player.
  • Created a thread-safe cachedSessionStore decorator using sync.RWMutex and a background janitor worker.
  • Connected the revocation check directly into the gateway's auth middleware path with a fail-closed strategy.
  • Injected standard Redis client initialization and tracing instrumentation into cmd/gateway/main.go.
  • Verified with dynamic -race and integration tests ensuring 0-RTT on cache hits and predictable 5s TTL eviction.

… decorator

- Implemented structural typing `SessionChecker` interface in middleware to decouple auth from internal/player.
- Created a thread-safe `cachedSessionStore` decorator using sync.RWMutex and a background janitor worker.
- Connected the revocation check directly into the gateway's auth middleware path with a fail-closed strategy.
- Injected standard Redis client initialization and tracing instrumentation into cmd/gateway/main.go.
- Verified with dynamic -race and integration tests ensuring 0-RTT on cache hits and predictable 5s TTL eviction.
@AlpNuhoglu AlpNuhoglu merged commit 5841a44 into main Jun 23, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant