Repository navigation
fix(kernel): require verified caller identity for the Git bridge - #635
Conversation
|
@claude Please review current head |
|
Claude finished @kshivang's task in 4m 30s —— View job Review of
|
|
@Antriksh1984 Thank you for the concrete IPC security work. Current repair head: Your implementation gates all 16 Git RPCs, including destructive operations, with the correct synchronous stream context capture. Reviewer commit adds unary revocation and deterministic live watchFileStatus revocation regressions, routes every stream refusal through a structured AUTH log, documents emission-time revocation, and makes the fake provider record getCurrentProjectPath reads. The description's RPC count is corrected from 14 to 16. No unresolved substantive production correctness defect is established after these repairs. The remaining blocker is validation of the new reviewer head. Next steps: obtain a green GitServiceBridgeTest run (now five tests), root quality checks and required multi-platform CI, review this bounded delta, and recheck integration with current dev before marking ready. A missing/old runtime credential will be refused, consistent with #505; stream refusals are now diagnosable in the host log. Watch flows still have no subscription counter in the fake, but the wire refusal tests fail if any value leaks; broader fake instrumentation is optional. The latest requested Claude review is #635 (comment). Shared authentication-helper consolidation and stale transport inventory comments remain #575 context; no cross-group PR was changed. Avoid introducing another generic flow abstraction in this bounded security patch: the existing synchronous capture sites remain explicit, and refusal logging is centralized locally. Original-head CI and actual XML were verified green on Linux, macOS and Windows. That evidence does not validate these new reviewer changes. Updated-head CI is queued/in progress; local Gradle validation could not acquire the shared build lock during this bounded review. This is an infrastructure/validation handoff, not evidence of an original contributor CI failure. All repairs are reviewer work and are not counted toward your original contribution score. No app instance or live database was launched or stopped. Per the assigned bounded-disposition policy, I am converting this PR to draft after this handoff. No checks were bypassed and no unvalidated merge was attempted. |
|
Confirmed current head |
GitServiceBridge had no caller-identity check on any of its fourteen RPCs. Any process able to open a connection to the kernel IPC server - not only the plugins the host itself loaded - could read the open project's full commit history and working-tree status, and could discardChanges (destroying uncommitted work), checkout, cherryPick or revert against the project's real git repository with no credential at all. Gate every RPC behind authenticatedCallerOrRefuse(), the same PERMISSION_DENIED-on-no-identity pattern PluginUIServiceBridge established for BossConsole#53. The four watch streams (file status, commit log, is-repo, is-loading) capture identity synchronously before returning and re-check it on every emission, so a revoked token stops a live stream rather than only new calls - matching the shape PR risa-labs-inc#550's review settled on for this bridge's siblings.
Real CI's ktlintDesktopTestSourceSetCheck flagged chain-method-continuation violations (a local run had missed this) - wrap the affected builder chains onto their own lines, per ktlintFormat. No behavior change.
|
@claude Please review current head |
345ee24 to
83a848d
Compare
|
Claude finished @kshivang's task in 7m 3s —— View job Review of
|
|
@Antriksh1984 Current head passes all ten hosted checks; local GitServiceBridgeTest passes 5/5 and detekt passes. The current Claude review found no blocking correctness/security defect. Your 16 gates and original wire tests are retained, separately credited from prior reviewer tests/diagnostics. Review reconciliation: the proposed different-identity log reason is not a reachable transition in the actual ProcessTokenRegistry: issue mints a fresh token and removes its predecessor; revoke removes it; the captured token returns the same id or null. The latest ActiveTabs review independently confirms that invariant. No reason-dependent production branch is needed here. All four independent watch guards were checked against the proto and source; anonymous refusal covers all four, and the deterministic wire regression covers the revocation mechanism. More per-stream mutation tests would strengthen coverage but no omitted gate was found. Shared helper/KDoc enumeration stays with #575. Existing proxy retry/version-skew behavior and authentication-versus-capability scope are documented in the description. No UI change or native visual check applies. Proceeding with the serialized dev-only merge after a fresh exact-head/check/integration preflight. Original score remains 9/10; reviewer repairs are excluded. |
* fix(kernel): require verified caller identity for the Git bridge GitServiceBridge had no caller-identity check on any of its fourteen RPCs. Any process able to open a connection to the kernel IPC server - not only the plugins the host itself loaded - could read the open project's full commit history and working-tree status, and could discardChanges (destroying uncommitted work), checkout, cherryPick or revert against the project's real git repository with no credential at all. Gate every RPC behind authenticatedCallerOrRefuse(), the same PERMISSION_DENIED-on-no-identity pattern PluginUIServiceBridge established for BossConsole#53. The four watch streams (file status, commit log, is-repo, is-loading) capture identity synchronously before returning and re-check it on every emission, so a revoked token stops a live stream rather than only new calls - matching the shape PR #550's review settled on for this bridge's siblings. * style(tests): wrap chained builder calls in GitServiceBridgeTest Real CI's ktlintDesktopTestSourceSetCheck flagged chain-method-continuation violations (a local run had missed this) - wrap the affected builder chains onto their own lines, per ktlintFormat. No behavior change. * test(kernel): cover revoked callers and log stream refusals --------- Co-authored-by: Shivang <shivang.iitk@gmail.com>
Summary
GitServiceBridgehad no caller-identity check on any of its sixteen RPCs. Any process able to open a connection to the kernel IPC server - not only the plugins the host itself loaded - could read the open project's full commit history and working-tree status, and coulddiscardChanges(destroying uncommitted work),checkout,cherryPickorrevertagainst the project's real git repository with no credential at all.authenticatedCallerOrRefuse(), the samePERMISSION_DENIED-on-no-verified-identity patternPluginUIServiceBridgeestablished for BossConsole#53.WatchFileStatus,WatchCommitLog,WatchIsGitRepo,WatchIsLoading) capture identity synchronously before returning the flow and re-check it on every emission, so a revoked token stops a live stream rather than only new calls - matching the shape PR #550's review settled on for this bridge's siblings (DownloadServiceBridge/SupabaseServiceBridge).Test plan
GitServiceBridgeTestruns a real gRPC server behindProcessIdentityInterceptor: every RPC refused withPERMISSION_DENIEDfor an anonymous caller and the fake provider never invoked; an authenticated caller can watch file status/commit log and read the current project path; an authenticated caller can stage, checkout and discard changes normally../gradlew :composeApp:compileKotlinDesktop :composeApp:compileTestKotlinDesktop./gradlew :composeApp:desktopTest --tests "ai.rever.boss.kernel.services.GitServiceBridgeTest"./gradlew :composeApp:detektReview attribution and current validation
Antriksh (@Antriksh1984) authored the original production change and original tests. The original commits were replayed onto dev to remove conflicts caused by squash-merged shared history; author metadata is preserved. The prior reviewer revocation tests, refusal diagnostics and documentation repairs are retained unchanged; the six RunConfig / five Git tests passed on all three supported OSes at the previous repair heads. Current replayed head passes all ten hosted checks. Focused local bridge tests and detekt pass; Log also passes local ktlint. Current Claude review reports no blocking correctness/security defect. Idle streams are not proactively disconnected. Shared transport/helper work (#575) remains separate. No UI was changed or visually exercised.
Compatibility: a runtime missing the process credential is refused, consistent with #505/#550. Existing proxy watch loops retry with backoff; this can produce recurring AUTH warnings and an empty panel for an old or misconfigured runtime. Identity establishes a caller, not per-operation capabilities.