Skip to content

Support Redis Unix sockets - #2810

Open
jorge-barroso wants to merge 5 commits into
simple-login:masterfrom
jorge-barroso:fix/redis-unix-socket
Open

jorge-barroso wants to merge 5 commits into
simple-login:masterfrom
jorge-barroso:fix/redis-unix-socket

Conversation

@jorge-barroso

@jorge-barroso jorge-barroso commented Sep 13, 2026

Copy link
Copy Markdown

I self-host it and wanted to connect to Redis over a Unix socket for filesystem-based access control and one less TCP listener. Since the pinned limits version already supports this, I thought it would be useful to contribute the small change here too.

This PR accepts redis+unix:// URLs during Redis service initialization, without changing any dependencies. It adds tests covering sessions, concurrency locks and rate limiting, including Flask-Limiter. The tests use the existing Redis instance and the contributor instructions and CI setup now account for both TCP and socket connections.

The full suite passed with Python 3.12.8 and the unchanged lockfile: 936 passed, 1 skipped, using Redis 6.2.16. After adjusting the tests to use a shared instance, all nine Redis tests also passed against Valkey on Arch Linux. The revised CI setup still needs validation on GitHub but it's just a manual way to trigger the same action, just adding the socket exposure.

First time contributing to this project so I'm happy to tweak anything to better fit how you’d like this handled 🙂

Accept redis+unix URLs in Redis service initialization, using the existing limits adapter for sessions, concurrency locks and bucket limits. Document configuration and add initialization and real Unix socket regression tests, including Flask-Limiter enforcement.

Validated with Python 3.12.8 and unchanged uv.lock dependencies (limits 4.0.1, redis 5.2.1): 936 passed, 1 skipped using Redis 6.2.16. The five Unix socket regression cases fail against the original initializer.
Jorge Barroso and others added 4 commits September 14, 2026 17:10
Follow the existing test setup by requiring a running Redis service over TCP and a Unix socket. Remove per-test server startup and automatic skips, and isolate rate-limit keys for repeatable runs against shared Redis.

Configure the single Redis 6 CI container with both listeners and document the socket prerequisite. Nine focused tests pass against Arch Valkey with the pinned Python environment; lint and formatting checks pass.
Match the original action's direct container launch without adding a readiness loop. Retain the shared socket mount, runner ownership and disabled snapshots for the ephemeral test container.
@jorge-barroso
jorge-barroso marked this pull request as ready for review September 14, 2026 22:32
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