Repository navigation
K2GO-376 feat(cx-core): /v1/share gate (two-lifetime, token-scoped) - #694
Merged
Merged
Conversation
…g-op Token-gated share session over a scoped item set (POST /v1/share, GET manifest, GET fetch per item reusing the export op, DELETE). Closes on the first of five closers; loopback only (network carrier + pairing are later app slices). Core 0.3.0.
…session lifetimes
The durable session no longer expires on the short connection idle; it closes on COMPLETE,
CANCEL, or a long safety cap (the per-item connection TTL stays the export op's). Move the
token to the X-Share-Token header so it never reaches access logs. Single-flight per item.
Count an item delivered only on a clean close (ExportStream.completed); add POST
/v1/share/{id}/complete; drop the implicit drop-based auto-close.
…nt drop Move the response header writes inside the try whose finally runs on_close, so a client disconnect during the headers still releases the export op pin and the share single-flight slot. A stranded slot blocked the safety cap and leaked the durable session (content exposed past the cap). Also note the manifest delivered flag is an advisory sender-side hint, not receiver-persisted state.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds the cx-core /v1/share gate: the shared contract (build-order step 1) for granular wireless
Share. Share is the network twin of export: same bundle, manifest and import path; only the
carrier changes. The receiver PULLS from the sender's live cx-core, so the transfer can close
itself (unlike Clone's mute standalone rsync daemon).
Endpoints:
Design:
SESSION is durable (token + scoped item set + delivered state) until COMPLETE, CANCEL, or a
long safety cap (6h), not the short connection idle. In-memory for v1 (disk-persist later).
bound to the session and scoped to the item set (itemRef is an opaque index).
owner, single-flight per item, delivered only on a clean close.
Scope: cx-core only, loopback. No app, network, hotspot or pairing (those are step 2). Python
stdlib only. 183 cx-core tests (33 share); independent two-pass review, all findings fixed.