Skip to content

Commit

Permalink
Escape redis user and password (#1104)
Browse files Browse the repository at this point in the history
* Escape redis user and password

* Update CHANGELOG

Co-authored-by: Paul Sanders <pau@ethyca.com>
  • Loading branch information
sanders41 and Paul Sanders authored Aug 18, 2022
1 parent 81f8e0a commit 223a765
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ The types of changes are:

* HTTP headers are now preserved in requests generated from SaaS connector pagination [#1069](https://github.com/ethyca/fidesops/pull/1069)
* Bump fideslib to fix issue where the authenticate button in the FastAPI docs did not work [#1092](https://github.com/ethyca/fidesops/pull/1092)
* Escape the Redis user and password to make them URL friendly [#1104](https://github.com/ethyca/fidesops/pull/1104)
* Reduced number of connections opened against app db during health checks [#1107](https://github.com/ethyca/fidesops/pull/1107)

### Changed
Expand Down
3 changes: 2 additions & 1 deletion src/fidesops/ops/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import logging
import os
from typing import Any, Dict, MutableMapping, Optional
from urllib.parse import quote_plus

import toml
from fideslib.core.config import (
Expand Down Expand Up @@ -74,7 +75,7 @@ def assemble_connection_url(
# If the whole URL is provided via the config, preference that
return v

return f"redis://{values.get('user', '')}:{values['password']}@{values['host']}:{values['port']}/{values.get('db_index', '')}"
return f"redis://{quote_plus(values.get('user', ''))}:{quote_plus(values['password'])}@{values['host']}:{values['port']}/{values.get('db_index', '')}"

class Config:
env_prefix = "FIDESOPS__REDIS__"
Expand Down

0 comments on commit 223a765

Please sign in to comment.