Redact SmbConfig password and centralize default SMB port - #117
Conversation
in-jun
left a comment
There was a problem hiding this comment.
Both fixes look correct and complete.
#77 — password redaction: The custom toString() covers exactly the constructor properties in declaration order and matches the default data-class format, so the only behavioral change is masking password. Since SmbConfig is the sole RemoteConfig implementor holding a secret and SyncPair's auto-generated toString() delegates to remote.toString(), both the direct-config and enclosing-pair leak paths described in the issue are now closed. equals/hashCode are untouched, so the withoutSecrets() equality semantics still hold. The empty-password case rendering password= (rather than ***) is fine — there's no secret to leak there.
#83 — centralized default: DEFAULT_PORT = 445 is referenced from all four production fallback sites (SetupScreen seed + build, ConfigRepository JSON parse + legacy migration) plus the constructor default. The remaining literal in SmbRemoteStorageIntegrationTest is test-only configuration and correctly out of scope.
No regressions or scope creep. LGTM.
Two small hardening/hygiene fixes to SmbConfig and its call sites.
Fixes #77
Fixes #83