Documentation
¶
Index ¶
- Constants
- func GovernedEventPayloadHash(topic string, payload []byte) string
- func WriteEvent(w io.Writer, e *Event) error
- type Client
- func (c *Client) Close() error
- func (c *Client) Publish(topic string, payload []byte) error
- func (c *Client) PublishGoverned(event *Event, intent decision.Intent, result decision.Decision) error
- func (c *Client) PublishGovernedWithDisclosure(event *Event, intent decision.Intent, result decision.Decision, ...) error
- func (c *Client) Recv() (*Event, error)
- type DecisionEventVerifier
- type Event
- type GovernedDisclosureReceiptRecorder
- type GovernedEvent
- type GovernedEventVerifier
- type GovernedReceiptRecorder
- type Server
- type Service
- func (s *Service) Name() string
- func (s *Service) Order() int
- func (s *Service) RequireGovernedContentInspection(require bool)
- func (s *Service) SetGovernedContentInspector(inspector decision.DisclosureContentInspector)
- func (s *Service) SetGovernedPublication(verifier GovernedEventVerifier, require bool)
- func (s *Service) SetGovernedReceiptRecorder(recorder GovernedReceiptRecorder, require bool)
- func (s *Service) SetGovernedTransferQuota(limiter *decision.TransferQuotaLimiter)
- func (s *Service) SetTopicPolicy(p TopicPolicy)
- func (s *Service) Start(ctx context.Context, deps coreapi.Deps) error
- func (s *Service) Stop(ctx context.Context) error
- type TopicPolicy
Constants ¶
const GovernedTopic = "\x00pilot.governed.v1"
GovernedTopic is reserved for a signed publication envelope. The broker unwraps it only after local verification and forwards the original topic and payload to subscribers; subscribers never receive this transport topic.
Variables ¶
This section is empty.
Functions ¶
func GovernedEventPayloadHash ¶ added in v0.2.4
GovernedEventPayloadHash returns the exact payload binding required by a GovernedTopic Intent. It includes topic and bytes, so callers must use it when creating the Intent before PublishGoverned.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client connects to a remote event stream broker on port 1002.
func Subscribe ¶
Subscribe connects to the event stream and subscribes to a topic. Use "*" to subscribe to all events.
func (*Client) PublishGoverned ¶ added in v0.2.4
func (c *Client) PublishGoverned(event *Event, intent decision.Intent, result decision.Decision) error
PublishGoverned publishes an event with its exact signed intent and authority decision. A broker configured to require governed publications verifies the envelope before forwarding the inner event to subscribers.
func (*Client) PublishGovernedWithDisclosure ¶ added in v0.2.4
func (c *Client) PublishGovernedWithDisclosure(event *Event, intent decision.Intent, result decision.Decision, disclosure decision.DisclosureBinding) error
PublishGovernedWithDisclosure publishes a signed event whose Intent binds typed disclosure metadata. The broker can require this form per topic.
type DecisionEventVerifier ¶ added in v0.2.4
type DecisionEventVerifier struct {
Enforcer *decision.Enforcer
Resource func(coreapi.Addr, *Event) string
RequireDisclosure bool
}
DecisionEventVerifier is the reference broker-side verifier. Resource must return the exact local resource for the incoming publication (for example, "eventstream:alerts"). It prevents a valid decision for one topic from being replayed to another topic at the same broker.
func (DecisionEventVerifier) VerifyGovernedEvent ¶ added in v0.2.4
func (verifier DecisionEventVerifier) VerifyGovernedEvent(ctx context.Context, remote coreapi.Addr, governed GovernedEvent) error
type Event ¶
Event is a typed message published to the event stream. Wire format: [2-byte topic length][topic][4-byte payload length][payload]
func EncodeGovernedEvent ¶ added in v0.2.4
func EncodeGovernedEvent(event GovernedEvent) (*Event, error)
type GovernedDisclosureReceiptRecorder ¶ added in v0.2.4
type GovernedDisclosureReceiptRecorder interface {
RecordGovernedDisclosureReceipt(context.Context, decision.Intent, decision.Decision, decision.DisclosureBinding) error
}
GovernedDisclosureReceiptRecorder records V2 evidence for typed governed publications. Brokers fail closed instead of recording a V1 receipt that omits disclosure proof.
type GovernedEvent ¶ added in v0.2.4
type GovernedEvent struct {
Version uint16 `json:"version"`
Topic string `json:"topic"`
Payload []byte `json:"payload"`
Disclosure *decision.DisclosureBinding `json:"disclosure,omitempty"`
Intent decision.Intent `json:"intent"`
Decision decision.Decision `json:"decision"`
}
GovernedEvent transports one published Event with its exact signed intent and authority decision. Its payload binding includes both topic and bytes, so neither can be changed after authorization.
func DecodeGovernedEvent ¶ added in v0.2.4
func DecodeGovernedEvent(event *Event) (GovernedEvent, error)
func NewGovernedEvent ¶ added in v0.2.4
func NewGovernedEventWithDisclosure ¶ added in v0.2.4
func NewGovernedEventWithDisclosure(event *Event, intent decision.Intent, result decision.Decision, disclosure decision.DisclosureBinding) (GovernedEvent, error)
NewGovernedEventWithDisclosure creates a governed event whose Intent binds canonical disclosure metadata. The caller is responsible for requesting a Decision for that exact disclosure-bound Intent before publication.
func (GovernedEvent) Event ¶ added in v0.2.4
func (event GovernedEvent) Event() *Event
func (GovernedEvent) Validate ¶ added in v0.2.4
func (event GovernedEvent) Validate() error
type GovernedEventVerifier ¶ added in v0.2.4
type GovernedEventVerifier interface {
VerifyGovernedEvent(context.Context, coreapi.Addr, GovernedEvent) error
}
GovernedEventVerifier verifies a governed publication against the local broker's authority state before it is distributed to subscribers.
type GovernedReceiptRecorder ¶ added in v0.2.4
type GovernedReceiptRecorder interface {
RecordGovernedReceipt(context.Context, decision.Intent, decision.Decision) error
}
GovernedReceiptRecorder durably records a broker-side enforcement receipt for a verified governed publication before it is fanned out to subscribers. Required enterprise deployments treat a recorder failure as a publication denial, so an event is never delivered without its evidence.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is a pub/sub event broker on port 1002. Clients connect, subscribe to topics, and publish events. The first event from a client is treated as a subscription: - Topic "*" subscribes to all events - Any other topic subscribes to that specific topic Subsequent events are published to all matching subscribers.
func (*Server) ListenAndServe ¶
ListenAndServe binds port 1002 and starts the broker.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the L11 plugin adapter. cmd/daemon/main.go (L12) and cmd/pilotctl _daemon-run construct it via NewService and register via daemon.RegisterPlugin.
func NewService ¶
func NewService() *Service
NewService returns a Service ready for daemon.RegisterPlugin.
func (*Service) Order ¶
Order: 120 — after the trust subsystem (50) and other application services that may want to publish before the broker is up.
func (*Service) RequireGovernedContentInspection ¶ added in v0.2.4
RequireGovernedContentInspection makes startup fail closed when a local DLP hook is absent. Call this from the enterprise attachment after an operator has supplied the tenant-local inspector.
func (*Service) SetGovernedContentInspector ¶ added in v0.2.4
func (s *Service) SetGovernedContentInspector(inspector decision.DisclosureContentInspector)
SetGovernedContentInspector installs a receiver-local DLP hook. It runs after a signed governed envelope has passed its local policy ceiling and before the event reaches subscribers. The hook receives a reader over the event bytes; it never runs in the central decision authority.
func (*Service) SetGovernedPublication ¶ added in v0.2.4
func (s *Service) SetGovernedPublication(verifier GovernedEventVerifier, require bool)
SetGovernedPublication configures the broker-side authorization gate for published events. When require is true every publication must be a signed governed envelope. Call before Start; a required gate without a verifier makes Start fail closed.
func (*Service) SetGovernedReceiptRecorder ¶ added in v0.2.4
func (s *Service) SetGovernedReceiptRecorder(recorder GovernedReceiptRecorder, require bool)
SetGovernedReceiptRecorder attaches a durable evidence recorder to governed publications. When require is true the broker refuses to start without both a required governed gate and this recorder.
func (*Service) SetGovernedTransferQuota ¶ added in v0.2.4
func (s *Service) SetGovernedTransferQuota(limiter *decision.TransferQuotaLimiter)
SetGovernedTransferQuota installs a receiver-local per-agent admission quota. It is charged only after a signed governed event verifies, using the signed Intent.AgentID rather than a transport address.
func (*Service) SetTopicPolicy ¶ added in v0.2.3
func (s *Service) SetTopicPolicy(p TopicPolicy)
SetTopicPolicy installs a TopicPolicy for subscription authorization. Must be called before Start. A nil value is ignored (policy stays at the previous setting, which defaults to allow-all).
type TopicPolicy ¶ added in v0.2.3
TopicPolicy is the authorization gate for topic subscription. Implementations check whether a peer may subscribe to a named topic. The enabled service uses an allow-all policy unless its caller installs a stricter implementation.