Repository navigation
Stop request URLs, and the Telegram bot token in them, reaching the log - #49
Merged
Merged
Conversation
… (the Telegram bot token among them) stop reaching the log
…oken-bearing debug lines and the MCP session-id line; restore logger levels after every test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
dudamel runconfigures the root logger at INFO (DEBUG with--debug). Several third-party loggers print credentials at those levels:INFO:httpx:HTTP Request: POST https://api.telegram.org/bot<token>/getMe ....QUIET_LOGGERSincli.pyholds each at the lowest level that no longer prints the secret, applied even under--debug.Tests:
runandrun --debugdrive a realtelegram.Botconstruction plus real httpx and httpx2 clients (MockTransport) with the token in the URL, captured at DEBUG on the root logger (at caplog's default level the INFO line is never collected and the test would pass with the leak live). Removing any one of the httpx, httpx2 or telegram.Bot entries makes it fail. A second test checks every entry is applied. An autouse conftest fixture restores those logger levels after each test, since several existing tests driverun.1170 tests pass; ruff check and format clean.