Documentation
¶
Overview ¶
Package provideradapter defines provider-neutral protocols between CloudRING core and downstream infrastructure adapters.
Index ¶
- Constants
- Variables
- func InventoryRequestSHA256(request InventoryRequest) (string, error)
- func ObservationCommitmentSHA256(request InventoryRequest, rawNonce []byte, binding InventoryBinding, ...) (string, error)
- func RunNonceSHA256(rawNonce []byte) (string, error)
- func ValidateInventoryReceipt(request InventoryRequest, receipt InventoryReceipt) error
- func ValidateInventoryRequest(request InventoryRequest) error
- type BindingClass
- type InventoryBinding
- type InventoryObservation
- type InventoryReceipt
- type InventoryRequest
- type InventoryStatus
Constants ¶
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 ¶
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 ¶
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