Skip to content

Update Redis ACL examples for auth server#4675

Merged
tgrunnagle merged 1 commit intomainfrom
fix-redis-acl-examples_2026-04-08
Apr 8, 2026
Merged

Update Redis ACL examples for auth server#4675
tgrunnagle merged 1 commit intomainfrom
fix-redis-acl-examples_2026-04-08

Conversation

@tgrunnagle
Copy link
Copy Markdown
Contributor

Summary

The Redis ACL examples in the repo were missing commands that the auth server actually uses, which would cause runtime permission errors for upstream token storage and user creation flows. This audits pkg/authserver/storage/redis.go against the documented ACL entries and adds the missing commands.

Changes

File What changed
examples/operator/redis-storage/sentinel-service.yaml Added +PEXPIRE +PTTL +MGET to the example ACL entry
docs/redis-storage.md Added +SETNX +PEXPIRE +PTTL +MGET +EVALSHA to the ACL example and updated the security note prose to list all required commands

Missing commands and why they're needed

Command Used by
SETNX CreateUser, CreateProviderIdentity — atomic check-and-set for uniqueness
PEXPIRE storeUpstreamTokensScript Lua script — millisecond-precision TTL on index sets
PTTL storeUpstreamTokensScript Lua script — checks remaining TTL before extending
MGET GetAllUpstreamTokens — batch fetch of all provider tokens for a session
EVALSHA All Lua scripts after first execution — Redis caches the script and runs by SHA

Type of change

  • Documentation

The Redis ACL examples in the repo were missing commands that the auth server actually uses, which would cause runtime permission errors for upstream token storage and user creation flows. This audits `pkg/authserver/storage/redis.go` against the documented ACL entries and adds the missing commands.

## Changes

| File | What changed |
|------|-------------|
| `examples/operator/redis-storage/sentinel-service.yaml` | Added `+PEXPIRE +PTTL +MGET` to the example ACL entry |
| `docs/redis-storage.md` | Added `+SETNX +PEXPIRE +PTTL +MGET +EVALSHA` to the ACL example and updated the security note prose to list all required commands |

## Missing commands and why they're needed

| Command | Used by |
|---------|---------|
| `SETNX` | `CreateUser`, `CreateProviderIdentity` — atomic check-and-set for uniqueness |
| `PEXPIRE` | `storeUpstreamTokensScript` Lua script — millisecond-precision TTL on index sets |
| `PTTL` | `storeUpstreamTokensScript` Lua script — checks remaining TTL before extending |
| `MGET` | `GetAllUpstreamTokens` — batch fetch of all provider tokens for a session |
| `EVALSHA` | All Lua scripts after first execution — Redis caches the script and runs by SHA |
@tgrunnagle tgrunnagle requested a review from jhrozek April 8, 2026 15:03
@tgrunnagle tgrunnagle requested a review from JAORMX as a code owner April 8, 2026 15:03
@github-actions github-actions bot added the size/XS Extra small PR: < 100 lines changed label Apr 8, 2026
@codecov
Copy link
Copy Markdown

codecov bot commented Apr 8, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 68.84%. Comparing base (8b8412b) to head (813f33d).
⚠️ Report is 3 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #4675   +/-   ##
=======================================
  Coverage   68.84%   68.84%           
=======================================
  Files         509      509           
  Lines       52668    52668           
=======================================
+ Hits        36259    36261    +2     
+ Misses      13606    13603    -3     
- Partials     2803     2804    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@tgrunnagle tgrunnagle merged commit b373dc6 into main Apr 8, 2026
89 of 93 checks passed
@tgrunnagle tgrunnagle deleted the fix-redis-acl-examples_2026-04-08 branch April 8, 2026 17:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/XS Extra small PR: < 100 lines changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants