Skip to content

fix(api): omit Redis auth segment when password is not configured - #1266

Merged
harry0703 merged 1 commit into
harry0703:mainfrom
Mihir7027:fix/redis-url-null-password
Aug 26, 2026
Merged

fix(api): omit Redis auth segment when password is not configured#1266
harry0703 merged 1 commit into
harry0703:mainfrom
Mihir7027:fix/redis-url-null-password

Conversation

@Mihir7027

Copy link
Copy Markdown
Contributor

Summary

  • When redis_password is unset (the default None), the previous f-string
    produced redis://:None@host:port/db — Python's None got stringified verbatim,
    so redis-py sent AUTH None to Redis and failed on every password-less server.
  • Extract a small _build_redis_url() helper that only includes the :password@
    auth segment when a password is actually provided.
  • Covers None, empty string (both produce a no-auth URL), and a real password
    value with unit tests.

Test plan

  • TestBuildRedisUrl.test_no_password_omits_auth_segmentNone and "" both produce redis://localhost:6379/0
  • TestBuildRedisUrl.test_password_is_included_in_url — real password produces correct URL
  • Existing TestVideoControllerTasks and TestRedisTaskManager suites still pass

When redis_password is None (the default), the previous f-string produced
"redis://:None@host:port/db" — the Python None got stringified, so redis-py
sent AUTH None to Redis and failed on any password-less server.

Extract _build_redis_url() to conditionally include the ':password@' auth
segment only when a password is actually set. Tests cover None, empty-string
(both map to no auth) and a real password value.
@harry0703
harry0703 merged commit d82c586 into harry0703:main Aug 26, 2026
3 checks passed
@harry0703

Copy link
Copy Markdown
Owner

Thank you for the fix. I verified it with a real passwordless Redis container, including connection, read/write, and task queue round-trip tests. Everything worked as expected, and the PR has been merged. Appreciate your contribution!

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.

2 participants