Documentation
¶
Overview ¶
Package sdktest contains test-only helpers for module contract tests.
Index ¶
- Variables
- func Manifest(t TB, handler http.Handler, internalSecret string) system.ManifestPayload
- func ValidateContributionPayload(host system.ManifestPayload, outbound OutboundContribution) error
- func ValidateContributionsToHost(host, contributor system.ManifestPayload, hostReferences ...string) error
- type OutboundContribution
- type TB
Constants ¶
This section is empty.
Variables ¶
var ErrContributionSlotNotProvided = errors.New("sdktest: contribution slot is not provided")
ErrContributionSlotNotProvided means the host manifest does not declare the slot targeted by an outbound contribution.
var ErrNoContributionsToHost = errors.New("sdktest: contributor does not target host")
ErrNoContributionsToHost means the contributor manifest does not target the supplied host by its manifest ID, slug, or an explicitly supplied reference.
Functions ¶
func Manifest ¶
Manifest requests and decodes the SDK manifest exposed by handler. internalSecret must match the module's configured internal credential.
func ValidateContributionPayload ¶
func ValidateContributionPayload(host system.ManifestPayload, outbound OutboundContribution) error
ValidateContributionPayload checks one contributor manifest entry against the exact JSON Schema advertised by its host manifest.
func ValidateContributionsToHost ¶
func ValidateContributionsToHost(host, contributor system.ManifestPayload, hostReferences ...string) error
ValidateContributionsToHost checks every entry in contributor that targets host. Exact catalog references such as "@owner/user-core" belong in hostReferences because a manifest's slug cannot authenticate or reconstruct its catalog owner. It is the compatibility gate for unchanged module canaries.
Types ¶
type OutboundContribution ¶
type OutboundContribution = registry.OutboundContribution
OutboundContribution is one contributor-side manifest declaration.