feat: add --debug flag for HTTP request/response logging with credential redaction#80
Merged
deviantintegral merged 6 commits intomainfrom Mar 11, 2026
Merged
Conversation
…tion Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Add a shared HTTP logging module (_http_logging.py) with credential redaction utilities. Restructure CLI flags so --verbose maps to INFO level and the new --debug flag maps to DEBUG level (default remains WARNING). Promote key auth lifecycle and request summary messages from DEBUG to INFO so --verbose produces useful output. - Add _http_logging.py with redact_headers, redact_body, log_request, log_response - Make --verbose and --debug mutually exclusive in argparse - Change run_tui() signature from verbose: bool to log_level: int - Promote client.py request summary and auth.py lifecycle messages to INFO Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Wire the shared _http_logging module into client.py._request for full HTTP request/response tracing at DEBUG level. Migrate b2c_login.py to use the shared log_request/log_response helpers instead of its local copies, ensuring consistent credential redaction across all HTTP calls. - client.py._request now logs redacted headers and response bodies - b2c_login.py local _log_request/_log_response removed - Add comprehensive tests for _http_logging module (23 tests) - Update b2c_login and client test assertions Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Make redact_body match sensitive keys like "password" regardless of casing (e.g. "Password", "PASSWORD") to match how redact_headers already works for header names. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
7db3fea to
3cb30a4
Compare
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.
Summary
--debugflag for full HTTP request/response tracing at DEBUG level with credential redaction--verboseto map to INFO level (was DEBUG), showing request summaries and auth lifecycle_http_logging.pymodule withredact_headers,redact_body,log_request,log_responseb2c_login.pyto shared HTTP logging helpers (removes local duplicates)client.pyandauth.pymessages from DEBUG to INFO for--verbosevisibilityDetails
--verboseand--debugare mutually exclusive via argparseBearerprefix), Cookie, Set-Cookie, X-CSRF-TOKEN headers, andpasswordin form datarun_tui()signature changed fromverbose: booltolog_level: int_http_loggingmodule; all 1230 tests passTest plan
ruff checkpassesmypy --strictpassestest_http_logging.pycovers redaction, logging, and client integration🤖 Generated with Claude Code