Skip to content

abstracting event-gateway from gateway-controller#2623

Merged
Krishanx92 merged 1 commit into
wso2:mainfrom
tharindu1st:event-gw-refactor
Jul 13, 2026
Merged

abstracting event-gateway from gateway-controller#2623
Krishanx92 merged 1 commit into
wso2:mainfrom
tharindu1st:event-gw-refactor

Conversation

@tharindu1st

Copy link
Copy Markdown
Contributor

abstracting event-gateway from gateway-controller

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

@tharindu1st, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 36 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 815c9d39-1d75-4126-a24d-ede201d651ae

📥 Commits

Reviewing files that changed from the base of the PR and between 4c26c24 and 45ed1d7.

⛔ Files ignored due to path filters (7)
  • cli/src/go.sum is excluded by !**/*.sum
  • event-gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/it/go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
  • go.work.sum is excluded by !**/*.sum
  • platform-api/go.sum is excluded by !**/*.sum
📒 Files selected for processing (64)
  • cli/src/go.mod
  • event-gateway/Makefile
  • event-gateway/gateway-controller/Dockerfile
  • event-gateway/gateway-controller/Makefile
  • event-gateway/gateway-controller/api/eventgateway-openapi.yaml
  • event-gateway/gateway-controller/cmd/controller/main.go
  • event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go
  • event-gateway/gateway-controller/go.mod
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/pkg/api/eventgateway/generated.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • event-gateway/gateway-controller/pkg/config/validator.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • event-gateway/gateway-controller/pkg/handler/helpers.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • event-gateway/gateway-controller/pkg/translator/hooks.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/management/generated.go
  • gateway/gateway-controller/pkg/config/api_validator.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/pkg/controlplane/client.go
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • gateway/gateway-controller/pkg/policyxds/server.go
  • gateway/gateway-controller/pkg/policyxds/snapshot.go
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/xds/eventgateway_hooks.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/it/go.mod
  • platform-api/go.mod
📝 Walkthrough

Walkthrough

This PR adds a standalone Event Gateway Controller with WebSub and WebBroker management APIs, deployment and policy integrations, WebSubHub xDS support, webhook-secret handling, Docker builds, and extension hooks that move Event Gateway behavior out of the core gateway controller.

Changes

Event Gateway Controller

Layer / File(s) Summary
Controller contracts, runtime wiring, and builds
event-gateway/gateway-controller/api/*, event-gateway/gateway-controller/cmd/controller/*, event-gateway/gateway-controller/pkg/api/eventgateway/*, event-gateway/gateway-controller/{Dockerfile,Makefile,go.mod}, event-gateway/Makefile
Adds OpenAPI contracts, generated HTTP types, startup/bootstrap logic, configuration and validation, standalone image targets, and delegated parent build targets.
Management handlers and lifecycle services
event-gateway/gateway-controller/pkg/handler/*, event-gateway/gateway-controller/pkg/hubtopic/*, event-gateway/gateway-controller/pkg/eventlistener/*
Adds WebSub/WebBroker handlers, API-key and webhook-secret operations, shared request/deployment/event helpers, resource status responses, topic deregistration, and injected webhook-secret event handling.
Core extension points and Event Gateway translation
event-gateway/gateway-controller/pkg/{kindsupport,policyhooks,translator}/*, gateway/gateway-controller/pkg/{storage,utils,policy,policyxds,service,eventlistener,xds}/*
Registers non-core resource-kind behavior and delegates parsing, validation, topic maintenance, policy chains, xDS translation, WebSubHub resources, and webhook-secret integration through extension hooks.
Core contract removal and validation migration
gateway/gateway-controller/api/management-openapi.yaml, gateway/gateway-controller/pkg/api/management/generated.go, gateway/gateway-controller/pkg/config/*, gateway/gateway-controller/pkg/models/*, gateway/gateway-controller/pkg/xds/*
Removes legacy WebSub/WebBroker management contracts and core WebSub configuration paths while retaining REST API validation and updating related tests.
Dependency and metadata alignment
gateway/gateway-controller/{Dockerfile,Makefile,go.mod}, cli/src/go.mod, gateway/it/go.mod, platform-api/go.mod
Hardcodes regular functionality metadata and refreshes module dependency manifests.

Estimated code review effort: 5 (Critical) | ~120 minutes

Suggested reviewers: krishanx92, renuka-fernando, malinthaprasan, pubudu538, tharsanan1

🚥 Pre-merge checks | ✅ 3 | ❌ 2

❌ Failed checks (2 warnings)

Check name Status Explanation Resolution
Description check ⚠️ Warning The description is only a title and omits all required template sections such as Purpose, Goals, Approach, and tests. Replace it with the full template sections: Purpose, Goals, Approach, User stories, Documentation, Automation tests, Security checks, Samples, Related PRs, and Test environment.
Docstring Coverage ⚠️ Warning Docstring coverage is 67.12% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title matches the main change: separating event-gateway concerns from gateway-controller.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@tharindu1st
tharindu1st force-pushed the event-gw-refactor branch 2 times, most recently from ed5d020 to 0266a36 Compare July 13, 2026 06:22

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Note

Due to the large number of review comments, Critical severity comments were prioritized as inline comments.

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go (1)

96-118: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Apply the documented WebBroker list filters.

The generated API accepts displayName, version, and status, but this handler always returns every configuration.

Proposed fix
 	items := make([]any, 0, len(configs))
 	for _, cfg := range configs {
+		if params.DisplayName != nil && cfg.DisplayName != *params.DisplayName {
+			continue
+		}
+		if params.Version != nil && cfg.Version != *params.Version {
+			continue
+		}
+		if params.Status != nil && cfg.DesiredState != string(*params.Status) {
+			continue
+		}
 		items = append(items, buildResourceResponseFromStored(cfg.SourceConfiguration, cfg))
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go` around
lines 96 - 118, Update ListWebBrokerApis to apply the documented
params.DisplayName, params.Version, and params.Status filters before building
the items response. Match each configuration against only the provided query
parameters, preserve all configurations when filters are absent, and ensure
count reflects the filtered results.
🟠 Major comments (21)
event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go-116-154 (1)

116-154: 📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win

Duplicate topic-name derivation logic between topicsForWebSubUpdate and UpdateTopicManager.

Both functions independently re-implement the exact same "context+version+channel → topic name" mangling. Extracting a shared helper avoids the two falling out of sync if the naming rule ever changes.

♻️ Proposed refactor
+func webSubTopicSet(asyncData eventgateway.WebSubAPISpec) map[string]bool {
+	topics := make(map[string]bool)
+	var channels map[string]eventgateway.WebSubChannel
+	if asyncData.Channels != nil {
+		channels = *asyncData.Channels
+	}
+	for chName := range channels {
+		contextWithVersion := strings.ReplaceAll(asyncData.Context, "$version", asyncData.Version)
+		contextWithVersion = strings.TrimPrefix(contextWithVersion, "/")
+		contextWithVersion = strings.ReplaceAll(contextWithVersion, "/", "_")
+		name := strings.TrimPrefix(chName, "/")
+		topics[fmt.Sprintf("%s_%s", contextWithVersion, name)] = true
+	}
+	return topics
+}

Then both topicsForWebSubUpdate and UpdateTopicManager can call webSubTopicSet(asyncData) instead of duplicating the loop.

Also applies to: 159-185

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go` around lines
116 - 154, Extract the shared WebSub topic-name derivation from
topicsForWebSubUpdate and UpdateTopicManager into a helper such as
webSubTopicSet(asyncData). Have both functions use this helper for the
context/version/channel mangling and topic-set construction, while preserving
their existing registration and unregistration behavior.
event-gateway/gateway-controller/pkg/translator/hooks.go-337-343 (1)

337-343: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Add dns_cache_config to the dynamic forward proxy cluster
The DFP cluster and HTTP filter must use the same DNS cache settings; createDynamicForwardProxyCluster currently builds an empty dfpcluster.ClusterConfig{}, so the WebSubHub dynamic forward proxy path won’t pair correctly with the filter’s cache config. Consider sharing one dnsCacheConfig helper between both call sites to keep them in sync.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/translator/hooks.go` around lines 337 -
343, Update createDynamicForwardProxyCluster to populate
dfpcluster.ClusterConfig with the same dnsCacheConfig used by the dynamic
forward proxy HTTP filter. Extract or reuse a shared dnsCacheConfig helper so
both call sites consistently use identical DNS cache settings.
event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go-198-260 (1)

198-260: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Clone Spec.Vhosts before resolving sentinels.
unmarshalWebSubAPI/unmarshalWebBrokerApi assign the same decoded value to both SourceConfiguration and Configuration, so Spec.Vhosts aliases the stored source config. Mutating c.Spec.Vhosts in resolveWebSubVhostSentinels/resolveWebBrokerVhostSentinels overwrites the pristine input with resolved defaults. Copy Vhosts first, then mutate the copy.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go` around lines
198 - 260, In resolveWebSubVhostSentinels and resolveWebBrokerVhostSentinels,
clone c.Spec.Vhosts before applying any default or sentinel resolution,
including the nil-initialization path, so mutations affect only the returned
configuration. Preserve the existing source Vhosts value and assign the cloned
structure back to c.Spec.Vhosts before modifying its Main or Sandbox fields.
gateway/gateway-controller/pkg/xds/translator.go-838-849 (1)

838-849: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Restore the event-gateway feature gate event_gateway.enabled no longer suppresses hub-resource translation: BuildHubResources is now driven only by t.eventGatewayHooks != nil, and neither hook checks Enabled. A config with enabled = false will still generate WebSubHub cluster/listener resources when event-gateway support is compiled in.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/xds/translator.go` around lines 838 - 849,
Restore the event_gateway.enabled gate around the hub-resource translation in
the enclosing translator flow, so BuildHubResources is invoked only when
event-gateway hooks are present and the feature is enabled. Use the existing
event-gateway configuration’s Enabled value, while preserving the current error
handling and resource appends.
event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go-68-87 (1)

68-87: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound concurrent hub deregistration calls.

A deletion starts one goroutine and HTTP request per topic. Large configurations can exhaust sockets/goroutines or overload WebSubHub despite the per-request timeout. Use a configured worker limit or semaphore.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go` around lines 68
- 87, Bound concurrent topic deregistration in the loop surrounding
UnregisterTopicWithHub by introducing a configured worker limit or semaphore.
Ensure each goroutine acquires a slot before issuing the request and releases it
on completion, while preserving the existing timeout, logging, error counting,
and childWg synchronization behavior.
event-gateway/gateway-controller/pkg/handler/helpers.go-44-63 (1)

44-63: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Return sterile rendering errors to clients.

SecretError.Error(), TemplateParseError.Error(), and RenderError.Cause can expose secret identifiers or internal template details. Keep the complete error in server logs and return fixed messages.

Proposed fix
-	var secretErr *funcs.SecretError
-	if errors.As(renderErr, &secretErr) {
-		httputil.WriteJSON(w, http.StatusBadRequest, eventgateway.ErrorResponse{
-			Status:  "error",
-			Message: secretErr.Error(),
-		})
-		return true
-	}
-	var tmplParseErr *templateengine.TemplateParseError
-	if errors.As(renderErr, &tmplParseErr) {
-		httputil.WriteJSON(w, http.StatusBadRequest, eventgateway.ErrorResponse{
-			Status:  "error",
-			Message: tmplParseErr.Error(),
-		})
-		return true
-	}
 	httputil.WriteJSON(w, http.StatusBadRequest, eventgateway.ErrorResponse{
 		Status:  "error",
-		Message: fmt.Sprintf("Failed to render configuration: %v", renderErr.Cause),
+		Message: "Failed to render configuration",
 	})

As per coding guidelines, internal errors must be sanitized before marshaling into client-facing responses.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/handler/helpers.go` around lines 44 -
63, Sanitize client-facing responses in the render-error handling logic by
replacing secretErr.Error(), tmplParseErr.Error(), and renderErr.Cause with
fixed, non-sensitive messages. Preserve logging of the complete render error
separately, and keep the existing status and response structure in the
surrounding handler unchanged.

Source: Coding guidelines

event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go-132-154 (1)

132-154: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Clone configs before startup rendering
ConfigStore.GetAll() returns the stored *models.StoredConfig pointers, and templateengine.RenderSpec mutates cfg.Configuration in place. Rendering apiConfig here will overwrite the shared in-memory copy with resolved secrets; render a copy instead.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go` around
lines 132 - 154, Clone each config returned by ConfigStore.GetAll() before
passing it to templateengine.RenderSpec, and render the cloned StoredConfig
rather than the shared apiConfig pointer. Keep the existing error handling and
subsequent transformation flow intact, while ensuring resolved secrets never
mutate the stored in-memory configuration.

Source: Learnings

event-gateway/gateway-controller/api/eventgateway-openapi.yaml-10-16 (1)

10-16: 🔒 Security & Privacy | 🟠 Major | 🏗️ Heavy lift

Do not advertise Basic authentication over cleartext HTTP.

Both server URLs use http:// while the global security scheme is Basic authentication, exposing reusable credentials to interception. Publish HTTPS endpoints and ensure the controller serves TLS or is reachable only through enforced TLS termination.

Also applies to: 1149-1153

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/api/eventgateway-openapi.yaml` around lines
10 - 16, Update the OpenAPI server URLs in the event-gateway specification to
use HTTPS instead of HTTP for both local development and Docker/Kubernetes
deployment, while ensuring the controller or its ingress enforces TLS
termination so Basic authentication is never sent over cleartext.

Source: Linters/SAST tools

event-gateway/gateway-controller/cmd/controller/main.go-627-631 (1)

627-631: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound full request, response, and idle lifetimes.

ReadHeaderTimeout does not constrain slow request bodies or indefinitely blocked writes. Configure ReadTimeout, WriteTimeout, and IdleTimeout to prevent connection-exhaustion attacks.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/main.go` around lines 627 -
631, Update the http.Server initialization in the controller startup flow to
configure ReadTimeout, WriteTimeout, and IdleTimeout alongside the existing
ReadHeaderTimeout. Use appropriate bounded durations for each so request bodies,
responses, and keep-alive connections cannot remain indefinitely active.

Source: Linters/SAST tools

event-gateway/gateway-controller/cmd/controller/main.go-276-326 (1)

276-326: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not register secret endpoints with a nil webhook-secret service.

With no encryption providers, webhookSecretService remains nil, but the WebSub handler and secret routes are still installed. Those handlers dereference the service, causing every secret operation to fail or panic. Require encryption at startup when these APIs are enabled, or explicitly return a sterile service-unavailable response.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/main.go` around lines 276 -
326, Ensure the WebSub handler and webhook-secret routes are not registered when
webhookSecretService is nil; either require at least one encryption provider
during startup or make those endpoints return a service-unavailable response
without dereferencing the nil service. Update the route/handler registration
flow alongside the existing webhookSecretService initialization, preserving
normal behavior when encryption is configured.
event-gateway/gateway-controller/cmd/controller/main.go-583-591 (1)

583-591: 🩺 Stability & Availability | 🟠 Major | 🏗️ Heavy lift

Install a configurable request-body size limit.

The generated handlers receive the network request body without a global ceiling. Wrap requests with http.MaxBytesReader or an equivalent middleware using a configuration-backed safe default, and return HTTP 413 when exceeded.

As per coding guidelines, every network-originated reader must be bounded using a configurable limit and oversized requests must receive a generic HTTP 413 response.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/main.go` around lines 583 -
591, Update the outer middleware chain assembled in main around outerMiddlewares
and httpHandler to apply a configurable request-body size limit with a safe
default to every incoming request, using http.MaxBytesReader or equivalent.
Ensure requests exceeding the limit return a generic HTTP 413 response, while
preserving the existing correlation, error-handling, logging, metrics, and mux
routing behavior.

Source: Coding guidelines

gateway/gateway-controller/pkg/storage/memory.go-99-103 (1)

99-103: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Keep Add and Update atomic when the topic hook fails.

Both methods mutate indexes before calling the fallible hook. An error therefore leaves Add with an inserted configuration and Update with modified indexes pointing at the old configuration. Validate and invoke the hook before committing mutations, or roll back every changed map and topic entry.

Example ordering for Add
+	if cfg.Kind == "WebSubApi" && cs.webSubTopicUpdater != nil {
+		if err := cs.webSubTopicUpdater(cfg, cs.TopicManager); err != nil {
+			return err
+		}
+	}
+
 	cs.configs[cfg.UUID] = cfg
 	cs.handle[handleKey] = cfg.UUID
 	cs.nameVersion[key] = cfg.UUID
-
-	if cfg.Kind == "WebSubApi" && cs.webSubTopicUpdater != nil {
-		err := cs.webSubTopicUpdater(cfg, cs.TopicManager)
-		if err != nil {
-			return err
-		}
-	}

Apply the same validate-then-commit ordering to Update.

Also applies to: 148-152

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/storage/memory.go` around lines 99 - 103, Make
Add and Update atomic by validating and invoking cs.webSubTopicUpdater before
committing any configuration, index, or topic mutations. If the hook returns an
error, leave all existing maps and topic entries unchanged; otherwise apply the
complete mutation. Update both Add and Update flows consistently, or roll back
every mutation on failure.
gateway/gateway-controller/pkg/service/restapi/service.go-423-427 (1)

423-427: 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win

Do not abort replica convergence after the database deletion has committed.

A deregistration error returns before publishEvent, although the configuration is already deleted. The caller receives an error while local and replica caches retain a configuration that can no longer be retrieved or deleted again. Either deregister before the database mutation or log the cleanup failure and continue publishing the deletion event.

Proposed post-delete handling
 	if cfg.Kind == "WebSubApi" && s.webSubTopicDeregistrar != nil {
 		if err := s.webSubTopicDeregistrar(cfg, log); err != nil {
-			return nil, err
+			log.Warn("Failed to deregister WebSub topics after deleting configuration",
+				slog.String("id", cfg.UUID),
+				slog.Any("error", err))
 		}
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/service/restapi/service.go` around lines 423 -
427, Update the WebSub deregistration handling in the service method containing
publishEvent so a failure from webSubTopicDeregistrar does not return after the
database deletion has committed. Either move deregistration before the deletion
mutation, or retain the post-delete ordering while logging the error and
continuing to publish the deletion event; ensure successful deletion always
reaches publishEvent.
event-gateway/gateway-controller/cmd/controller/main.go-729-732 (1)

729-732: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Align webhook-secret authorization roles with the OpenAPI contract.

The OpenAPI operations authorize admin and developer, while runtime authorization grants admin and consumer. This denies documented developer access and grants consumers undocumented access to HMAC-secret creation and rotation.

Proposed role correction
-		"POST /websub-apis/{id}/secrets":                         {"admin", "consumer"},
-		"GET /websub-apis/{id}/secrets":                          {"admin", "consumer"},
-		"DELETE /websub-apis/{id}/secrets/{secretName}":          {"admin", "consumer"},
-		"POST /websub-apis/{id}/secrets/{secretName}/regenerate": {"admin", "consumer"},
+		"POST /websub-apis/{id}/secrets":                         {"admin", "developer"},
+		"GET /websub-apis/{id}/secrets":                          {"admin", "developer"},
+		"DELETE /websub-apis/{id}/secrets/{secretName}":          {"admin", "developer"},
+		"POST /websub-apis/{id}/secrets/{secretName}/regenerate": {"admin", "developer"},
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/main.go` around lines 729 -
732, Update the webhook-secret authorization entries in the route permissions
map to grant “admin” and “developer” instead of “admin” and “consumer” for
creation, retrieval, deletion, and regeneration endpoints. Keep the existing
route paths and permission structure unchanged.
event-gateway/gateway-controller/cmd/controller/main.go-157-162 (1)

157-162: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Honor event_gateway.enabled throughout bootstrap event-gateway/gateway-controller/cmd/controller/main.go:157-162

Enabled=false only skips Validate(): startup still registers WebSub/WebBroker kinds, wires the Event Gateway XDS hooks, installs the deregistrar, and mounts the Event Gateway HTTP handlers. Gate all of that on the flag, or remove the option if this binary always exposes Event Gateway.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/cmd/controller/main.go` around lines 157 -
162, Gate all Event Gateway bootstrap setup on eventGatewayCfg.Enabled, not only
eventGatewayCfg.Validate() in main: skip WebSub/WebBroker registration, Event
Gateway XDS hook wiring, deregistrar installation, and HTTP handler mounting
when disabled. If the binary must always expose Event Gateway, remove the
enabled option and its conditional validation instead.
gateway/gateway-controller/pkg/utils/api_deployment.go-332-341 (1)

332-341: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Register a configuration validator for WebBrokerApi.

The event-gateway registration supplies a WebBroker deploy parser but no KindConfigValidator. Consequently, every parsed eventgateway.WebBrokerApi reaches this default branch and fails with unexpected configuration type, making WebBroker create/update operations unusable.

Implement and register the WebBroker validator before enabling these endpoints.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/utils/api_deployment.go` around lines 332 -
341, The WebBrokerApi configuration lacks a registered KindConfigValidator,
causing rendered WebBroker configurations to hit the unexpected-type error.
Implement a validator for eventgateway.WebBrokerApi that returns its API name,
version, and validation errors, then register it in kindConfigValidators
alongside the existing validators before enabling WebBroker create/update
endpoints.
event-gateway/gateway-controller/pkg/handler/websub_api_handler.go-78-80 (1)

78-80: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Do not return deployment errors verbatim to clients.

DeployAPIConfiguration can wrap storage, parsing, and other internal failures. Returning err.Error() may expose database details or internal paths. Log the original error and map validation versus internal failures to sterile response objects.

As per coding guidelines, raw database errors, internal service details, and filesystem paths must be sanitized before marshaling HTTP responses.

Also applies to: 220-222

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/handler/websub_api_handler.go` around
lines 78 - 80, Update the error handling around DeployAPIConfiguration in the
websub API handler: log the original error for diagnostics, but never expose
err.Error() in the HTTP response. Map validation failures to the established
sterile validation response and all other failures to a generic internal-error
response, including the corresponding error path noted in the comment.

Source: Coding guidelines

event-gateway/gateway-controller/pkg/handler/websub_api_handler.go-45-45 (1)

45-45: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Bound request-body reads and return HTTP 413 when exceeded.

Both endpoints read attacker-controlled bodies without a size ceiling, allowing a request to consume unbounded memory. Use a configured limit and distinguish oversized payloads from malformed requests.

As per coding guidelines, wrap every network-originated io.Reader in io.LimitReader, source the limit from configuration, and return a generic HTTP 413 response when exceeded.

Also applies to: 176-176

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/handler/websub_api_handler.go` at line
45, Update the request-body reads in both endpoint handlers around the visible
io.ReadAll calls to wrap r.Body with io.LimitReader using the configured
request-size limit. Detect when the limit is exceeded, return a generic HTTP 413
response for oversized payloads, and preserve the existing malformed-request
handling for other read or parsing errors.

Source: Coding guidelines

event-gateway/gateway-controller/pkg/config/validator.go-106-113 (1)

106-113: 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Validate the policies inside allChannels and each channel value.

validateChannelPolicies only examines map keys, so empty/invalid policy names, versions, parameters, and every spec.AllChannels policy are accepted. This can persist configurations that fail later during policy translation.

Add policy-reference validation for every event policy group and cover missing/invalid versions with tests.

Based on learnings, Policy.Version is required and must remain a major-only value such as v1.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/config/validator.go` around lines 106 -
113, The channel validation flow around validateChannelPolicies must validate
policy references in every channel value and in spec.AllChannels, including
policy names, required major-only Policy.Version values such as v1, and
parameters. Extend or reuse the existing policy-reference validator for all
event policy groups, and add tests covering missing and invalid versions plus
allChannels validation.

Source: Learnings

gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go-83-101 (1)

83-101: 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Auth-failure payload doesn't match the mandated shape.

On missing auth context, this returns {"status":"error","message":"Authentication context not available"} with 401. The required contract is a fixed payload for all auth failures.

As per coding guidelines, auth failures must "return the exact same client-facing payload and HTTP status for invalid, expired, missing, or revoked credentials: 401 Unauthorized with {"error":"unauthorized","message":"Invalid or expired credentials."}."

🔒 Proposed fix to align the response payload
-		httputil.WriteJSON(w, http.StatusUnauthorized, errorResponse{
-			Status:  "error",
-			Message: "Authentication context not available",
-		})
+		httputil.WriteJSON(w, http.StatusUnauthorized, struct {
+			Error   string `json:"error"`
+			Message string `json:"message"`
+		}{
+			Error:   "unauthorized",
+			Message: "Invalid or expired credentials.",
+		})
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go` around
lines 83 - 101, Update the missing-auth-context branch in
ExtractAuthenticatedUser to return HTTP 401 with the mandated fixed payload:
error "unauthorized" and message "Invalid or expired credentials." Replace the
current errorResponse fields while preserving the existing logging and false
return behavior.

Source: Coding guidelines

gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go-61-78 (1)

61-78: 🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Unbounded request body read — add a size limit.

io.ReadAll(r.Body) has no size cap, so a large/slow request body can exhaust server memory. This helper is shared across every handler kind (REST, LLM, MCP, WebSub/WebBroker), so the risk is broad.

As per coding guidelines, "Wrap every user- or network-originated io.Reader in io.LimitReader before reading it into memory," with the limit "sourced from configuration... provide a safe default," and on exceeding it "return HTTP 413 with a generic message."

🛡️ Proposed fix to bound the request body size
+const maxRequestBodyBytes = 10 << 20 // TODO: source from config with a safe default
+
 func BindRequestBody(r *http.Request, request interface{}) error {
 	contentType := r.Header.Get("Content-Type")
 	contentType = strings.TrimSpace(contentType)
 	if idx := strings.Index(contentType, ";"); idx != -1 {
 		contentType = contentType[:idx]
 	}
 	contentType = strings.TrimSpace(strings.ToLower(contentType))

-	body, err := io.ReadAll(r.Body)
+	body, err := io.ReadAll(io.LimitReader(r.Body, maxRequestBodyBytes))
 	if err != nil {
 		return err
 	}
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go` around
lines 61 - 78, Update BindRequestBody to read r.Body through an io.LimitReader
with a configurable maximum request-body size and a safe default when
configuration is absent. Detect bodies exceeding the limit and return an HTTP
413 error with a generic message, while preserving the existing YAML/JSON
unmarshalling behavior for allowed payloads.

Source: Coding guidelines

🟡 Minor comments (2)
event-gateway/gateway-controller/pkg/translator/hooks.go-132-138 (1)

132-138: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Remove the unused parsedMainURL path handling parsedMainURL.Path is set here but never used; CreateRoute still takes constants.WEBSUB_PATH directly. Either wire the parsed path into the route or drop this block.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/translator/hooks.go` around lines 132 -
138, Remove the unused parsedMainURL.Path handling in the hook URL parsing flow:
delete the conditional that assigns constants.WEBSUB_PATH, while retaining URL
parsing and invalid-URL error handling because CreateRoute continues to receive
constants.WEBSUB_PATH directly.
event-gateway/gateway-controller/pkg/config/validator.go-77-90 (1)

77-90: 🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Report the actual displayName field in validation errors.

These errors currently point clients to nonexistent spec.name, preventing accurate field-level feedback.

Proposed fix
-			Field:   "spec.name",
+			Field:   "spec.displayName",

Apply this replacement to all three display-name errors.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/pkg/config/validator.go` around lines 77 -
90, Update all three validation errors in the display-name checks within the
validator to report the actual field path "spec.displayName" instead of the
nonexistent "spec.name"; leave their validation conditions and messages
unchanged.
🧹 Nitpick comments (1)
event-gateway/gateway-controller/Makefile (1)

48-134: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Consolidate repeated --build-context flags across the four docker targets.

build, build-and-push-multiarch, build-coverage-image, and build-debug all repeat the identical 7-line --build-context block, which is also what triggers checkmake's maxbodylength warnings. Extracting a shared variable reduces duplication and keeps the contexts in sync if a path ever changes.

♻️ Proposed refactor
+DOCKER_BUILD_CONTEXTS = \
+	--build-context sdk=../../sdk \
+	--build-context sdk-core=../../sdk/core \
+	--build-context common=../../common \
+	--build-context httpkit=../../httpkit \
+	--build-context gateway-controller=../../gateway/gateway-controller \
+	--build-context policies=$(POLICIES_BUILD_CONTEXT) \
+	--build-context target=target
+
 build: generate-server-code test ## Build Docker image using buildx
 	`@echo` "Building Docker image ($(IMAGE_NAME):$(VERSION))..."
 	`@mkdir` -p target
 	`@cp` ../../LICENSE target/
 	docker buildx build -f Dockerfile \
-		--build-context sdk=../../sdk \
-		--build-context sdk-core=../../sdk/core \
-		--build-context common=../../common \
-		--build-context httpkit=../../httpkit \
-		--build-context gateway-controller=../../gateway/gateway-controller \
-		--build-context policies=$(POLICIES_BUILD_CONTEXT) \
-		--build-context target=target \
+		$(DOCKER_BUILD_CONTEXTS) \
 		--build-arg VERSION=$(VERSION) \
 		--build-arg GIT_COMMIT=$(GIT_COMMIT) \
 		--target production \
 		-t $(IMAGE_NAME):$(VERSION) \
 		-t $(IMAGE_NAME):latest \
 		--load \
 		.

Apply the same substitution to the other three targets.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@event-gateway/gateway-controller/Makefile` around lines 48 - 134, Consolidate
the repeated seven --build-context arguments from build,
build-and-push-multiarch, build-coverage-image, and build-debug into one shared
Make variable. Replace each duplicated block with that variable while preserving
all existing context paths and build behavior, so future context changes remain
synchronized and maxbodylength warnings are avoided.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@event-gateway/gateway-controller/pkg/translator/hooks.go`:
- Around line 337-373: Update the first HttpFilter constructed after
dynamicFwdAny so its Name uses the dynamic-forward-proxy filter identifier, such
as the corresponding wellknown constant, while keeping the router name on the
second HttpFilter that carries routerAny.

---

Outside diff comments:
In `@event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go`:
- Around line 96-118: Update ListWebBrokerApis to apply the documented
params.DisplayName, params.Version, and params.Status filters before building
the items response. Match each configuration against only the provided query
parameters, preserve all configurations when filters are absent, and ensure
count reflects the filtered results.

---

Major comments:
In `@event-gateway/gateway-controller/api/eventgateway-openapi.yaml`:
- Around line 10-16: Update the OpenAPI server URLs in the event-gateway
specification to use HTTPS instead of HTTP for both local development and
Docker/Kubernetes deployment, while ensuring the controller or its ingress
enforces TLS termination so Basic authentication is never sent over cleartext.

In `@event-gateway/gateway-controller/cmd/controller/main.go`:
- Around line 627-631: Update the http.Server initialization in the controller
startup flow to configure ReadTimeout, WriteTimeout, and IdleTimeout alongside
the existing ReadHeaderTimeout. Use appropriate bounded durations for each so
request bodies, responses, and keep-alive connections cannot remain indefinitely
active.
- Around line 276-326: Ensure the WebSub handler and webhook-secret routes are
not registered when webhookSecretService is nil; either require at least one
encryption provider during startup or make those endpoints return a
service-unavailable response without dereferencing the nil service. Update the
route/handler registration flow alongside the existing webhookSecretService
initialization, preserving normal behavior when encryption is configured.
- Around line 583-591: Update the outer middleware chain assembled in main
around outerMiddlewares and httpHandler to apply a configurable request-body
size limit with a safe default to every incoming request, using
http.MaxBytesReader or equivalent. Ensure requests exceeding the limit return a
generic HTTP 413 response, while preserving the existing correlation,
error-handling, logging, metrics, and mux routing behavior.
- Around line 729-732: Update the webhook-secret authorization entries in the
route permissions map to grant “admin” and “developer” instead of “admin” and
“consumer” for creation, retrieval, deletion, and regeneration endpoints. Keep
the existing route paths and permission structure unchanged.
- Around line 157-162: Gate all Event Gateway bootstrap setup on
eventGatewayCfg.Enabled, not only eventGatewayCfg.Validate() in main: skip
WebSub/WebBroker registration, Event Gateway XDS hook wiring, deregistrar
installation, and HTTP handler mounting when disabled. If the binary must always
expose Event Gateway, remove the enabled option and its conditional validation
instead.

In `@event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go`:
- Around line 132-154: Clone each config returned by ConfigStore.GetAll() before
passing it to templateengine.RenderSpec, and render the cloned StoredConfig
rather than the shared apiConfig pointer. Keep the existing error handling and
subsequent transformation flow intact, while ensuring resolved secrets never
mutate the stored in-memory configuration.

In `@event-gateway/gateway-controller/pkg/config/validator.go`:
- Around line 106-113: The channel validation flow around
validateChannelPolicies must validate policy references in every channel value
and in spec.AllChannels, including policy names, required major-only
Policy.Version values such as v1, and parameters. Extend or reuse the existing
policy-reference validator for all event policy groups, and add tests covering
missing and invalid versions plus allChannels validation.

In `@event-gateway/gateway-controller/pkg/handler/helpers.go`:
- Around line 44-63: Sanitize client-facing responses in the render-error
handling logic by replacing secretErr.Error(), tmplParseErr.Error(), and
renderErr.Cause with fixed, non-sensitive messages. Preserve logging of the
complete render error separately, and keep the existing status and response
structure in the surrounding handler unchanged.

In `@event-gateway/gateway-controller/pkg/handler/websub_api_handler.go`:
- Around line 78-80: Update the error handling around DeployAPIConfiguration in
the websub API handler: log the original error for diagnostics, but never expose
err.Error() in the HTTP response. Map validation failures to the established
sterile validation response and all other failures to a generic internal-error
response, including the corresponding error path noted in the comment.
- Line 45: Update the request-body reads in both endpoint handlers around the
visible io.ReadAll calls to wrap r.Body with io.LimitReader using the configured
request-size limit. Detect when the limit is exceeded, return a generic HTTP 413
response for oversized payloads, and preserve the existing malformed-request
handling for other read or parsing errors.

In `@event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go`:
- Around line 68-87: Bound concurrent topic deregistration in the loop
surrounding UnregisterTopicWithHub by introducing a configured worker limit or
semaphore. Ensure each goroutine acquires a slot before issuing the request and
releases it on completion, while preserving the existing timeout, logging, error
counting, and childWg synchronization behavior.

In `@event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go`:
- Around line 116-154: Extract the shared WebSub topic-name derivation from
topicsForWebSubUpdate and UpdateTopicManager into a helper such as
webSubTopicSet(asyncData). Have both functions use this helper for the
context/version/channel mangling and topic-set construction, while preserving
their existing registration and unregistration behavior.
- Around line 198-260: In resolveWebSubVhostSentinels and
resolveWebBrokerVhostSentinels, clone c.Spec.Vhosts before applying any default
or sentinel resolution, including the nil-initialization path, so mutations
affect only the returned configuration. Preserve the existing source Vhosts
value and assign the cloned structure back to c.Spec.Vhosts before modifying its
Main or Sandbox fields.

In `@event-gateway/gateway-controller/pkg/translator/hooks.go`:
- Around line 337-343: Update createDynamicForwardProxyCluster to populate
dfpcluster.ClusterConfig with the same dnsCacheConfig used by the dynamic
forward proxy HTTP filter. Extract or reuse a shared dnsCacheConfig helper so
both call sites consistently use identical DNS cache settings.

In `@gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go`:
- Around line 83-101: Update the missing-auth-context branch in
ExtractAuthenticatedUser to return HTTP 401 with the mandated fixed payload:
error "unauthorized" and message "Invalid or expired credentials." Replace the
current errorResponse fields while preserving the existing logging and false
return behavior.
- Around line 61-78: Update BindRequestBody to read r.Body through an
io.LimitReader with a configurable maximum request-body size and a safe default
when configuration is absent. Detect bodies exceeding the limit and return an
HTTP 413 error with a generic message, while preserving the existing YAML/JSON
unmarshalling behavior for allowed payloads.

In `@gateway/gateway-controller/pkg/service/restapi/service.go`:
- Around line 423-427: Update the WebSub deregistration handling in the service
method containing publishEvent so a failure from webSubTopicDeregistrar does not
return after the database deletion has committed. Either move deregistration
before the deletion mutation, or retain the post-delete ordering while logging
the error and continuing to publish the deletion event; ensure successful
deletion always reaches publishEvent.

In `@gateway/gateway-controller/pkg/storage/memory.go`:
- Around line 99-103: Make Add and Update atomic by validating and invoking
cs.webSubTopicUpdater before committing any configuration, index, or topic
mutations. If the hook returns an error, leave all existing maps and topic
entries unchanged; otherwise apply the complete mutation. Update both Add and
Update flows consistently, or roll back every mutation on failure.

In `@gateway/gateway-controller/pkg/utils/api_deployment.go`:
- Around line 332-341: The WebBrokerApi configuration lacks a registered
KindConfigValidator, causing rendered WebBroker configurations to hit the
unexpected-type error. Implement a validator for eventgateway.WebBrokerApi that
returns its API name, version, and validation errors, then register it in
kindConfigValidators alongside the existing validators before enabling WebBroker
create/update endpoints.

In `@gateway/gateway-controller/pkg/xds/translator.go`:
- Around line 838-849: Restore the event_gateway.enabled gate around the
hub-resource translation in the enclosing translator flow, so BuildHubResources
is invoked only when event-gateway hooks are present and the feature is enabled.
Use the existing event-gateway configuration’s Enabled value, while preserving
the current error handling and resource appends.

---

Minor comments:
In `@event-gateway/gateway-controller/pkg/config/validator.go`:
- Around line 77-90: Update all three validation errors in the display-name
checks within the validator to report the actual field path "spec.displayName"
instead of the nonexistent "spec.name"; leave their validation conditions and
messages unchanged.

In `@event-gateway/gateway-controller/pkg/translator/hooks.go`:
- Around line 132-138: Remove the unused parsedMainURL.Path handling in the hook
URL parsing flow: delete the conditional that assigns constants.WEBSUB_PATH,
while retaining URL parsing and invalid-URL error handling because CreateRoute
continues to receive constants.WEBSUB_PATH directly.

---

Nitpick comments:
In `@event-gateway/gateway-controller/Makefile`:
- Around line 48-134: Consolidate the repeated seven --build-context arguments
from build, build-and-push-multiarch, build-coverage-image, and build-debug into
one shared Make variable. Replace each duplicated block with that variable while
preserving all existing context paths and build behavior, so future context
changes remain synchronized and maxbodylength warnings are avoided.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 2903102c-48b0-4930-b894-2126c23c0b19

📥 Commits

Reviewing files that changed from the base of the PR and between 39ef30e and da86e20.

⛔ Files ignored due to path filters (3)
  • event-gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
📒 Files selected for processing (61)
  • event-gateway/Makefile
  • event-gateway/gateway-controller/Dockerfile
  • event-gateway/gateway-controller/Makefile
  • event-gateway/gateway-controller/api/eventgateway-openapi.yaml
  • event-gateway/gateway-controller/cmd/controller/main.go
  • event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go
  • event-gateway/gateway-controller/go.mod
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/pkg/api/eventgateway/generated.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • event-gateway/gateway-controller/pkg/config/validator.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • event-gateway/gateway-controller/pkg/handler/helpers.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • event-gateway/gateway-controller/pkg/translator/hooks.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/management/generated.go
  • gateway/gateway-controller/pkg/config/api_validator.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/pkg/controlplane/client.go
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • gateway/gateway-controller/pkg/policyxds/server.go
  • gateway/gateway-controller/pkg/policyxds/snapshot.go
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/xds/eventgateway_hooks.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
  • gateway/gateway-controller/tests/integration/storage_test.go
💤 Files with no reviewable changes (13)
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/xds/translator_test.go

Comment thread event-gateway/gateway-controller/pkg/translator/hooks.go
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.1.2
Approved: ❌ No - Version constraint not met - approved versions: [>=v1.2.0]

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

2 similar comments
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.1.2
Approved: ❌ No - Version constraint not met - approved versions: [>=v1.2.0]

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.1.2
Approved: ❌ No - Version constraint not met - approved versions: [>=v1.2.0]

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 5

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@event-gateway/gateway-controller/api/eventgateway-openapi.yaml`:
- Around line 10-16: Update both server URLs in the OpenAPI servers section to
use https:// instead of http://, preserving their existing hosts, paths, and
descriptions so the basicAuth security scheme is not documented over cleartext.
- Around line 384-393: The WebSub secret endpoint roles are inconsistent between
the OpenAPI operations and generateAuthConfig. Reconcile all
`/websub-apis/{id}/secrets` operations and their corresponding entries in
generateAuthConfig so both documentation and enforcement use the same intended
role set, removing consumer access if the documented admin/developer contract is
authoritative.

In `@event-gateway/gateway-controller/cmd/controller/main.go`:
- Around line 729-732: The WebSub secret routes currently grant consumer access
instead of matching the documented roles. In the route permission entries for
POST/GET `/websub-apis/{id}/secrets`, DELETE
`/websub-apis/{id}/secrets/{secretName}`, and POST regenerate, replace
`consumer` with `developer` while retaining `admin`.

In `@event-gateway/gateway-controller/go.mod`:
- Line 73: Update the dependency pins in go.mod: raise golang.org/x/crypto from
v0.51.0 to the patched v0.52.0 or later, and update go.opentelemetry.io/otel/sdk
from v1.41.0 to a version outside the GHSA-hfvc-g4fc-pqhx vulnerable range.
Regenerate module checksums as needed.

In `@event-gateway/gateway-controller/pkg/translator/hooks.go`:
- Around line 305-311: Update createDynamicFwdListenerForWebSubHub to populate
VirtualHost.Domains with the parsed host/authority from WebSubHubURL rather than
the raw URL, while preserving the existing URL validation flow. Correct the
VirtualHost.Name typo from DYNAMIXC_FORWARD_PROXY_VHOST_WEBSUBHUB to
DYNAMIC_FORWARD_PROXY_VHOST_WEBSUBHUB.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: da0dad45-5531-4f05-b95c-4cc319ffca17

📥 Commits

Reviewing files that changed from the base of the PR and between da86e20 and ed3a9ab.

⛔ Files ignored due to path filters (7)
  • cli/src/go.sum is excluded by !**/*.sum
  • event-gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/it/go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
  • go.work.sum is excluded by !**/*.sum
  • platform-api/go.sum is excluded by !**/*.sum
📒 Files selected for processing (64)
  • cli/src/go.mod
  • event-gateway/Makefile
  • event-gateway/gateway-controller/Dockerfile
  • event-gateway/gateway-controller/Makefile
  • event-gateway/gateway-controller/api/eventgateway-openapi.yaml
  • event-gateway/gateway-controller/cmd/controller/main.go
  • event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go
  • event-gateway/gateway-controller/go.mod
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/pkg/api/eventgateway/generated.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • event-gateway/gateway-controller/pkg/config/validator.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • event-gateway/gateway-controller/pkg/handler/helpers.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • event-gateway/gateway-controller/pkg/translator/hooks.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/management/generated.go
  • gateway/gateway-controller/pkg/config/api_validator.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/pkg/controlplane/client.go
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • gateway/gateway-controller/pkg/policyxds/server.go
  • gateway/gateway-controller/pkg/policyxds/snapshot.go
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/xds/eventgateway_hooks.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/it/go.mod
  • platform-api/go.mod
💤 Files with no reviewable changes (13)
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
🚧 Files skipped from review as they are similar to previous changes (39)
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/pkg/handler/helpers.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/pkg/policyxds/server.go
  • event-gateway/gateway-controller/pkg/config/validator.go
  • event-gateway/gateway-controller/Dockerfile
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • event-gateway/Makefile
  • gateway/gateway-controller/pkg/xds/eventgateway_hooks.go
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • gateway/gateway-controller/pkg/config/api_validator.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/controlplane/client.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • gateway/gateway-controller/pkg/api/management/generated.go

Comment thread event-gateway/gateway-controller/api/eventgateway-openapi.yaml
Comment thread event-gateway/gateway-controller/api/eventgateway-openapi.yaml
Comment thread event-gateway/gateway-controller/cmd/controller/main.go Outdated
Comment thread event-gateway/gateway-controller/go.mod Outdated
Comment thread event-gateway/gateway-controller/pkg/translator/hooks.go
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: golang.org/x/term
Version: v0.43.0 (was v0.40.0)
Approved: ❌ No - Module not found in dependency registry

Dependency name: golang.org/x/text
Version: v0.37.0 (was v0.35.0)
Allowed range: >=v0.31.0
Approved: ✅ Yes

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: golang.org/x/term
Version: v0.43.0 (was v0.40.0)
Approved: ❌ No - Module not found in dependency registry

Dependency name: golang.org/x/text
Version: v0.37.0 (was v0.35.0)
Allowed range: >=v0.31.0
Approved: ✅ Yes

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

@tharindu1st

Copy link
Copy Markdown
Contributor Author

@coderabbitai review approve

@coderabbitai

coderabbitai Bot commented Jul 13, 2026

Copy link
Copy Markdown
Contributor

@tharindu1st I'll trigger a fresh review and then approve the PR.

✅ Action performed

Comments resolved and changes approved.


Review finished.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@event-gateway/gateway-controller/pkg/config/validator.go`:
- Around line 182-197: The DisplayName validation errors in validateAsyncData
use the incorrect spec.name field path and inconsistent message. Update all
three errors in this validation block to use spec.displayName and match the
corresponding validateWebBrokerData wording, preserving their existing
validation conditions.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 13a15f22-a866-49a3-9a16-cbf5678a7f5b

📥 Commits

Reviewing files that changed from the base of the PR and between ed3a9ab and 4c26c24.

⛔ Files ignored due to path filters (7)
  • cli/src/go.sum is excluded by !**/*.sum
  • event-gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/gateway-controller/go.sum is excluded by !**/*.sum
  • gateway/it/go.sum is excluded by !**/*.sum
  • go.work is excluded by !**/*.work
  • go.work.sum is excluded by !**/*.sum
  • platform-api/go.sum is excluded by !**/*.sum
📒 Files selected for processing (64)
  • cli/src/go.mod
  • event-gateway/Makefile
  • event-gateway/gateway-controller/Dockerfile
  • event-gateway/gateway-controller/Makefile
  • event-gateway/gateway-controller/api/eventgateway-openapi.yaml
  • event-gateway/gateway-controller/cmd/controller/main.go
  • event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go
  • event-gateway/gateway-controller/go.mod
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/pkg/api/eventgateway/generated.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • event-gateway/gateway-controller/pkg/config/validator.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • event-gateway/gateway-controller/pkg/handler/helpers.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • event-gateway/gateway-controller/pkg/translator/hooks.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/api/management/generated.go
  • gateway/gateway-controller/pkg/config/api_validator.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/pkg/controlplane/client.go
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • gateway/gateway-controller/pkg/policyxds/server.go
  • gateway/gateway-controller/pkg/policyxds/snapshot.go
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/pkg/xds/eventgateway_hooks.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/it/go.mod
  • platform-api/go.mod
💤 Files with no reviewable changes (13)
  • gateway/gateway-controller/pkg/utils/llm_provider_transformer_test.go
  • gateway/gateway-controller/tests/integration/storage_test.go
  • gateway/gateway-controller/pkg/config/config.go
  • gateway/gateway-controller/pkg/config/config_test.go
  • gateway/gateway-controller/pkg/api/handlers/resource_response.go
  • gateway/gateway-controller/pkg/models/stored_config_test.go
  • gateway/gateway-controller/pkg/config/parser.go
  • gateway/gateway-controller/pkg/utils/helpers.go
  • gateway/gateway-controller/pkg/api/handlers/handlers_test.go
  • gateway/gateway-controller/pkg/models/stored_config.go
  • gateway/gateway-controller/pkg/eventlistener/listener_test.go
  • gateway/gateway-controller/pkg/config/api_validator_test.go
  • gateway/gateway-controller/pkg/xds/translator_test.go
🚧 Files skipped from review as they are similar to previous changes (39)
  • event-gateway/gateway-controller/oapi-codegen.yaml
  • event-gateway/gateway-controller/go.mod
  • gateway/gateway-controller/Dockerfile
  • platform-api/go.mod
  • event-gateway/gateway-controller/pkg/webhooksecretxds/snapshot.go
  • event-gateway/gateway-controller/pkg/hubtopic/deregistrar.go
  • event-gateway/gateway-controller/pkg/handler/resource_response.go
  • event-gateway/gateway-controller/pkg/handler/server.go
  • event-gateway/gateway-controller/pkg/config/websub_topic_registration_test_staged.go.txt
  • event-gateway/gateway-controller/pkg/eventlistener/webhook_secret_handler.go
  • gateway/it/go.mod
  • gateway/gateway-controller/pkg/controlplane/client.go
  • event-gateway/Makefile
  • event-gateway/gateway-controller/Dockerfile
  • gateway/gateway-controller/pkg/utils/api_key.go
  • gateway/gateway-controller/pkg/policy/builder.go
  • gateway/gateway-controller/pkg/policyxds/combined_cache.go
  • event-gateway/gateway-controller/pkg/config/eventgateway_config.go
  • gateway/gateway-controller/pkg/api/handlers/handlerkit/handlerkit.go
  • event-gateway/gateway-controller/pkg/webhooksecretservice/webhook_secret.go
  • gateway/gateway-controller/go.mod
  • gateway/gateway-controller/pkg/config/validator_test.go
  • gateway/gateway-controller/pkg/xds/translator.go
  • gateway/gateway-controller/pkg/storage/memory.go
  • event-gateway/gateway-controller/pkg/kindsupport/kindsupport.go
  • event-gateway/gateway-controller/cmd/controller/runtime_bootstrap.go
  • gateway/gateway-controller/pkg/service/restapi/service.go
  • gateway/gateway-controller/pkg/policyxds/server.go
  • gateway/gateway-controller/Makefile
  • gateway/gateway-controller/pkg/utils/api_deployment.go
  • gateway/gateway-controller/api/management-openapi.yaml
  • gateway/gateway-controller/pkg/utils/api_deployment_test.go
  • event-gateway/gateway-controller/pkg/handler/webbroker_api_handler.go
  • gateway/gateway-controller/cmd/controller/main.go
  • gateway/gateway-controller/pkg/eventlistener/listener.go
  • event-gateway/gateway-controller/pkg/handler/websub_api_handler.go
  • event-gateway/gateway-controller/pkg/policyhooks/event_channel_translator.go
  • gateway/gateway-controller/pkg/storage/sql_store.go
  • gateway/gateway-controller/pkg/api/handlers/handlers.go

Comment thread event-gateway/gateway-controller/pkg/config/validator.go
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: golang.org/x/term
Version: v0.43.0 (was v0.40.0)
Approved: ❌ No - Module not found in dependency registry

Dependency name: golang.org/x/text
Version: v0.37.0 (was v0.35.0)
Allowed range: >=v0.31.0
Approved: ✅ Yes

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

1 similar comment
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Validation Results

Dependency name: golang.org/x/term
Version: v0.43.0 (was v0.40.0)
Approved: ❌ No - Module not found in dependency registry

Dependency name: golang.org/x/text
Version: v0.37.0 (was v0.35.0)
Allowed range: >=v0.31.0
Approved: ✅ Yes

Dependency name: github.com/envoyproxy/go-control-plane
Version: v0.14.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/envoyproxy/go-control-plane/envoy
Version: v1.36.0
Approved: ❌ No - Module not found in dependency registry

Dependency name: github.com/getkin/kin-openapi
Version: v0.133.0
Allowed range: >=v0.133.0
Approved: ✅ Yes

Dependency name: github.com/google/uuid
Version: v1.6.0
Allowed range: >=v1.6.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/parsers/toml/v2
Version: v2.2.0
Allowed range: >=v2.2.0
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/providers/file
Version: v1.2.1
Allowed range: >=v1.2.1
Approved: ✅ Yes

Dependency name: github.com/knadh/koanf/v2
Version: v2.3.2
Allowed range: >=v2.3.2
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: google.golang.org/protobuf
Version: v1.36.11
Allowed range: >=v1.36.11
Approved: ✅ Yes

Dependency name: github.com/gorilla/websocket
Version: v1.5.4-0.20250319132907-e064f32e3674 (was v1.5.3)
Allowed range: >=v1.5.3
Approved: ✅ Yes

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required

Dependency name: github.com/oapi-codegen/runtime
Version: v1.5.0 (was v1.1.2)
Approved: ❌ No - Scope mismatch - allowed scopes: [wso2cloud], but 'api-platform' scope is required


Next Steps

  1. Review the validation failures listed above
  2. Check if dependencies are in the approved dependency list
  3. Options to resolve:
    • Remove the unapproved dependencies from this PR
    • OR submit a PR to add these dependencies to the approved list in engineering-governance
  4. Once resolved, push changes to re-run validation

This PR is blocked until all dependencies are approved.

⚠️ Please verify the scope of the dependencies usage is necessary

@Krishanx92
Krishanx92 merged commit 2d7a1ac into wso2:main Jul 13, 2026
13 of 14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants