provideradapter

package
v0.1.0-c02.1 Latest Latest
Warning

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

Go to latest
Published: Sep 7, 2026 License: Apache-2.0 Imports: 10 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 provideradapter defines provider-neutral protocols between CloudRING core and downstream infrastructure adapters.

Index

Constants

View Source
const (
	InventoryRequestSchemaVersion = "cloudring.provider-adapter.inventory-request/v1"
	InventoryReceiptSchemaVersion = "cloudring.provider-adapter.inventory-receipt/v1"
	InventoryScope                = "provider-inventory"
	MaxInventoryDocumentBytes     = 1 << 20
	MaxInventoryBindings          = 4096
	ObservationNonceBytes         = 32

	BindingProviderAdapterReference     BindingClass = "provider-adapter-reference"
	BindingRegionInventoryReference     BindingClass = "region-inventory-reference"
	BindingProviderResourceReference    BindingClass = "provider-resource-reference"
	BindingManagementAddressReference   BindingClass = "management-address-reference"
	BindingProvisioningAddressReference BindingClass = "provisioning-address-reference"

	StatusReady     InventoryStatus = "ready"
	StatusBlocked   InventoryStatus = "blocked"
	StatusDenied    InventoryStatus = "denied"
	StatusRetryable InventoryStatus = "retryable"
	StatusFailed    InventoryStatus = "failed"
)

Variables

View Source
var (
	ErrInvalidInventoryRequest = errors.New("invalid provider inventory request")
	ErrInvalidInventoryReceipt = errors.New("invalid provider inventory receipt")
	ErrInvalidObservation      = errors.New("invalid provider inventory observation")
)

Functions

func InventoryRequestSHA256

func InventoryRequestSHA256(request InventoryRequest) (string, error)

InventoryRequestSHA256 is the canonical request commitment echoed by every receipt. Valid requests use structs and ordered slices, so encoding is deterministic across calls.

func ObservationCommitmentSHA256

func ObservationCommitmentSHA256(request InventoryRequest, rawNonce []byte, binding InventoryBinding, canonicalPrivateValue []byte) (string, error)

ObservationCommitmentSHA256 creates the domain-separated salted commitment stored in a receipt. The raw nonce and canonical private value must be passed through protected runtime input and are never retained or returned.

func RunNonceSHA256

func RunNonceSHA256(rawNonce []byte) (string, error)

RunNonceSHA256 returns the request-visible digest of an exact 256-bit protected per-run nonce.

func ValidateInventoryReceipt

func ValidateInventoryReceipt(request InventoryRequest, receipt InventoryReceipt) error

func ValidateInventoryRequest

func ValidateInventoryRequest(request InventoryRequest) error

Types

type BindingClass

type BindingClass string

type InventoryBinding

type InventoryBinding struct {
	BindingClass BindingClass `json:"bindingClass"`
	Reference    string       `json:"reference"`
}

InventoryBinding is a source-safe symbolic lookup. A downstream adapter resolves Reference privately; the request never carries the resolved value.

type InventoryObservation

type InventoryObservation struct {
	BindingClass                BindingClass `json:"bindingClass"`
	Reference                   string       `json:"reference"`
	ObservationCommitmentSHA256 string       `json:"observationCommitmentSha256"`
}

InventoryObservation commits to the private value observed for one exact request binding. The value itself must remain downstream.

type InventoryReceipt

type InventoryReceipt struct {
	SchemaVersion           string                 `json:"schemaVersion"`
	Scope                   string                 `json:"scope"`
	Status                  InventoryStatus        `json:"status"`
	RequestSHA256           string                 `json:"requestSha256"`
	AdapterExecutableSHA256 string                 `json:"adapterExecutableSha256"`
	AdapterCatalogSHA256    string                 `json:"adapterCatalogSha256"`
	Observations            []InventoryObservation `json:"observations"`
	BlockerIDs              []string               `json:"blockerIds"`
	ProductionReady         bool                   `json:"productionReady"`
}

InventoryReceipt is intentionally not a production-readiness assertion. A ready status means only that every requested symbolic binding was observed and committed to by the adapter.

func DecodeInventoryReceipt

func DecodeInventoryReceipt(reader io.Reader, request InventoryRequest) (InventoryReceipt, error)

func NewInventoryReceipt

func NewInventoryReceipt(request InventoryRequest, status InventoryStatus, adapterExecutableSHA256 string, observations []InventoryObservation, blockerIDs []string) (InventoryReceipt, error)

NewInventoryReceipt constructs a value-free receipt from a canonical ordered observation set. Ready receipts require every request binding; non-ready receipts may carry the exact ordered subset collected before the blocker.

type InventoryRequest

type InventoryRequest struct {
	SchemaVersion        string             `json:"schemaVersion"`
	Scope                string             `json:"scope"`
	ProfileSHA256        string             `json:"profileSha256"`
	RunNonceSHA256       string             `json:"runNonceSha256"`
	AdapterCatalogSHA256 string             `json:"adapterCatalogSha256"`
	Bindings             []InventoryBinding `json:"bindings"`
	ProductionReady      bool               `json:"productionReady"`
}

InventoryRequest asks a downstream adapter to discover an exact, bounded set of symbolic bindings. Digest fields bind private runtime state without putting that state into the public protocol.

func DecodeInventoryRequest

func DecodeInventoryRequest(reader io.Reader) (InventoryRequest, error)

func NewInventoryRequest

func NewInventoryRequest(profileSHA256, runNonceSHA256, adapterCatalogSHA256 string, bindings []InventoryBinding) (InventoryRequest, error)

NewInventoryRequest returns the canonical request ordering used for hashing, signing, replay comparison, and exact receipt matching.

type InventoryStatus

type InventoryStatus string

Jump to

Keyboard shortcuts

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