// Governance Notifier — SPIRE Notifier plugin. // // Runs in SPIRE Server. Notifies the Guildhouse GovernanceService of credential // lifecycle events (issue, rotate, revoke) and submits MutationEnvelopes to the // NotaryService for merkle anchoring. package main import ( "context" "log" "github.com/hashicorp/go-plugin" "google.golang.org/grpc" ) var handshakeConfig = plugin.HandshakeConfig{ ProtocolVersion: 1, MagicCookieKey: "ServerAgent", MagicCookieValue: "GuildhouseSpire", } // GovernanceNotifierPlugin implements plugin.GRPCPlugin for the governance notifier. type GovernanceNotifierPlugin struct { plugin.Plugin Impl *GovernanceNotifier } func (p *GovernanceNotifierPlugin) GRPCServer(broker *plugin.GRPCBroker, s *grpc.Server) error { log.Println("governance-notifier: gRPC server registered") return nil } func (p *GovernanceNotifierPlugin) GRPCClient(ctx context.Context, broker *plugin.GRPCBroker, c *grpc.ClientConn) (interface{}, error) { return nil, nil } func main() { notifier := &GovernanceNotifier{} plugin.Serve(&plugin.ServeConfig{ HandshakeConfig: handshakeConfig, Plugins: map[string]plugin.Plugin{ "notifier": &GovernanceNotifierPlugin{Impl: notifier}, }, GRPCServer: plugin.DefaultGRPCServer, }) }