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 ¶
- func Allows(sm *compile.SeatManifest, resource, op string) bool
- func CanEditMission(sm *compile.SeatManifest, org *compile.Manifest, team string) bool
- func CanReplyToSeat(sm *compile.SeatManifest, sender string) bool
- func Capability(sm *compile.SeatManifest, resource string) (compile.Capability, bool)deprecated
- func ConnectionAllowed(sm *compile.SeatManifest, connection, op, target string) bool
- func ConnectionTargetsAllowed(sm *compile.SeatManifest, connection, op string, targets []string) bool
- func Connections(sm *compile.SeatManifest) map[string][]compile.Capability
- func HasBinding(sm *compile.SeatManifest, binding string) bool
- func HasMemory(sm *compile.SeatManifest, op string) bool
- func MatchTarget(patterns []string, target string) bool
- func MatchesSubject(sm *compile.SeatManifest, subject string) bool
- func MemoryStores(sm *compile.SeatManifest, op string) []string
- func MessageLimit(sm *compile.SeatManifest, org *compile.Manifest) int
- func Reachable(sm *compile.SeatManifest) []string
- func SendEdge(sm *compile.SeatManifest, recipient string) (compile.RouteEdge, bool)
- func TeamCoordination(sm *compile.SeatManifest, org *compile.Manifest, team string) (*spec.TeamCoordination, bool)
- func WorkTeam(org *compile.Manifest, store string) (string, *spec.TeamCoordination)
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 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 ¶
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 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.
Types ¶
This section is empty.