You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PyMongo's own exceptions can quote parts of a malformed connection string, e.g., InvalidURI: Bad database name "...". FOCA creates its client in foca/database/register_mongodb.py and doesn't catch these errors, so they can reach a startup traceback. If the URI is broken in a way that puts a credential in the quoted part, that credential can appear in the logs.
The risk is limited: it takes a broken URI and access to the logs. It isn't new, and it is separate from the log line of new clients, which #691 fixed (that line runs only after the client was created).
To think through
Catching these errors and replacing their messages would also hide useful messages, e.g., about wrong options, which operators need when they fix a config. Options to weigh:
Replace the message only for errors from parsing the URI, not for those about options, and suppress the chain (raise ... from None).
Redact the known password of the URI in the message, where it can still be told apart in a broken URI.
Leave the behaviour and document it.
Acceptance criteria
A decision on one of these, with reasons.
If the behaviour changes: tests with malformed URIs holding credentials, and with wrong options, whose messages stay useful; docs updated.
Activity