design-15 S5: declared chain edges via downstream_line_uuid - #15
Closed
lr00rl wants to merge 3 commits into
Closed
Conversation
D1/§4 slice: persist the line_hash_id -> line_uuid mapping in the vpnmeta/lineuuid KV bucket, attach LineUUID/DownstreamLineUUID to the Lines read model (allocation degrades, never fails the read), render the lattice.singbox-metadata.v2 sidecar deterministically per node, and add the reviewed apply-task helper (atomic tmp+mv, .bak backup) without wiring any trigger yet. Pins lattice-sdk @60c69bd (draft PR lattice-sdk#7) for the new SingBoxNode line_uuid/downstream_line_uuid fields.
vpn-core users-admin gains plan_add/plan_remove (in-core, core-backed): each compiles a pending approval whose Plan is a redacted payload (op/line/user/credential SHA — never secret material) and whose Action binds the exact credential bytes. The approval executor renders the on-box `sb user add|del <line> <payload>` invocation, re-deriving the credential from the write-only store and failing closed when the bytes moved since approval. Also adds rotate: regenerate one protocol credential with a one-time reveal, preserving the write-only read model. Every on-line user carries the design-15 §5 derived name (u_<sha256(user|line_uuid)[:16]>) — the single join key for auth, auth_user routing, and per-user stats. A successful remove drops the server-side binding so the read model stops claiming the user belongs on the line. Managed-track user writes (whole-config re-render) are explicitly rejected with a pointer to the later slice.
design-15 §6: a sidecar-declared downstream_line_uuid now joins to the downstream line's hash across the whole fleet — exact across machines and immune to NAT or shared ports — and lands in both jump_edges and the new declared_jump_edges provenance subset. Inferred (host,port) edges stay as the fallback; unknown or self references resolve to no edge.
lr00rl
force-pushed
the
feat/design-15-line-users
branch
from
July 22, 2026 13:29
0b39e33 to
9812a3c
Compare
Contributor
Author
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.
Summary
design-15 §6 chain recognition:
buildLineGroupsstep (5): a sidecar-declareddownstream_line_uuidresolves to the downstream line's hash fleet-wide — exact across machines, immune to NAT/DNS/shared ports. Declared edges land injump_edges(deduped against inferred ones) and in the newdeclared_jump_edgesprovenance subset.Stacked on #14.
Verification
gofmt/go vetclean;go test ./internal/server/ok (21s)Refs LatticeNet/lattice#2, #13, #14, LatticeNet/lattice-plugin-vpn-core#3.