Skip to content

Sub-Store URL parity on the share serve path: target, produce flags, noFlow - #51

Merged
lr00rl merged 1 commit into
integrationfrom
feat/share-target-param
Aug 18, 2026
Merged

Sub-Store URL parity on the share serve path: target, produce flags, noFlow#51
lr00rl merged 1 commit into
integrationfrom
feat/share-target-param

Conversation

@lr00rl

@lr00rl lr00rl commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

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.

…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).
@lr00rl
lr00rl merged commit f948b30 into integration Aug 18, 2026
1 check passed
@lr00rl
lr00rl deleted the feat/share-target-param branch August 18, 2026 10:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant