mcp-context-forge icon indicating copy to clipboard operation
mcp-context-forge copied to clipboard

[BUG]: API Calls - API Tokens- Create / Update API calls are not saving the correct data

Open IuliaGaitan opened this issue 10 months ago • 1 comments

🐞 Bug Summary

API Calls - API Tokens- Create / Update API calls are not saving the correct data. Create not saving is_active": false or "is_revoked": true. Update is not updating any value.


🧩 Affected Component

Select the area of the project impacted:

  • [X] mcpgateway - API
  • [ ] mcpgateway - UI (admin panel)
  • [ ] mcpgateway.wrapper - stdio wrapper
  • [ ] Federation or Transports
  • [ ] CLI, Makefiles, or shell scripts
  • [ ] Container setup (Docker/Podman/Compose)
  • [ ] Other (explain below)

🔁 Steps to Reproduce

  1. Go to Swagger or use curl
  2. Use POST or PUT on http://localhost:8000/tokens/d53c89d4-84d1-4c19-9497-afa0bbe24bec or http://localhost:4444/tokens
  3. Check results

🤔 Results

The data on API Tokens is not updated as requested.

Image Image

🤔 Expected Behavior

The API calls should update the value as requested.


📓 Logs / Error Output

Paste any relevant stack traces or logs here. ⚠️ Do not paste secrets, credentials, or tokens.


🧠 Environment Info

You can retrieve most of this from the /version endpoint.

Key Value
Version or commit v0.128.0
Runtime Python 3.12.3
Platform / OS Linux 6.6.87.2-microsoft-standard-WSL2 (x86_64)
Container none

🧩 Additional Context (optional)

Related with #2390

IuliaGaitan avatar Jan 29 '26 15:01 IuliaGaitan

Thank you for the detailed report.

Confirmed: The is_active field exists in TokenResponse but is missing from TokenCreateRequest and TokenUpdateRequest schemas. Values passed to these fields are silently ignored by Pydantic.

Fix: Add is_active to the request schemas and wire it through the service layer. For is_revoked, this will remain read-only since token revocation uses a dedicated endpoint (DELETE /tokens/{id}) that maintains an audit trail.

crivetimihai avatar Jan 30 '26 10:01 crivetimihai