Skip to content

Fix: Preserve on_connection_init.response policies when decoding WebBrokerApi xDS bindings #1963

Description

@coderabbitai

Summary

When decoding WebBrokerApi policies from xDS EventChannelResource in event-gateway/gateway-runtime/internal/xdsclient/handler.go, the current implementation treats on_connection_init only as a flat []interface{} and maps all policies into OnConnectionInit.Request. This means any xDS payload using the nested request/response form will silently drop response policies, which can never reach the runtime.

Fix Required

Update toWebBrokerApiBinding (and its per-channel equivalent) to accept both forms:

  • If on_connection_init is a map[string]interface{} with request and/or response keys, decode each side separately into OnConnectionInit.Request and OnConnectionInit.Response.
  • Otherwise, fall back to the existing flat-array behavior and populate Request for backward compatibility.

The same fix applies at both the API-level policies block and the per-channel policies block in toWebBrokerApiBinding.

References

Requested by

@senthuran16

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions