diff --git a/doc/release_notes.md b/doc/release_notes.md index 2ae4865c82..013a6f592d 100644 --- a/doc/release_notes.md +++ b/doc/release_notes.md @@ -51,6 +51,8 @@ * Add validation of Zenodo deposition ID in `create_zenodo_deposition_cli` to close URL-manipulation finding ([#780](https://github.com/open-energy-transition/open-tyndp/pull/780)). +* Prevent `create_zenodo_deposition_cli` from leaking secrets in logs under `--debug` by scoping debug logging to the local logger instead of the root logger ([#781](https://github.com/open-energy-transition/open-tyndp/pull/781)). + ## Upcoming PyPSA-Eur Release * Security: SBOM security scan included in CI. diff --git a/utils/create_zenodo_deposition_cli.py b/utils/create_zenodo_deposition_cli.py index 27002b9f0e..99af1d5e00 100644 --- a/utils/create_zenodo_deposition_cli.py +++ b/utils/create_zenodo_deposition_cli.py @@ -458,6 +458,9 @@ def main( """ Guide the user through creating a new Zenodo deposition or version. """ + # Set the global logging level + logging.basicConfig(level=logging.INFO) + global ZENODO_API_URL ZENODO_API_URL = API_URLS["sandbox"] if sandbox else API_URLS["production"] @@ -469,7 +472,8 @@ def main( fg=typer.colors.YELLOW, ) if debug: - logging.basicConfig(level=logging.DEBUG) + # change local logger level to debug + logger.setLevel(logging.DEBUG) typer.secho("Debug mode enabled.", fg=typer.colors.YELLOW) typer.secho("=" * 80, fg=typer.colors.CYAN)