Skip to content

Commit

Permalink
Make reading of environment variables case insensitive (#712)
Browse files Browse the repository at this point in the history
* Make reading of environment variables case insensitive

* Update CHANGELOG

Co-authored-by: Paul Sanders <[email protected]>
  • Loading branch information
sanders41 and Paul Sanders authored Jun 27, 2022
1 parent 20128d7 commit 69653f2
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ The types of changes are:
* ### Docs
* Updated the tutorial installation to use main in fidesdemo [#715](https://github.com/ethyca/fidesops/pull/715)

### Fixed
* Make reading of environment variables case insensitive [712](https://github.com/ethyca/fidesops/pull/712)


## [1.6.0](https://github.com/ethyca/fidesops/compare/1.5.3...1.6.0)

Expand Down
8 changes: 4 additions & 4 deletions src/fidesops/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,9 @@ class FidesopsConfig(FidesSettings):
admin_ui: AdminUiSettings

PORT: int
is_test_mode: bool = os.getenv("TESTING") == "True"
hot_reloading: bool = os.getenv("FIDESOPS__HOT_RELOAD") == "True"
dev_mode: bool = os.getenv("FIDESOPS__DEV_MODE") == "True"
is_test_mode: bool = os.getenv("TESTING", "").lower() == "true"
hot_reloading: bool = os.getenv("FIDESOPS__HOT_RELOAD", "").lower() == "true"
dev_mode: bool = os.getenv("FIDESOPS__DEV_MODE", "").lower() == "true"

class Config: # pylint: disable=C0115
case_sensitive = True
Expand All @@ -151,7 +151,7 @@ class Config: # pylint: disable=C0115
f"Startup configuration: reloading = {hot_reloading}, dev_mode = {dev_mode}"
)
logger.warning(
f'Startup configuration: pii logging = {os.getenv("FIDESOPS__LOG_PII") == "True"}'
f'Startup configuration: pii logging = {os.getenv("FIDESOPS__LOG_PII", "").lower() == "true"}'
)

def log_all_config_values(self) -> None:
Expand Down
2 changes: 1 addition & 1 deletion src/fidesops/util/logger.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def factory( # pylint: disable=R0913
func: str = None,
sinfo: str = None,
) -> logging.LogRecord:
env_log_pii: bool = os.getenv("FIDESOPS__LOG_PII") == "True"
env_log_pii: bool = os.getenv("FIDESOPS__LOG_PII", "").lower() == "true"
new_args = args
if not env_log_pii:
new_args = tuple(_mask_pii_for_logs(arg) for arg in args)
Expand Down

0 comments on commit 69653f2

Please sign in to comment.