Files
floci/src/main/java
Priamo Germosen d1892e18a1 refactor(elasticache,memorydb): extract shared auth-proxy logic into a common base class (#3574)
ElastiCacheAuthProxy and MemoryDbAuthProxy each implemented their own copy of the
RESP AUTH handshake, accept loop, and client/backend relay, ~87 duplicated lines
flagged by CPD. MemoryDB's proxy is modeled on ElastiCache's (same wire protocol,
same IAM-auth mechanism), so both now extend AbstractRedisAuthProxy, which owns
the shared accept/handshake/relay plumbing behind two small hooks (authRequired,
authenticate) that each subclass implements against its own validators. No
behavior change: closeQuietly stays per-subclass since the two implementations
genuinely differ (ElastiCache shuts down the socket's output side and logs at
debug; MemoryDB just closes), and every other extracted method reproduces the
original logic byte for byte.

Also adds integration coverage for a path that existed before this refactor but
had no automated test either way: a client that sends an explicit AUTH command
on a connection where auth isn't required must still get +OK and stay usable,
rather than being rejected.
2026-09-13 21:05:04 -05:00
..