fix(helper)!: drop claimed identity, version the protocol - #615
fix(helper)!: drop claimed identity, version the protocol#615Alex Shabalin (alex-sparus) wants to merge 1 commit into
Conversation
This stack of pull requests is managed by jj-ryu. |
🎨 Storybook previewUpdated for 4d769aa
|
📋 PR Overview
🔬 Coverage
|
5630310 to
48e09e0
Compare
48e09e0 to
4586ddc
Compare
| // The operation is deliberately invalid: getting the skew | ||
| // classification rather than an unknown-variant parse error proves | ||
| // the version gate wins before the rest of the shape is interpreted. | ||
| for version in [1, 3, 99] { |
There was a problem hiding this comment.
nit: This will have to be updated each time we rev the protocol but could be fixed by using a const which is "current protocol version".
There was a problem hiding this comment.
Ah, really sorry how it turned out with the version - it's completely removed later. The plan has changed mid-stack and I didn't spend time cleaning up the middle
| // cannot answer the probe, so the osascript path takes over instead of | ||
| // the activation request coming back as an unparseable request. | ||
| if !status.responding { | ||
| info!( |
There was a problem hiding this comment.
Maybe a warn instead of an info
There was a problem hiding this comment.
Sorry, same here - the decision to use the osascript instead of the helper has become much more nuanced later. I was hoping there wasn't that much code overwritten later but looks like I was wrong
| // could not have parsed the request — so falling back is safe | ||
| // until the installed helper is replaced by a current one. | ||
| if helper_protocol::is_protocol_skew(&error) { | ||
| info!( |
There was a problem hiding this comment.
same
There was a problem hiding this comment.
This code is also replaced
4586ddc to
4d769aa
Compare
Requests no longer carry userName/userId/home/nixPath: the daemon derives the account from the authenticated socket peer via getpwuid_r, so a client has nothing left to assert about itself. Unknown fields are hard errors on both sides. Every request and response carries a required protocolVersion, checked for exact equality before any other field is interpreted. Skew is classified — typed ProtocolSkew client-side, prefix-matched error marker daemon-side — so callers pick a recovery without parsing display text. Responses also embed a diagnostic helper build version. The v2 activation envelope is deliberately unparseable by the v1 request parser: a resident v1 daemon must not execute a v2 activation and answer with a versionless response, or the app's recovery would re-run a finished activation. A skewed daemon fails the status probe and the app uses the interactive prompt until the installed helper is replaced. BREAKING CHANGE: protocol v2 rejects every v1 wire shape; v1 helpers and v2 apps cannot interoperate.
4d769aa to
d5c9e7e
Compare

Summary
internal code
C2Test Plan
Docs