Skip to content

Commit 9bdaaca

Browse files
Potential fix for code scanning alert no. 17: Clear-text storage of sensitive information
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent a427cd6 commit 9bdaaca

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

core/pygeoapi.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,15 @@ def _write_config(path: Path) -> None:
4242
port = os.environ.get("POSTGRES_PORT", "5432")
4343
dbname = os.environ.get("POSTGRES_DB", "postgres")
4444
user = (os.environ.get("POSTGRES_USER") or "").strip()
45-
password = os.environ.get("POSTGRES_PASSWORD", "")
4645
template = _template_path().read_text(encoding="utf-8")
4746
config = template.format(
4847
server_url=_server_url(),
4948
postgres_host=host,
5049
postgres_port=port,
5150
postgres_db=dbname,
5251
postgres_user=user,
53-
postgres_password=password,
52+
# Avoid storing the actual password in clear text; resolve from env at runtime.
53+
postgres_password="${POSTGRES_PASSWORD}",
5454
)
5555
path.write_text(config, encoding="utf-8")
5656

0 commit comments

Comments
 (0)