Sub-Store URL parity on the share serve path: target, produce flags, noFlow - #51
Merged
Conversation
…flags, noFlow A Sub-Store subscription URL names its client: ?target=Stash means Stash. The share serve path had no such notion — the client came from UA sniffing or the record's pin, so one share could not serve two different clients by URL, which is the single most-used capability of the product this plugin embeds. The serve path now reads, under upstream's own query-parameter names: - target — validated against the bounded client-target set; the string enters the render cache key, and an unbounded caller-chosen value there would be a cache-exhaustion lever on an unauthenticated-by-design endpoint, which is exactly why the set is closed. - includeUnsupportedProxy and prettyYaml — forwarded to the plugin as produce() flags under the names the embedded core reads (include-unsupported-proxy, pretty-yaml; the core accepts both YAML spellings, verified in the embedded bundle). - noFlow — suppresses the Subscription-Userinfo response header; it never changes the rendered body, so it deliberately stays out of the cache key. Distinct variants cache separately (ShareID+Format+UAClass+Variant); the zero variant produces byte-identical keys and payloads to before, so a plugin built before these fields existed sees exactly the request it always saw. Contract test covers: two targets render and cache independently, an identical repeat is a cache hit, an unknown target is denied before any render, prettyYaml is its own cache dimension and reaches produce, and a noFlow response drops the quota header without splitting the cache. Plugin-side counterpart (explicit target priority + produce options) is on lattice-plugin-sub-store feat/align-substore-s1. Parity floor and naming source: SUBSTORE-PARITY.md §5 (upstream 2.36.38 inventory). Tested: full go test ./internal/server (37s, ok); gofmt/vet clean. Not-tested: -race matrix (CI); end-to-end against the new plugin build (rides with the joint release preflight).
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.
P-1 server half of SUBSTORE-PARITY.md. Share URLs gain ?target= (bounded allowlist, cache-keyed), includeUnsupportedProxy / prettyYaml (forwarded as produce flags under the embedded core's own names), and noFlow (drops the quota header, cache-neutral). Zero-variant requests are byte-identical to before; old plugins safely ignore the new payload fields. Contract test pins render-per-variant, cache hit on repeat, unknown-target denial, flag delivery, and header suppression. Full suite green.