Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

[#1393] Update Fidesops config with sane defaults where necessary #1395

Merged
merged 14 commits into from
Sep 29, 2022
Prev Previous commit
Next Next commit
use .get() in assemble URL for correct error message, correct comment
Sean Preston committed Sep 28, 2022
commit 0d3c124609e6e21c114538883676cc3fe4caa6df
4 changes: 2 additions & 2 deletions src/fidesops/ops/core/config.py
Original file line number Diff line number Diff line change
@@ -78,7 +78,7 @@ def assemble_connection_url(
# If the whole URL is provided via the config, preference that
return v

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

class Config:
env_prefix = "FIDESOPS__REDIS__"
@@ -173,7 +173,7 @@ class FidesopsConfig(FidesSettings):

# Pydantic doesn't initialise subsections automatically if
# only environment variables are provided at runtime. If the
# subsection class is instantiated with no args, Pydantic runs
# config subclass is instantiated with no args, Pydantic runs
# validation before loading in environment variables, which
# always fails if any config vars in the subsection are non-optional.
# Using the empty dict allows Python to load in the environment