resourcescope

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2026 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package resourcescope holds non-secret, immutable connector scope rules. It does not resolve environments, credentials, or imported server metadata.

Index

Constants

Variables

View Source
var ErrInvalid = xerror.New(xerror.KindInvalidInput, "RESOURCE_SCOPE_INVALID", "resource scope or selector is unsupported or outside the permitted scope")

Functions

func ValidRelativeKey

func ValidRelativeKey(value string, allowEmpty bool) bool

ValidRelativeKey deliberately rejects encoded/ambiguous paths. S3 keys are literal; this policy does not decode input or normalize away traversal.

Types

type Identity

type Identity struct {
	PolicyID, DataSource, Operation, Contract, Revision, ObjectID, Representation string
}

Identity omits concrete target and selector settings from historical readback.

type S3

type S3 struct {
	Endpoint       string `json:"endpoint"`
	Region         string `json:"region"`
	Bucket         string `json:"bucket"`
	Prefix         string `json:"prefix"`
	DynamicKey     bool   `json:"dynamic_key"`
	ForcePathStyle bool   `json:"force_path_style"`
}

type Scope

type Scope struct {
	PolicyID       string                       `json:"policy_id"`
	DataSource     slug.Slug                    `json:"data_source"`
	Operation      slug.Slug                    `json:"operation"`
	Contract       slug.Slug                    `json:"contract"`
	Revision       slug.Slug                    `json:"revision"`
	ObjectID       string                       `json:"object_id"`
	Representation model.ContractRepresentation `json:"representation"`
	S3             *S3                          `json:"s3"`
}

Scope maps one pinned contract object to a logical saved operation. Concrete environment/binding selection remains a deployment responsibility.

func (*Scope) Identity

func (s *Scope) Identity() *Identity

func (Scope) Validate

func (s Scope) Validate() error

func (Scope) ValidateStatement

func (s Scope) ValidateStatement(raw json.RawMessage) error

ValidateStatement checks the supported S3 field roles before compilation. Only key, content and object metadata may contain execution substitutions.

Jump to

Keyboard shortcuts

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