security: reject unknown OAuth connection authority fields - #339
security: reject unknown OAuth connection authority fields#339seonghobae wants to merge 105 commits into
Conversation
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: trueThanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
Owner refresh — 2026-09-06 KST Reusable filesystem owner #344 advanced non-force to exact |
|
Owner-authority refresh, 2026-09-07 KST: current reusable filesystem owner #344 is exact |
|
Fresh consumer repair/evidence sweep on 2026-09-07 KST:
Keep Draft and keep #212 held. This repair does not broaden filesystem publication or credential-deletion authority. |
Purpose
Harden DiskSage's local provider-OAuth domain authority while keeping reusable filesystem publication in #344 and shipped CLI/process/platform behavior in #212. Refresh-token secrets remain in the OS credential store; this PR owns OAuth connection-document/token/callback/credential semantics.
Current exact state — 2026-09-07 KST
main:0e90f9cebadbd7f59606baaec4ca1d2f178c899a;fea9144a15234035fbdf37e9fa914e5fd51efdec; Test/Release/Security/SAST are terminal success, CodeQL attempt 3 remains queued in canonical.githubcompatibility lanes;736da6db1fb0918d998b3f4d240c63936c91b11d, exact Test34050767861terminal success;eaf1bc88636f573b230ccc71ca5dd4ae78aa370f;34105722966, queued/pending at the latest sweep. Release34105722961is skipped and is not passing evidence.Filesystem-owner adoption and replacement-unavailable consumer contract
#339 inherits #344 through ordinary non-force ancestry. A missing connection document may use canonical private create-new publication at exact Unix mode
0600; an existing regular document returnsoauth-connection-document-object-bound-replacement-unavailablebefore staging/delete-and-create/pathname fallback. Provider-domain semantics remain here; reusable filesystem publication authority remains in #344.Valid finding and repair — canonical publication owner
Fresh review found that
provider_oauth.rscompiledsrc/private_directory_publication.rsa second time under#[cfg(test)]throughinclude!, then routed unit-test writes through that duplicate module while production usedcrate::private_directory_publication. That made unit tests exercise a distinct module instance instead of the inherited owner boundary.Exact source-contract RED commit
dafe81757f0cb264ce76a5c8f805ed00e708239baddsprovider_oauth_publication_owner_contract.rs, requiring provider OAuth to consume exactly one canonicalcrate::private_directory_publication::write_private_bytes_create_new_with_parentscall and forbidding the test-private included owner copy. Its first Test run34104885092was cancelled by the causal fix push before the Ubuntu lane received a runner; the unchanged RED test job was explicitly re-requested for hosted evidence rather than treated as passing.Minimal causal fix
eaf1bc88636f573b230ccc71ca5dd4ae78aa370fremoves only the test-privateinclude!module and thecfg(test)duplicate wrapper. Comparedafe817...→eaf1bc8...is one commit, one file, 16 deletions, 0 additions. Test and production now call the same crate-owned private-directory publication primitive; no filesystem behavior, OAuth contract, permissions, pathname fallback, or replacement authority was widened.Provider-domain safeguards retained
Connection/document deserialization rejects unknown fields; duplicate IDs fail closed; connection IDs normalize macOS File Provider Unicode forms while retaining legacy lookup compatibility; loopback callbacks remain bounded and host-authoritative; refresh tokens remain in the OS credential store and outside settings/command responses. Existing-record replacement remains intentionally unavailable until exact-source-object mutation and recovery semantics are accepted.
Downstream order and remaining gaps
Owner #344 GREEN is not consumer GREEN. #339 must earn terminal exact-head Test/security/review evidence on
eaf1bc8...; only then may #212 restack by ordinary non-force ancestry. Issue #342 remains open for stable publication authority, especially Windows native-handle/reparse/durability parity. Issue #170 remains open for exact-object Trash/deletion, durable journal/receipt, crash/power-loss recovery and undo. #264 remains a release prerequisite until its canonical CodeQL receipt is terminal success.Keep Draft until the consumer exact head and prerequisites have terminal passing applicable Test/security/SAST/CodeQL/coverage/review evidence. No self-approval, gate weakening, administrative bypass, pathname fallback, predecessor-evidence transfer, source copy, force-push, destructive rebase, or premature Close.