Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions gateway/configs/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,14 @@ gateway_controller:
router:
# Gateway host for incoming requests
gateway_host: "*"
# Event Gateway (WebSub Hub) configuration
event_gateway:
enabled: true
websub_hub_url: "http://host.docker.internal"
websub_hub_port: 9098
router_host: "localhost"
websub_hub_listener_port: 8083
timeout_seconds: 10

# Access logs configuration
access_logs:
Expand Down
55 changes: 32 additions & 23 deletions gateway/examples/websubhub.yaml
Original file line number Diff line number Diff line change
@@ -1,32 +1,41 @@
# --------------------------------------------------------------------
# Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
#
# WSO2 LLC. licenses this file to you under the Apache License,
# Version 2.0 (the "License"); you may not use this file except
# in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
# --------------------------------------------------------------------

apiVersion: gateway.api-platform.wso2.com/v1alpha1
kind: async/websub
kind: WebSubApi
metadata:
name: websub-api-v1.0
name: WebSubHub-API
spec:
displayName: WebSub-API-New-API
version: v1.0
context: /websubnewapi
servers:
- url: http://host.docker.internal:9098
protocol: websub
vhosts:
main: "*"
channels:
- path: /pull-requests
subscribe:
policies:
- name: ModifyHeaders
version: v1.0.0
enabled: true
params:
requestHeaders:
- action: SET
name: operation-level-req-header
value: hello
responseHeaders:
- action: SET
name: operation-level-res-header
value: world
- path: /issues
subscribe:
policies:
- name: ModifyHeaders
version: v1.0.0
enabled: true
params:
requestHeaders:
- action: SET
name: operation-level-req-header
value: hello
responseHeaders:
- action: SET
name: operation-level-res-header
value: world
63 changes: 38 additions & 25 deletions gateway/gateway-controller/api/openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1750,9 +1750,7 @@ components:
example: RestApi
enum:
- RestApi
- async/websub
- async/websocket
- async/sse
- WebSubApi
metadata:
$ref: "#/components/schemas/Metadata"
spec:
Expand All @@ -1779,7 +1777,6 @@ components:
- context
- upstream
- operations
# - kind
properties:
displayName:
type: string
Expand Down Expand Up @@ -1964,20 +1961,13 @@ components:
WebhookAPIData:
type: object
required:
# - kind
- name
- displayName
- version
- context
- servers
- upstream
- channels
properties:
# kind:
# type: string
# description: API type
# example: async/websub
# enum:
# - async/websub
name:
displayName:
type: string
description: Human-readable API name (must be URL-friendly - only letters, numbers, spaces, hyphens, underscores, and dots allowed)
minLength: 1
Expand All @@ -1996,12 +1986,30 @@ components:
minLength: 1
maxLength: 200
example: /weather
servers:
type: array
description: List of backend service URLs (for REST APIs) or event hub URLs (for async APIs)
minItems: 1
items:
$ref: '#/components/schemas/Server'
upstream:
type: object
description: API-level upstream configuration
properties:
main:
$ref: "#/components/schemas/Upstream"
sandbox:
$ref: "#/components/schemas/Upstream"
vhosts:
type: object
required:
- main
description: Custom virtual hosts/domains for the API
properties:
main:
type: string
description: Custom virtual host/domain for production traffic
pattern: '^[a-zA-Z0-9\.\-]+$'
example: api.example.com
sandbox:
type: string
description: Custom virtual host/domain for sandbox traffic
pattern: '^[a-zA-Z0-9\.\-]+$'
example: sandbox-api.example.com
channels:
type: array
description: List of operations - HTTP operations for REST APIs or event/topic operations for async APIs
Expand Down Expand Up @@ -2101,6 +2109,11 @@ components:
summary:
type: string
example: Receive issue events.
policies:
type: array
description: List of policies applied only to this operation (overrides or adds to API-level policies)
items:
$ref: "#/components/schemas/Policy"
message:
$ref: '#/components/schemas/ChannelMessage'
publish:
Expand All @@ -2110,6 +2123,11 @@ components:
summary:
type: string
example: Publish issue events.
policies:
type: array
description: List of policies applied only to this operation (overrides or adds to API-level policies)
items:
$ref: "#/components/schemas/Policy"
message:
$ref: '#/components/schemas/ChannelMessage'
parameters:
Expand All @@ -2128,11 +2146,6 @@ components:
type: object
description: Protocol-specific channel bindings (arbitrary key/value structure).
additionalProperties: true
policies:
type: array
description: List of policies applied only to this operation (overrides or adds to API-level policies)
items:
$ref: '#/components/schemas/Policy'

# Message schema used within Channel publish/subscribe operations.
ChannelMessage:
Expand Down
Loading
Loading