v

Wine2You — Data-Exposure Controls Spec (anti-scrape)

Enforceable read-path scoping, bounded pagination, per-key row quotas and audit rules that prevent any API key from bulk-extracting the wine or offer tables.

Wine2You — Data-Exposure Controls Spec

Owner: Wine2You Platform · Status: accepted (2026-10-12) · Feeds: OpenAPI 3.2 contract (Phase A step 1)

Threat. A partner holding a valid entity-scoped key can, without any exploit, walk every paginated list endpoint until it holds the complete wine and offer tables. Rate limits slow this but do not stop it. This spec defines the four controls that make partial data the maximum any key can obtain.

Controls (normative — the OpenAPI contract must encode all four)

C1 — Read-path row/field filter (primary defence)

Applied server-side to every list and detail read before serialization. A row is returned only if all hold:

Gate Rule Source
network_shareable offer.network_shareable == true, OR caller entity is the owning entity PIM §9
permissions caller entity satisfies offer.permissions (allowed_countries[], named_sellers[], default any) PIM §6/§12
channel/tenant scope caller's sales-channel ↔ stock-location links admit the row PIM §9

C2 — Bounded pagination (no infinite walk)

C3 — Per-key record quota (kills page-walking)

C4 — Audit & anomaly signal

Enforcement points (where each control lives)

Control Enforced in Depends on
C1 filter API read layer (shared query middleware) network_shareable, permissions, channel links in schema
C2 pagination + read:network API router + OpenFGA model (can_read_network) Unkey key scopes
C3 quota Unkey per-key quota + API middleware counter Unkey key lifecycle (already deployed)
C4 audit API read middleware → audit log + alert log pipeline

OpenAPI contract requirements (Phase A)

Non-goals

Verification checklist

Edit this page on GitHub ↗