Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RedisDsn doesn't support password #2297

Closed
3 tasks done
hardbyte opened this issue Jan 28, 2021 · 2 comments
Closed
3 tasks done

RedisDsn doesn't support password #2297

hardbyte opened this issue Jan 28, 2021 · 2 comments
Labels
bug V1 Bug related to Pydantic V1.X

Comments

@hardbyte
Copy link

Checks

  • I added a descriptive title to this issue
  • I have searched (google, github) for similar issues and couldn't find anything
  • I have read and followed the docs and still think this is a bug

Bug

Ref #1275

Output of python -c "import pydantic.utils; print(pydantic.utils.version_info())":

             pydantic version: 1.7.3
            pydantic compiled: True
                 install path: /home/brian/.cache/pypoetry/virtualenvs/j7nrLfcR-py3.8/lib/python3.8/site-packages/pydantic
               python version: 3.8.5 (default, Jul 28 2020, 12:59:40)  [GCC 9.3.0]
                     platform: Linux-5.4.0-65-generic-x86_64-with-glibc2.29
     optional deps. installed: ['typing-extensions', 'email-validator']

Redis can be configured to require a password but not a user. The pydantic RedisDsn doesn't support this, and can't seem to be tricked by passing user as an empty string or None:

>>> from pydantic import RedisDsn
>>> RedisDsn.build(scheme='redis', user='', password="testpass", host="host", path='')
'redis://host'
>>> RedisDsn.build(scheme='redis', user=None, password="testpass", host="host", path='')
'redis://host'
>>> RedisDsn.build(scheme='redis', password="testpass", host="host", path='')
'redis://host'

Expected behaviour:

>>> from pydantic import RedisDsn
>>> RedisDsn.build(scheme='redis', user='', password="testpass", host="host", path='')
'redis://:testpass@host'
@hardbyte hardbyte added the bug V1 Bug related to Pydantic V1.X label Jan 28, 2021
@PrettyWood
Copy link
Member

Hi @hardbyte
The exact same issue has been opened this morning and answered ;)
Hope it helps!

@hardbyte
Copy link
Author

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug V1 Bug related to Pydantic V1.X
Projects
None yet
Development

No branches or pull requests

2 participants