Help us shape the future of Go! Take the 2026 Go Developer Survey

manifest

package
v0.2.61 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2026 License: MIT Imports: 20 Imported by: 2

Documentation

Index

Constants

View Source
const (
	FileName              = "provider.codefly.yaml"
	SchemaVersionV0       = "codefly.provider-manifest/v0"
	ProtocolVersionV0     = "codefly.provider/v0"
	StateSchemaVersionV1  = uint32(1)
	DefaultDeletionRetain = "retain"
	SelectorVersionV1     = "v1"
)

Variables

This section is empty.

Functions

func RequestDescriptorDigest

func RequestDescriptorDigest(descriptor RequestDescriptor) (string, error)

Types

type Catalog

type Catalog struct {
	SchemaVersion       string            `json:"schema_version"`
	ProtocolVersion     string            `json:"protocol_version"`
	StateSchemaVersions []uint32          `json:"state_schema_versions"`
	Requests            []CatalogRequest  `json:"requests"`
	ResourceTypes       []CatalogResource `json:"resource_types"`
	ProjectionContracts []string          `json:"projection_contracts"`
	DiagnosticCodes     []string          `json:"diagnostic_codes"`
}

func (*Catalog) CanonicalBytes

func (c *Catalog) CanonicalBytes() ([]byte, error)

func (*Catalog) Digest

func (c *Catalog) Digest() (string, error)

type CatalogRequest

type CatalogRequest struct {
	ID     string `json:"id"`
	Digest string `json:"digest"`
}

type CatalogResource

type CatalogResource struct {
	ID      string   `json:"id"`
	Actions []string `json:"actions"`
}

type CredentialPurpose

type CredentialPurpose struct {
	ID                string `yaml:"id" json:"id"`
	MinimumScope      string `yaml:"minimum_scope" json:"minimum_scope"`
	PermittedConsumer string `yaml:"permitted_consumer" json:"permitted_consumer"`
}

type Manifest

type Manifest struct {
	SchemaVersion         string                 `yaml:"schema_version" json:"schema_version"`
	ProtocolVersion       string                 `yaml:"protocol_version" json:"protocol_version"`
	StateSchemaVersions   []uint32               `yaml:"state_schema_versions" json:"state_schema_versions"`
	Agent                 resources.Agent        `yaml:"agent" json:"agent"`
	DefaultDeletionPolicy string                 `yaml:"default_deletion_policy" json:"default_deletion_policy"`
	Permissions           PermissionDeclarations `yaml:"permissions" json:"permissions"`
	ResourceTypes         []ResourceType         `yaml:"resource_types" json:"resource_types"`
	Requests              []RequestDescriptor    `yaml:"requests" json:"requests"`
	OriginRules           []OriginRule           `yaml:"origin_rules" json:"origin_rules"`
	CredentialPurposes    []CredentialPurpose    `yaml:"credential_purposes" json:"credential_purposes"`
	ResponseSchemas       []ResponseSchema       `yaml:"response_schemas" json:"response_schemas"`
	Projections           []Projection           `yaml:"projections" json:"projections"`
	Sandbox               policy.SandboxPolicy   `yaml:"sandbox" json:"sandbox"`
	State                 StateCapabilities      `yaml:"state" json:"state"`
	DiagnosticNamespace   string                 `yaml:"diagnostic_namespace" json:"diagnostic_namespace"`
}

func Load

func Load(data []byte) (*Manifest, error)

func (*Manifest) AdmitRuntimeCatalog

func (m *Manifest) AdmitRuntimeCatalog(runtime *providerv0.RuntimeCatalog) (*Catalog, error)

func (*Manifest) CanonicalBytes

func (m *Manifest) CanonicalBytes() ([]byte, error)

func (*Manifest) Digest

func (m *Manifest) Digest() (string, error)

func (*Manifest) Validate

func (m *Manifest) Validate() error

func (*Manifest) ValidateCatalog

func (m *Manifest) ValidateCatalog(catalog *Catalog) error

type OriginRule

type OriginRule struct {
	ID                    string   `yaml:"id" json:"id"`
	Defaults              []string `yaml:"defaults" json:"defaults"`
	Schemes               []string `yaml:"schemes" json:"schemes"`
	HostPatterns          []string `yaml:"host_patterns" json:"host_patterns"`
	Ports                 []uint32 `yaml:"ports" json:"ports"`
	BindingOverride       string   `yaml:"binding_override" json:"binding_override"`
	PrivateNetworkClasses []string `yaml:"private_network_classes" json:"private_network_classes"`
}

type Permission

type Permission struct {
	ID                string `yaml:"id" json:"id"`
	Action            string `yaml:"action" json:"action"`
	Resource          string `yaml:"resource" json:"resource"`
	ResourceType      string `yaml:"resource_type" json:"resource_type"`
	Reason            string `yaml:"reason" json:"reason"`
	Risk              string `yaml:"risk" json:"risk"`
	CredentialPurpose string `yaml:"credential_purpose,omitempty" json:"credential_purpose,omitempty"`
}

type PermissionDeclarations

type PermissionDeclarations struct {
	Required []Permission `yaml:"required" json:"required"`
	Optional []Permission `yaml:"optional,omitempty" json:"optional,omitempty"`
}

type Projection

type Projection struct {
	ID       string `yaml:"id" json:"id"`
	Contract string `yaml:"contract" json:"contract"`
}

type RequestDescriptor

type RequestDescriptor struct {
	ID                  string   `yaml:"id" json:"id"`
	Permissions         []string `yaml:"permissions" json:"permissions"`
	ResourceType        string   `yaml:"resource_type" json:"resource_type"`
	Action              string   `yaml:"action" json:"action"`
	OriginRule          string   `yaml:"origin_rule" json:"origin_rule"`
	Operation           string   `yaml:"operation" json:"operation"`
	Method              string   `yaml:"method" json:"method"`
	PathTemplate        string   `yaml:"path_template" json:"path_template"`
	RemoteIDParameters  []string `yaml:"remote_id_parameters,omitempty" json:"remote_id_parameters,omitempty"`
	AllowedQueryFields  []string `yaml:"allowed_query_fields,omitempty" json:"allowed_query_fields,omitempty"`
	AllowedBodyFields   []string `yaml:"allowed_body_fields,omitempty" json:"allowed_body_fields,omitempty"`
	OwnershipBodyFields []string `yaml:"ownership_body_fields,omitempty" json:"ownership_body_fields,omitempty"`
	RequestByteBudget   uint64   `yaml:"request_byte_budget" json:"request_byte_budget"`
	ResponseByteBudget  uint64   `yaml:"response_byte_budget" json:"response_byte_budget"`
	ReadOnly            bool     `yaml:"read_only" json:"read_only"`
	ResponseSchema      string   `yaml:"response_schema" json:"response_schema"`
	CredentialPurposes  []string `yaml:"credential_purposes,omitempty" json:"credential_purposes,omitempty"`
}

type ResourceType

type ResourceType struct {
	ID              string   `yaml:"id" json:"id"`
	Actions         []string `yaml:"actions" json:"actions"`
	ImportIdentity  []string `yaml:"import_identity,omitempty" json:"import_identity,omitempty"`
	SupportsReplace bool     `yaml:"supports_replace,omitempty" json:"supports_replace,omitempty"`
	SupportsDelete  bool     `yaml:"supports_delete,omitempty" json:"supports_delete,omitempty"`
}

type ResponseDisposition

type ResponseDisposition string
const (
	ResponseForwardSafe      ResponseDisposition = "FORWARD_SAFE"
	ResponseSuppressPresence ResponseDisposition = "SUPPRESS_REPORT_PRESENCE"
	ResponseCaptureToSink    ResponseDisposition = "CAPTURE_TO_SINK"
)

type ResponseField

type ResponseField struct {
	Selector    Selector            `yaml:"selector" json:"selector"`
	Disposition ResponseDisposition `yaml:"disposition" json:"disposition"`
	Purpose     string              `yaml:"purpose,omitempty" json:"purpose,omitempty"`
}

type ResponseSchema

type ResponseSchema struct {
	ID     string          `yaml:"id" json:"id"`
	Fields []ResponseField `yaml:"fields" json:"fields"`
}

type Selector

type Selector struct {
	Version string `yaml:"version" json:"version"`
	Path    string `yaml:"path" json:"path"`
}

func (Selector) Validate

func (s Selector) Validate() error

type SelectorToken

type SelectorToken struct {
	Kind  SelectorTokenKind
	Key   string
	Index uint64
}

func ParseSelector

func ParseSelector(selector Selector) ([]SelectorToken, error)

type SelectorTokenKind

type SelectorTokenKind string
const (
	SelectorObjectKey     SelectorTokenKind = "object-key"
	SelectorExactIndex    SelectorTokenKind = "exact-index"
	SelectorArrayWildcard SelectorTokenKind = "array-wildcard"
)

type StateCapabilities

type StateCapabilities struct {
	SchemaVersions  []uint32 `yaml:"schema_versions" json:"schema_versions"`
	ImportIdentity  bool     `yaml:"import_identity" json:"import_identity"`
	Replace         bool     `yaml:"replace" json:"replace"`
	Delete          bool     `yaml:"delete" json:"delete"`
	StepwiseUpgrade bool     `yaml:"stepwise_upgrade" json:"stepwise_upgrade"`
}

Jump to

Keyboard shortcuts

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