You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -25,7 +25,18 @@ The Event Gateway is a lightweight, extensible runtime for managing event-driven
25
25
26
26
-**WebSubApi** — Multi-channel pub/sub API. Publishers send events via a webhook receiver; subscribers register callbacks at a hub endpoint. Each channel maps to a Kafka topic.
-**Policies** — Pluggable enforcement at three points: `subscribe` (hub requests), `inbound` (event ingress), `outbound` (event delivery).
28
+
-**Policies** — Pluggable enforcement at four points per channel:
29
+
30
+
| Policy point | YAML key | Triggered when |
31
+
|---|---|---|
32
+
|`on_subscription`|`subscribe`| A client subscribes at the hub |
33
+
|`on_unsubscription`|`unsubscribe`| A client unsubscribes at the hub |
34
+
|`on_message_received`|`inbound`| An event is published via the webhook receiver |
35
+
|`on_message_delivery`|`outbound`| An event is delivered to a subscriber callback |
36
+
37
+
Policies can be applied at two scopes:
38
+
-**`policies`** — applied uniformly to every channel in the API (e.g., authentication)
39
+
-**`channels.<name>`** — applied only to a specific named channel (e.g., RBAC per topic)
29
40
30
41
## Prerequisites
31
42
@@ -103,7 +114,12 @@ Two Postman collections are provided in [`spec/postman/`](spec/postman/):
103
114
104
115
#### Step 1: Create a WebSub API (Control Plane collection)
105
116
106
-
Use the **"Create Repo Watcher"** request. This registers a WebSub API with three channels (`issues`, `pull-requests`, `commits`) via the gateway controller, which pushes the configuration to the event gateway over xDS.
117
+
Use the **"Create Repo Watcher"** request. This registers a WebSub API with two channels (`issues`, `pull-requests`) via the gateway controller, which pushes the configuration to the event gateway over xDS.
118
+
119
+
The spec uses two policy scopes:
120
+
121
+
-**`policies`** — API-wide policies applied to every channel (e.g., authentication on every subscribe/unsubscribe)
122
+
-**`channels`** — Per-channel policies applied only to the named channel (e.g., RBAC per topic)
107
123
108
124
```
109
125
POST http://localhost:9090/api/management/v0.9/websub-apis
**Policy execution order:**`policies` policies run first, followed by the matching `channels` entry for that channel. Each policy object requires `name` and `version`; `params` is policy-specific.
325
+
239
326
## Configuration
240
327
241
328
### Runtime Configuration (`config.toml`)
@@ -276,7 +363,7 @@ When `websub_tls_enabled=true`, the event gateway serves `https://` on `websub_p
276
363
277
364
When the control plane is disabled, channels are loaded statically from [`gateway-runtime/configs/channels.yaml`](gateway-runtime/configs/channels.yaml). Two binding kinds are supported:
278
365
279
-
**WebSubApi** — Multi-channel API:
366
+
**WebSubApi** — Multi-channel API. The `policies` block at root level maps to `policies`; each channel's `policies` block maps to its `channels` entry:
description: Desired deployment state - 'deployed' (default) or 'undeployed'. When set to 'undeployed', the API is removed from router traffic but configuration, API keys, and policies are preserved for potential redeployment.
3774
3774
enum: [deployed, undeployed]
3775
3775
default: deployed
3776
3776
example: deployed
3777
3777
3778
+
# WebSubChannel defines a single channel entry with its per-channel policies.
3779
+
WebSubChannel:
3780
+
type: object
3781
+
description: A single channel definition with optional per-channel policy overrides.
0 commit comments