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

policy

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2026 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package policy evaluates a seat's committed capability manifest. It is the single place the platform decides what a seat may do; transports never change the answer (§7.2, §10.1).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Allows

func Allows(sm *compile.SeatManifest, resource, op string) bool

Allows reports whether any clause grants op on resource. It does not authorize a target; connection callers must use ConnectionAllowed.

func CanEditMission added in v0.7.0

func CanEditMission(sm *compile.SeatManifest, org *compile.Manifest, team string) bool

func CanReplyToSeat

func CanReplyToSeat(sm *compile.SeatManifest, sender string) bool

CanReplyToSeat reports whether the seat may reply to a message from sender: it has its own route to the sender, or the sender's route permits replies.

func Capability deprecated

func Capability(sm *compile.SeatManifest, resource string) (compile.Capability, bool)

Capability returns a resource's capability only when exactly one clause exists. It returns false for an absent or ambiguous resource.

Deprecated: use Allows or ConnectionAllowed for authorization; a resource can have several independent capability clauses.

func ConnectionAllowed

func ConnectionAllowed(sm *compile.SeatManifest, connection, op, target string) bool

ConnectionAllowed checks a gateway call against independent grant clauses. A single clause must grant both the operation and its target; fields from different clauses must never be combined to authorize a call.

func ConnectionTargetsAllowed added in v0.7.0

func ConnectionTargetsAllowed(sm *compile.SeatManifest, connection, op string, targets []string) bool

ConnectionTargetsAllowed authorizes all resources resolved by a connector. An empty set denotes an account-wide or unresolved operation and requires an unrestricted clause for that operation. No other operation's unrestricted grant can be borrowed. Empty entries are invalid concrete targets.

func Connections

func Connections(sm *compile.SeatManifest) map[string][]compile.Capability

Connections returns all connection clauses, preserving their operation/target pairings. A connection can have more than one independently scoped clause.

func HasBinding

func HasBinding(sm *compile.SeatManifest, binding string) bool

HasBinding reports whether the seat is the representative of binding.

func HasMemory

func HasMemory(sm *compile.SeatManifest, op string) bool

HasMemory reports whether the seat holds op on any memory store.

func MatchTarget

func MatchTarget(patterns []string, target string) bool

MatchTarget matches target against grant targets. A target pattern is an exact value, "*", or a prefix ending in "*".

func MatchesSubject added in v0.7.0

func MatchesSubject(sm *compile.SeatManifest, subject string) bool

MatchesSubject checks an explicit policy subject, never a role/display label.

func MemoryStores

func MemoryStores(sm *compile.SeatManifest, op string) []string

MemoryStores returns the keys of the memory stores on which the seat holds op.

func MessageLimit added in v0.7.0

func MessageLimit(sm *compile.SeatManifest, org *compile.Manifest) int

MessageLimit is the strictest opted-in team ceiling. Zero preserves legacy behavior.

func Reachable

func Reachable(sm *compile.SeatManifest) []string

Reachable returns the seats the seat can message or that can message it.

func SendEdge

func SendEdge(sm *compile.SeatManifest, recipient string) (compile.RouteEdge, bool)

SendEdge returns the declared route from the seat to recipient.

func TeamCoordination added in v0.7.0

func TeamCoordination(sm *compile.SeatManifest, org *compile.Manifest, team string) (*spec.TeamCoordination, bool)

TeamCoordination is visible only to declared members of an opted-in team.

func WorkTeam added in v0.7.0

func WorkTeam(org *compile.Manifest, store string) (string, *spec.TeamCoordination)

WorkTeam identifies the (unique) governance policy of a coordinated work store.

Types

This section is empty.

Jump to

Keyboard shortcuts

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