integration

package
v0.0.0 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: Apache-2.0, MIT Imports: 52 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 integration contains an end-to-end test harness that stands up a real Hilt in-process alongside mocks of the services it talks to — a management console (REST), the Ingot S3 gateway (UCAN RPC), and the Sprue upload service (UCAN RPC) plus a mock did:plc directory — so the REST and RPC APIs can be exercised together with the real AWS S3 SDK.

Index

Constants

View Source
const Region = "us-east-1"

Region is the region the mock Ingot provider serves and tenants are created in.

Variables

This section is empty.

Functions

This section is empty.

Types

type Console

type Console struct {
	// contains filtered or unexported fields
}

Console is a mock management console: the partner-facing means of creating tenants and access keys. It drives Hilt's REST management API using the existing management client, authenticating with the partner key.

func (*Console) CreateAccessKey

func (c *Console) CreateAccessKey(ctx context.Context, tenantID, name string, perms []string) (api.CreatedAccessKey, error)

CreateAccessKey creates an S3 access key with the given permissions and returns it, including the one-time secret access key.

func (*Console) ProvisionTenant

func (c *Console) ProvisionTenant(ctx context.Context, tenantID, region string) (api.Tenant, error)

ProvisionTenant creates (or returns the existing) tenant for the given external id and region.

type Network

type Network struct {
	HiltURL string
	HiltDID did.DID

	IngotDID did.DID

	Admin   *client.AdminClient
	Console *Console
	Ingot   *mockIngot
	Sprue   *mockSprue
	PLC     *mockPLC
}

Network is the running integration network: a real Hilt plus the mocks and the clients needed to drive it. All resources are torn down via t.Cleanup.

func Start

func Start(t *testing.T) *Network

Start brings up the whole network in-process and returns a ready Network. The order matters: the Sprue and PLC mocks come up first because Hilt's config points at them (and embeds a Sprue→Hilt delegation), then Hilt boots, then the Ingot (whose Hilt client needs Hilt's DID and Hilt→Ingot delegations).

func (*Network) S3Client

func (n *Network) S3Client(t *testing.T, accessKeyID, secret string) *s3.Client

S3Client builds a real AWS S3 SDK client pointed at the mock Ingot, signing with the given access key credentials (id = the bare did:key identifier, secret = the multibase secret returned by CreateAccessKey).

Jump to

Keyboard shortcuts

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