sdktest

package
v0.4.17 Latest Latest
Warning

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

Go to latest
Published: Sep 12, 2026 License: Apache-2.0 Imports: 8 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package sdktest contains test-only helpers for module contract tests.

Index

Constants

This section is empty.

Variables

View Source
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.

View Source
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

func Manifest(t TB, handler http.Handler, internalSecret string) system.ManifestPayload

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.

type TB

type TB interface {
	Helper()
	Fatalf(format string, args ...any)
}

TB is the subset of testing.TB used by this package.

Jump to

Keyboard shortcuts

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