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 CanReplyToSeat(sm *compile.SeatManifest, sender string) bool
- func Capability(sm *compile.SeatManifest, resource string) (compile.Capability, bool)
- func ConnectionAllowed(sm *compile.SeatManifest, connection, op, target 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 MemoryStores(sm *compile.SeatManifest, op string) []string
- func Reachable(sm *compile.SeatManifest) []string
- func SendEdge(sm *compile.SeatManifest, recipient string) (compile.RouteEdge, bool)
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 the seat holds op on resource.
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 ¶
func Capability(sm *compile.SeatManifest, resource string) (compile.Capability, bool)
Capability returns the seat's capability on resource (memory:<k>, connection:<k>).
func ConnectionAllowed ¶
func ConnectionAllowed(sm *compile.SeatManifest, connection, op, target string) bool
ConnectionAllowed checks a gateway call against the grant for the connection: the operation must be granted, and when the grant restricts targets the call's target must match one of them.
func Connections ¶
func Connections(sm *compile.SeatManifest) map[string]compile.Capability
Connections returns the seat's connection capabilities keyed by connection.
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 MemoryStores ¶
func MemoryStores(sm *compile.SeatManifest, op string) []string
MemoryStores returns the keys of the memory stores on which the seat holds op.
func Reachable ¶
func Reachable(sm *compile.SeatManifest) []string
Reachable returns the seats the seat can message or that can message it.
Types ¶
This section is empty.