From 5b7f897029a28d9e3b708c27e02e03f411a5d77f Mon Sep 17 00:00:00 2001 From: Sven Lange Date: Thu, 12 Nov 2026 12:15:22 -0600 Subject: [PATCH] fix(logging): mask the broker password in startup logs The startup log lines printed the full broker URL, which includes the password when the broker requires AUTH. --- src/phlower/app.py | 3 ++- src/phlower/events.py | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/phlower/app.py b/src/phlower/app.py index cdf51b5..b91cd16 100644 --- a/src/phlower/app.py +++ b/src/phlower/app.py @@ -9,6 +9,7 @@ from pathlib import Path from fastapi import FastAPI +from kombu.utils.url import maybe_sanitize_url from fastapi.responses import FileResponse from fastapi.staticfiles import StaticFiles @@ -385,7 +386,7 @@ async def lifespan(app: FastAPI): logger.info( "Phlower started — broker=%s retention=%dh sqlite=%s", - config.broker_url, + maybe_sanitize_url(config.broker_url), config.retention_hours, config.sqlite_path or "disabled", ) diff --git a/src/phlower/events.py b/src/phlower/events.py index f275f40..f28fd29 100644 --- a/src/phlower/events.py +++ b/src/phlower/events.py @@ -9,6 +9,7 @@ from queue import Empty from celery import Celery +from kombu.utils.url import maybe_sanitize_url from .config import Config from .store import Store @@ -165,7 +166,7 @@ def start(self) -> None: ] for thread in self._threads: thread.start() - logger.info("Celery event consumer started (broker=%s)", self.config.broker_url) + logger.info("Celery event consumer started (broker=%s)", maybe_sanitize_url(self.config.broker_url)) def stop(self) -> None: self._stop.set()