source

package
v0.35.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 6, 2026 License: Apache-2.0 Imports: 12 Imported by: 0

README

Original HTTP source definitions

ovdb-http-source/1 is a closed, preparatory metadata contract, embedded as source_definition in an existing publisher manifest. A paired database descriptor must carry the identical definition. The publisher checker reads original Git objects and returns a manifest byte pin classified publisher-definition-verified with dynamic-unpinned input verification. It never fetches a URL or emits immutable-input SourceRights for this profile. Existing manifests and ovdb-data-rights/1 keep their existing behaviour; combining the HTTP definition with that profile or a representation contract is refused. Manifest licences.data links the upstream terms without an inferred SPDX or output licence. Linked rights are declarations, not legal clearance.

rights.declaration is the one complete linked declaration (name and url) shared by the database and every recordset. Manifest and materialized descriptor licences.data must equal that whole normalized declaration; this version supports no recordset overrides or replacement text. Descriptors list every native recordset exactly once with matching materialized terms. Authored sourceRights, providerReads or definition-verification evidence is refused.

The definition identifies the original provider independently of an executor. providerSourceId binds provider:<provider.id>/<native recordset name> to an exact declared resource. Native names must match the manifest, and entity must match its existing recordset_entities mapping (or the same native name). fieldMapping maps native decoder field names to modeled field names; keyFields names native fields. context describes explicit model context, without synthesizing source rows. Decoder names describe a versioned contract; this schema neither implements nor verifies a decoder or its semantics.

All resources require GET, a public HTTPS URL without credentials or query parameters, bounded read size/time, live mode, retention: none, no-store and redirect refusal. This is static URL validation; execution must still enforce DNS/address guards, CORS/auth, redirects and no-store across every runtime and consumer route. Current-response parsing in bounded RAM requires the runtime contract; no durable source rows, bodies, caches, snapshots or fixtures are authorized by this declaration. Explicit user authorization is required for any later retention exception, which this version cannot express.

Declaration, terms and attribution links use the same public host/path policy as resources. Queries, credentials, IP literals and local/reserved hosts are refused. Simple nonempty fragments such as #reuse are allowed for notices; resource URLs retain the stricter exact-address policy. These are static checks, with no link fetch or DNS/authenticity certification. The exported schema checks structure and link shape; the Go parser also enforces the public-target policy.

Every admission gate is required and fixed to blocked; status is blocked and executionEnabled is false. RequireExecution always refuses, including after caller mutation. This version has no active/admitted state. A future version requires actual runtime/providerReads/consumer acceptance, fresh semantic review, source-rights integration review and product-specific paid applicability clearance. No pass state can be obtained by editing a flag. readEvidence advertises the required ovdb-provider-read/1 boundary and executor-observed classification; it does not create a read receipt or claim that runtime/consumer support exists. Executor-scoped legacy rights IDs and expected-server checks remain unchanged. Admitted provider/executor bindings, canonical receipt digests and observation/usage validation remain runtime work.

ecb-daily.example.json contains declarations only, without rate data. It describes the exact daily XML resource separately from ECB historical XML. The candidate identity provider:ecb/FxReferenceQuote awaits namespace-owner acceptance and final model mapping review. Native time, currency and rate are strings; time maps to reference date, not publication instant. rate preserves the positive lexical decimal in quote units per 1 EUR. EUR base and indicative-reference context add no fabricated EUR row or derived cross-rates. Runtime validation must reject malformed dates/decimals, duplicate date/currency keys, unexpected XML namespaces/structure, DTDs and entities. Attribution, original free-source link and restructuring disclosure accompany results; paid notice applicability remains blocked. The example is neither published catalog admission nor proof that any query path works.

Documentation

Overview

Package source validates immutable declarations of original HTTP resources. Validation never fetches a resource, authorizes execution or retains its data.

Index

Constants

View Source
const Format = "ovdb-http-source/1"

Variables

This section is empty.

Functions

func Schema

func Schema() []byte

Schema returns a private copy of the closed preparatory definition schema.

Types

type Admission

type Admission struct {
	Status           string `json:"status"`
	ExecutionEnabled bool   `json:"executionEnabled"`
	Gates            Gates  `json:"gates"`
}

type Definition

type Definition struct {
	Format       string               `json:"format"`
	Provider     Provider             `json:"provider"`
	Resources    map[string]Resource  `json:"resources"`
	Recordsets   map[string]Recordset `json:"recordsets"`
	Rights       Rights               `json:"rights"`
	ReadEvidence ReadEvidence         `json:"readEvidence"`
	Admission    Admission            `json:"admission"`
}

func Parse

func Parse(data []byte) (*Definition, error)

Parse refuses missing/null fields, unknown/case-folded/duplicate keys, retention, execution admission and secret-bearing resource URLs. The schema deliberately has no pass/enable state: runtime and consumer enforcement plus semantic, source-rights and paid applicability reviews require a later contract.

func (Definition) Matches

func (d Definition) Matches(names []string, entities map[string]string) error

Matches binds this definition to the existing manifest's native recordsets and ModelSpec entities. Field meanings and decoder correctness remain gates.

func (Definition) MatchesTerms

func (d Definition) MatchesTerms(declaration license.Declaration) error

MatchesTerms enforces one shared normalized linked declaration. This version supports no recordset overrides, replacement text or inferred output licence.

func (Definition) RequireExecution

func (d Definition) RequireExecution() error

RequireExecution is a hard refusal in this preparatory contract, even if a caller mutates the decoded struct. A valid definition is not runtime admission.

type Evidence

type Evidence struct {
	Origin            string      `json:"origin"`
	InputVerification string      `json:"inputVerification"`
	Manifest          license.Pin `json:"manifest"`
}

Evidence verifies declaration bytes only. It is never a SourceRight, a read receipt, proof of upstream authenticity, or an execution/copy authorization.

type Gates

type Gates struct {
	Runtime  string `json:"runtime"`
	Semantic string `json:"semantic"`
	Rights   string `json:"rights"`
	Paid     string `json:"paid"`
}

type Provider

type Provider struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	URL  string `json:"url"`
}

type ReadEvidence

type ReadEvidence struct {
	Format            string `json:"format"`
	Classification    string `json:"classification"`
	InputVerification string `json:"inputVerification"`
}

type Recordset

type Recordset struct {
	ProviderSourceID string            `json:"providerSourceId"`
	Resource         string            `json:"resource"`
	Decoder          string            `json:"decoder"`
	Entity           string            `json:"entity"`
	KeyFields        []string          `json:"keyFields"`
	FieldMapping     map[string]string `json:"fieldMapping"`
	Context          map[string]string `json:"context"`
}

type Resource

type Resource struct {
	URL           string `json:"url"`
	Method        string `json:"method"`
	ContentType   string `json:"contentType"`
	TimeoutMs     int    `json:"timeoutMs"`
	MaxBytes      int    `json:"maxBytes"`
	Mode          string `json:"mode"`
	Retention     string `json:"retention"`
	Cache         string `json:"cache"`
	Redirect      string `json:"redirect"`
	BrowserAccess string `json:"browserAccess"`
}

type Rights

type Rights struct {
	Declaration     license.Declaration `json:"declaration"`
	Terms           []license.Notice    `json:"terms"`
	Attribution     license.Notice      `json:"attribution"`
	FreeSource      license.Notice      `json:"freeSource"`
	Transformations []string            `json:"transformations"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL