feat(session): authenticate Hunk broker clients - #905
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Greptile SummaryThis PR adds owner-private Ed25519 credentials and authenticated producer, reconnect, and CLI request flows to the local Hunk session broker. It also bounds incomplete handshakes, narrows public health output, and removes unverifiable PID-based daemon replacement.
Confidence Score: 4/5The PR appears safe to merge after the non-blocking new-module filename convention issue is addressed. The authentication, authorization, replay prevention, reconnect ownership, credential storage, and handshake lifecycle paths reviewed retain their intended boundaries; the only accepted concern is the nonconforming filename of the new client-authentication module. Files Needing Attention: packages/session-broker/src/clientAuthentication.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Producer as Hunk producer
participant Broker as Session broker
participant CLI as Hunk CLI
participant App as Live session
Producer->>Broker: hello-init
Broker-->>Producer: signed challenge
Producer->>Broker: signed proof
Broker-->>Producer: authenticated acknowledgement
Producer->>Broker: register or reconnect
Broker->>Broker: Validate scope and bind owner
Broker-->>Producer: Registration accepted
CLI->>Broker: Negotiate caller session
Broker-->>CLI: Short-lived caller session
CLI->>Broker: Signed session-api request
Broker->>Broker: Verify freshness, scope, and target
Broker->>App: Dispatch authorized command
App-->>Broker: Command result
Broker-->>CLI: Bounded signed response
Prompt To Fix All With AI### Issue 1
packages/session-broker/src/clientAuthentication.ts:1
**CamelCase module filename**
The new `clientAuthentication.ts` module conflicts with the repository’s enforced dash-case filename convention, requiring its package export, production import, and colocated test to retain a nonconforming path. Rename the module and corresponding test to `client-authentication.ts` and update their imports.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Reviews (1): Last reviewed commit: "feat(session): authenticate Hunk broker ..." | Re-trigger Greptile |
| @@ -0,0 +1,575 @@ | |||
| import { | |||
There was a problem hiding this comment.
The new clientAuthentication.ts module conflicts with the repository’s enforced dash-case filename convention, requiring its package export, production import, and colocated test to retain a nonconforming path. Rename the module and corresponding test to client-authentication.ts and update their imports.
Context Used: guidelines.mdc Cursor rule (source)
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/session-broker/src/clientAuthentication.ts
Line: 1
Comment:
**CamelCase module filename**
The new `clientAuthentication.ts` module conflicts with the repository’s enforced dash-case filename convention, requiring its package export, production import, and colocated test to retain a nonconforming path. Rename the module and corresponding test to `client-authentication.ts` and update their imports.
**Context Used:** guidelines.mdc Cursor rule ([source](https://github.com/modem-dev/modem/blob/main/.cursor/rules/guidelines.mdc))
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.Note: If this suggestion doesn't match your team's coding style, reply to this and let me know. I'll remember it for next time!
9cd85c8 to
50b93b7
Compare
Summary
dev.hunkPhase-1 contract and owner-private Ed25519 credential discovery/session-apiwhile preserving independent browser-review capabilitiesSecurity properties
Validation
Stack
This PR description was generated by Pi using gpt-5.6-sol