feat: support per-tenant Valkey credentials via LOADER_CACHE_REDIS_USERNAME#1165
feat: support per-tenant Valkey credentials via LOADER_CACHE_REDIS_USERNAME#1165nicacioliveira wants to merge 1 commit intomainfrom
Conversation
…ERNAME Reads LOADER_CACHE_REDIS_USERNAME and passes it as the ioredis username option for ACL-based authentication. No-op when the env var is absent, preserving existing behavior for sites not yet migrated. Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Tagging OptionsShould a new tag be published when this PR is merged?
|
📝 WalkthroughWalkthroughAdd support for Redis username authentication by introducing Changes
Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
runtime/caches/redis.ts (1)
10-155:⚠️ Potential issue | 🟡 MinorCI is failing on formatting; run
deno fmtfor this file before merge.The current diff is functionally fine, but formatting must be fixed to satisfy the pipeline gate.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@runtime/caches/redis.ts` around lines 10 - 155, The file's formatting is out of date; run the Deno formatter to normalize whitespace and line breaks across functions like activeCodec, ensureZstd, _compress, and _decompress and their imports/const blocks. Fix by running `deno fmt` (or your editor's Deno format command) on this file, then commit the formatted changes so the CI formatting check passes. Ensure no other semantic changes are made.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@runtime/caches/redis.ts`:
- Around line 10-155: The file's formatting is out of date; run the Deno
formatter to normalize whitespace and line breaks across functions like
activeCodec, ensureZstd, _compress, and _decompress and their imports/const
blocks. Fix by running `deno fmt` (or your editor's Deno format command) on this
file, then commit the formatted changes so the CI formatting check passes.
Ensure no other semantic changes are made.
Summary
LOADER_CACHE_REDIS_USERNAMEand passes it as the ioredisusernameoption for ACL-based authenticationHow it works
When the deco operator provisions a site namespace, it creates a
valkey-aclSecret injected into the pod with:LOADER_CACHE_REDIS_USERNAME= site name (e.g.minha-loja)LOADER_CACHE_REDIS_PASSWORD= random per-site passwordThe Valkey ACL for that user is restricted to
~minha-loja:*and~lock:minha-loja:*— matching exactly the key prefixes already generated byutils.tsviaDECO_SITE_NAME.This PR should be merged and deployed only after:
Merging before that is safe (env var absent = no-op), but sites won't actually use per-tenant credentials until the operator is live.
🤖 Generated with Claude Code
Summary by cubic
Adds per-tenant Valkey ACL authentication via
LOADER_CACHE_REDIS_USERNAME. If the env var is missing, behavior is unchanged.New Features
usernameonioredisfor Sentinel, direct, and read-replica clients.Migration
decocms/operator#3is deployed, Valkey auth is enabled, and ACL provisioning is validated.Written for commit de8d680. Summary will update on new commits.
Summary by CodeRabbit
Release Notes