support

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2026 License: MIT Imports: 31 Imported by: 0

Documentation

Overview

Package support owns the route inventory used by standalone server tests.

Package support holds server-route test data and request helpers shared by independently runnable protocol test packages. Production code must not import this package.

Index

Constants

View Source
const RegistryConfig = `{"architecture":"amd64","os":"linux","config":{"Labels":{"team":"matrix"}}}`

Variables

View Source
var CheapHash = func() []byte {
	h, err := auth.HashPasswordWith(TestHash, "pw")
	if err != nil {
		panic(err)
	}
	return h
}()

CheapHash is the hash of the test principals' shared password, "pw".

View Source
var RegistryLayer = SHA256Digest("registry layer")
View Source
var TestHash = auth.HashParams{MemoryKiB: 64, Time: 1, Threads: 1}

TestHash keeps server-route authentication tests fast under the race detector.

Functions

func ArtifactoryError

func ArtifactoryError(t *testing.T, rec *httptest.ResponseRecorder) (int, string)

func Basic

func Basic(user, password string) map[string]string

func Bearer

func Bearer(token string) map[string]string

func Do

func Do(
	t *testing.T, h http.Handler, method, path string, headers map[string]string, body string,
) *httptest.ResponseRecorder

func DockerHandwrittenRoutes

func DockerHandwrittenRoutes() map[string]bool

DockerHandwrittenRoutes excludes the generated JFrog REST operations.

func DockerRoutes

func DockerRoutes() map[string]bool

DockerRoutes is the Docker and OCI server-assembly route inventory. The standalone Docker status and principal tables each cover every route.

func GoRoutes

func GoRoutes() map[string]bool

GoRoutes is the implemented Go module protocol route inventory. The root package retains registration guards while test/server/golang runs status and principal assertions independently.

func HelmChart

func HelmChart(name, version string) []byte

HelmChart builds a minimal chart archive with the named version.

func HelmRoutes

func HelmRoutes() map[string]bool

HelmRoutes is the classic Helm protocol route inventory. Helm OCI routes have their own registry package and test owner.

func MavenRoutes

func MavenRoutes() map[string]bool

MavenRoutes is the route inventory asserted by the independent Maven server-assembly package. The item routes are shared with other formats; the two REST routes are Maven-specific.

func NPMGeneratedRoutes

func NPMGeneratedRoutes() map[string]bool

NPMGeneratedRoutes is the subset implemented by generated Artifactory operations. The root stub guard must skip these after their status rows move.

func NPMPublishBody

func NPMPublishBody(name, version string) string

func NPMRoutes

func NPMRoutes() map[string]bool

NPMRoutes names the implemented npm protocol and migration operations. The root registration guards and standalone npm status/matrix suites share this inventory without importing each other's test package.

func NPMTarballOf

func NPMTarballOf(name, version string) []byte

func NuGetForm

func NuGetForm(pkg []byte) string

func NuGetPDBPackage

func NuGetPDBPackage(id string, pdb []byte) []byte

func NuGetPackage

func NuGetPackage(id, version, more string) []byte

func NuGetPortablePDB

func NuGetPortablePDB() []byte

func NuGetRoutes

func NuGetRoutes() map[string]bool

NuGetRoutes lists the implemented NuGet route patterns. The root package uses this inventory for registration/stub checks; test/server/nuget runs their status and principal assertions independently.

func NuGetSymbolsPackage

func NuGetSymbolsPackage(id, version string) []byte

func NuGetWindowsPDB

func NuGetWindowsPDB() []byte

func PushImage

func PushImage(
	t *testing.T,
	db store.Store,
	blobs blob.Store,
	c repo.Config,
	name, tag, body string,
)

PushImage stores RegistryConfig in the image and pushes an OCI manifest to the tag; RegistryLayer must already be present in the image.

func PyPIRoutes

func PyPIRoutes() map[string]bool

PyPIRoutes is the implemented PyPI protocol inventory. The root server package guards registration; test/server/pypi checks status and principals.

func RegistryManifest

func RegistryManifest(note string) string

RegistryManifest is the OCI image manifest used by the shared Docker and Helm OCI server-assembly fixtures. note varies its digest.

func SHA256Digest

func SHA256Digest(body string) string

SHA256Digest is the registry digest of a fixture body.

func Seed

func Seed(t *testing.T, db store.Store)

func SeedHelmCharter

func SeedHelmCharter(t *testing.T, db store.Store, passwordHash []byte)

SeedHelmCharter gives the chart-only caller rights on charts but not their provenance sidecars. Root and independent Helm matrices use the same grant.

func TerraformBackendKeys

func TerraformBackendKeys(t *testing.T) *crypt.Keyring

TerraformBackendKeys is the deterministic keyring for sealed fixture state.

func TerraformBackendRepos

func TerraformBackendRepos() []repo.Config

TerraformBackendRepos is the local backend fixture shared with the root cross-format guards.

func TerraformBackendRoutes

func TerraformBackendRoutes() map[string]bool

TerraformBackendRoutes lists the native remote-state API routes. Generic item and storage routes remain covered by the root cross-format guards.

func TerraformProviderRepos

func TerraformProviderRepos() []repo.Config

TerraformProviderRepos supplies the signing-key provider fixture.

func TerraformRegistryRepos

func TerraformRegistryRepos() []repo.Config

TerraformRegistryRepos are the module registry fixture repositories shared by the root cross-format suite and the standalone Terraform route suite.

func TerraformRoutes

func TerraformRoutes() map[string]bool

TerraformRoutes is the native module/provider registry and network mirror route inventory. Backend state routes have a separate owner.

Types

This section is empty.

Jump to

Keyboard shortcuts

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