wso2 / wso2/api-platform

feat(gateway-controller): scope immutable gateway write-blocking middleware to management routes only

Open
#1,682 0 comments 0 reactions 1 assignee View on GitHub

@renuka-fernando is already working on this.

Since Apr 10, 2026.

Dominant language
Go
Stars
71
Forks
111
Avg merge
1d 14h
Merged PRs (30d)
110

Description

Summary

When immutable gateway mode is enabled, the ImmutableGW.Middleware() in gateway/gateway-controller/pkg/immutable/loader.go blocks all POST, PUT, and DELETE requests globally. While all currently registered routes are management endpoints, this global placement creates a maintenance risk: future developers could inadvertently add non-management mutating endpoints (e.g., health checks, admin callbacks, webhook receivers) that would be unexpectedly blocked.

Proposed Fix

Either:

  1. Create a dedicated route group for management endpoints in main.go and apply the middleware only to that group, or
  2. Update the middleware body to check the request path (e.g., c.Request.URL.Path) and only enforce the write-block for the management route prefix(s).

Context

Assignee

@renuka-fernando

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.