sourcecap

package
v3.20.9 Latest Latest
Warning

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

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

Documentation

Index

Constants

View Source
const (
	ModeDev     = "dev"
	ModeProd    = "prod"
	ModeAgentic = "agentic"
)
View Source
const (
	KindDatabase = "database"
	KindCode     = "code"
	KindFile     = "file"
	KindAPI      = "api"
)
View Source
const (
	ActionRead    = "read"
	ActionWrite   = "write"
	ActionDelete  = "delete"
	ActionWatch   = "watch"
	ActionExecute = "execute"
	ActionReload  = "reload"
	ActionQuery   = "query"
	ActionMutate  = "mutate"
	ActionUse     = "use"
)
View Source
const (
	EnforcementRuntime                   = "runtime"
	EnforcementRuntimeCoarseReadOnly     = "runtime_coarse_read_only"
	EnforcementExistingPolicy            = "existing_policy"
	EnforcementExistingReadOnlyAndPolicy = "existing_read_only_and_policy"
	EnforcementConfigAudit               = "config_audit"
)
View Source
const (
	KeyDataRead        = "data.read"
	KeyDataWrite       = "data.write"
	KeySchemaRead      = "schema.read"
	KeySchemaWrite     = "schema.write"
	KeyCodeSearch      = "code.search"
	KeyCodeRead        = "code.read"
	KeyCodeWrite       = "code.write"
	KeyCodeWatch       = "code.watch"
	KeyCodeInferDBRefs = "code.infer_db_refs"
	KeyFilesList       = "files.list"
	KeyFilesRead       = "files.read"
	KeyFilesWrite      = "files.write"
	KeyFilesDelete     = "files.delete"
	KeyFilesWatch      = "files.watch"
	KeyAPIRead         = "api.read"
	KeyAPIWrite        = "api.write"
)

Variables

This section is empty.

Functions

func CanonicalKind

func CanonicalKind(kind string) (string, error)

CanonicalKind normalizes a public sources[].kind value.

func CapabilityMap

func CapabilityMap() map[string][]string

CapabilityMap returns a stable map from source kind to capability keys.

func Examples

func Examples(kind, sourceName string) []string

Examples returns source capability examples for a configured source name.

func Kinds

func Kinds() []string

Kinds returns the canonical public source kinds in stable order.

func ValidKeyList

func ValidKeyList(kind string) string

ValidKeyList returns a human-readable valid key list for errors.

func ValidKeys

func ValidKeys(kind string) []string

ValidKeys returns valid capability keys for a source kind in stable order.

Types

type Definition

type Definition struct {
	Kind           string
	Key            string
	Action         string
	Summary        string
	Reason         string
	Recommendation string
	Severity       string
	Enforcement    string
	ReadOnlyBlocks bool
	DefaultDev     bool
	DefaultProd    bool
	DefaultAgentic bool
	MCPFlag        string
	ExampleValue   string
}

Definition is the source of truth for a public sources[].capabilities key.

func Definitions

func Definitions(kind string) []Definition

Definitions returns the capability definitions for a source kind.

func Lookup

func Lookup(kind, key string) (Definition, bool)

Lookup returns the definition for a source kind and capability key.

func (Definition) Default

func (d Definition) Default(mode string) bool

Default returns the secure default for a deployment mode.

Jump to

Keyboard shortcuts

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