Skip to content

refactor: drop dead MQTT/FTPS leftovers and unify pin + redaction - #110

Merged
DLANSAMA merged 1 commit into
mainfrom
refactor/aaa-pr1-cleanup
Aug 13, 2026
Merged

refactor: drop dead MQTT/FTPS leftovers and unify pin + redaction#110
DLANSAMA merged 1 commit into
mainfrom
refactor/aaa-pr1-cleanup

Conversation

@DLANSAMA

@DLANSAMA DLANSAMA commented Aug 13, 2026

Copy link
Copy Markdown
Owner

AAA stack 1/9. Base: main (includes #108).

Dead-code and unification pass. No behaviour change for a working printer.

  • Drop unused MQTT PEM / _TRUSTED_CERT_FILE leftovers
  • Delete the unused FTPS connection pool; get_ftp_client closes instead of quit
  • Single fingerprint normalizer: tlspin.normalize_fingerprint
  • emit_json uses jsonio.redact_url_credentials instead of a second copy
  • Fix the tautological assert_shape helper

Stack (merge in order):

  1. refactor: drop dead MQTT/FTPS leftovers and unify pin + redaction #110 this
  2. fix: make the camera streamer opt-in and move snapshot out of protocols #111 snapshot / streamer opt-in
  3. refactor: split MQTT into tls/cmd/print/monitor and pin via SSLContext #112 MQTT split + PinningSSLContext
  4. refactor: emit --json through contracts; stop flattening status #113 contracts / unflatten status
  5. fix: reuse one MQTT TLS session for TUI dashboard and monitor #114 TUI MQTT session reuse
  6. fix: run the TUI on Textual 8 and drop Python 3.9 #115 Textual 8 + drop 3.9
  7. test: stop stubbing paho in sys.modules #116 stop stubbing paho
  8. refactor: commands raise; cli.main is the sole error emitter #117 sole error path
  9. fix: size_verified, leftover contracts, and extras on raised errors #118 size_verified + leftover contracts

Local gates on the full stack: ruff, mypy, bandit, layers, schemas, pytest -W error::ResourceWarning -m "not live" — 1436 passed, 88.91% coverage.

Remove the unused PEM exporter and trusted-cert global from mqtt.py, and
delete the FTPS connection pool that only doctor used. Every FTP caller
now goes through BambuPrinter.get_ftp_client, which closes instead of
quit() so Bambu's hanging control-channel shutdown cannot stall teardown.

Fingerprint normalization has one implementation (tlspin); config and
context delegate. emit_json uses jsonio.redact_url_credentials, so
credential URLs lose userinfo instead of the weaker ***@ form.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant