Skip to content

Add form-urlencoded content-type support for gateway testing#1378

Merged
crivetimihai merged 4 commits intomainfrom
feat/gw-test-form-urlencoded
Nov 4, 2025
Merged

Add form-urlencoded content-type support for gateway testing#1378
crivetimihai merged 4 commits intomainfrom
feat/gw-test-form-urlencoded

Conversation

@shoummu1
Copy link
Copy Markdown
Collaborator

@shoummu1 shoummu1 commented Oct 31, 2025

📌 Summary

Adds application/x-www-form-urlencoded content-type support to the gateway testing interface, enabling proper testing of OAuth2 token endpoints.

OAuth2 token endpoints require application/x-www-form-urlencoded requests. Current implementation only supports JSON, making OAuth2 testing impossible via admin UI.

🔗 Related Issue

Closes: #1111

📐 Changes

  • Backend: Add content-type detection in /admin/gateways/test endpoint
  • Schema: Add content_type field to GatewayTestRequest (default: application/json)
  • UI: Add content-type dropdown to gateway test modal
  • JS: Dynamic label updates based on content-type selection

🧪 Testing

  • ✅ Unit tests for form-urlencoded handling
  • ✅ Integration tests for both content types
  • ✅ Manual testing with OAuth2 endpoints

✅ Checklist

  • Code formatted (make black isort pre-commit)
  • Fully backward compatible - defaults to application/json

@shoummu1 shoummu1 marked this pull request as ready for review October 31, 2025 12:31
shoummu1 and others added 4 commits November 4, 2025 23:01
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Apply black and trailing-whitespace fixes after rebase.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
@crivetimihai crivetimihai force-pushed the feat/gw-test-form-urlencoded branch from 8ee870f to a1dd426 Compare November 4, 2025 23:06
@crivetimihai crivetimihai merged commit d8067f0 into main Nov 4, 2025
45 checks passed
@crivetimihai crivetimihai deleted the feat/gw-test-form-urlencoded branch November 4, 2025 23:18
kcostell06 pushed a commit to kcostell06/mcp-context-forge that referenced this pull request Feb 24, 2026
* add form-urlencoded support for OAuth2 gateway testing

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix flake8

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* fix formatting

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>

* chore: apply formatting fixes from pre-commit hooks

Apply black and trailing-whitespace fixes after rebase.

Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>

---------

Signed-off-by: Shoumi <shoumimukherjee@gmail.com>
Signed-off-by: Mihai Criveti <crivetimihai@gmail.com>
Co-authored-by: Mihai Criveti <crivetimihai@gmail.com>
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.

[FEATURE][AUTH]: Support form-urlencoded for OAuth2/Keycloak

2 participants