[P1/mid] fix(server_remote): replace print() with logging to clear CodeQL py/clear-text-logging-sensitive-data - #281
Conversation
…lear-text-logging-sensitive-data
All 13 server_remote tests pass (converted from capsys to caplog). Full
suite: 574 passed, 1 pre-existing env-only failure (mnemon_ops.sh
script path).
Closes nousergon/alpha-engine-config#4356
Co-Authored-By: Claude <noreply@anthropic.com>
Refactor AuthorizationServerConfig.validate() to not access self.passphrase — moves passphrase validation into a separate @staticmethod that takes only non-sensitive metadata (bool + int), so CodeQL's py/clear-text-logging data-flow analysis can see no password-classified data reaches the logger.error() sink. Also removes passphrase-length disclosure from the error message ("minimum 16 chars" instead of "X chars, minimum 16"). Closes nousergon/alpha-engine-config#4356 Co-Authored-By: Claude <noreply@anthropic.com>
|
🚫 Blocked-by: nousergon/alpha-engine-config#4943
|
The PR split validate() into validate() (non-passphrase checks) and validate_passphrase() (passphrase-only, signature avoids value flowing through log paths). The tests were still calling validate() for passphrase assertions — updated to call validate_passphrase() instead. - test_enabled_requires_public_url_and_passphrase: checks both methods - test_short_passphrase_rejected: uses validate_passphrase() - test_exactly_16_char_passphrase_accepted: uses validate_passphrase() Co-Authored-By: Claude <noreply@anthropic.com>
mcp>=1.27 resolved to mcp-2.0.0 which removed mcp.server.fastmcp, breaking server.py and all tests that import from it (test_server.py, test_server_proxy.py, test_tools_integration.py). Pin to <2.0.0 until the migration to mcp v2 APIs is done. Co-Authored-By: Claude <noreply@anthropic.com>
|
🔓 Dependency resolved — every referenced dependency (nousergon/alpha-engine-config#4943) is now closed/merged, so |
|
⏳ This PR has had merge conflicts in 13 consecutive sweep cycles. After 3 cycles it will be escalated (draft + gate:dependency + tracked issue). |
|
🚫 Blocked-by: nousergon/alpha-engine-config#5616
|
…4356-clear-text-logging # Conflicts: # pyproject.toml
|
Merge conflict resolved + gate verification (from alpha-engine-config#5616). Resolved the merge conflict by merging Verification that the
Flipping ready for review and removing the now-satisfied |
Priority: P1 · Complexity: mid
Closes nousergon/alpha-engine-config#4356
Problem
CodeQL alert
py/clear-text-logging-sensitive-dataonsrc/mnemon/server_remote.py— the file usedprint(file=sys.stderr)for all operational logging. Exception messages ({e}in f-strings) could theoretically propagate sensitive data through the log stream, and the pattern prevented structured log level control.Root-cause fix
Replaced all 11
print(file=sys.stderr, ...)calls with appropriatelogging.info()/logging.warning()/logging.error()calls via Python's standardloggingmodule, consistent with every other source file in the project (server.py,auth.py,store.py, etc.).Updated test assertions from
capsys(stderr capture) tocaplog(log capture).Validation
test_server_remote.pytests passtest_mnemon_ops.py:mnemon_ops.shscript path not found on this runner)