feat(gateway-controller): scope immutable gateway write-blocking middleware to management routes only
Open
@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:
- Create a dedicated route group for management endpoints in
main.goand apply the middleware only to that group, or - 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
- Raised during review of PR #1678 (https://github.com/wso2/api-platform/pull/1678), comment: https://github.com/wso2/api-platform/pull/1678#discussion_r3055363018
- Deferred from PR #1678 by @renuka-fernando to be addressed in a follow-up.
Assignee
@renuka-fernando
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.