Commit 6281288
Olivier Gintrand
fix(admin): preserve OAuth client_secret when editing gateways and A2A agents
When editing a gateway or A2A agent via the admin UI, the client_secret
field was set to empty string in the edit form (unlike all other secret
fields which use the masked placeholder). The backend then received an
empty value and silently dropped the client_secret key from oauth_config,
causing the existing encrypted secret to be lost on save.
This fix applies two layers of defense:
Backend (admin.py):
- Gateway and A2A agent edit handlers now send the masked placeholder
value when client_secret is empty/masked, so the service layer's
protect_oauth_config_for_storage() preserves the existing encrypted
secret from the database.
Frontend (gateways.js, a2aAgents.js, servers.js):
- Edit forms now show MASKED_AUTH_VALUE when a client_secret exists,
consistent with how bearer tokens, passwords, and other secrets are
handled in the UI.
Signed-off-by: Olivier Gintrand <olivier.gintrand@forterro.com>1 parent c04f65e commit 6281288
File tree
4 files changed
+23
-6
lines changed- mcpgateway
- admin_ui
4 files changed
+23
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12394 | 12394 | | |
12395 | 12395 | | |
12396 | 12396 | | |
12397 | | - | |
12398 | | - | |
| 12397 | + | |
| 12398 | + | |
12399 | 12399 | | |
12400 | 12400 | | |
| 12401 | + | |
| 12402 | + | |
| 12403 | + | |
12401 | 12404 | | |
12402 | 12405 | | |
12403 | 12406 | | |
| |||
15719 | 15722 | | |
15720 | 15723 | | |
15721 | 15724 | | |
15722 | | - | |
15723 | | - | |
| 15725 | + | |
| 15726 | + | |
15724 | 15727 | | |
15725 | 15728 | | |
| 15729 | + | |
| 15730 | + | |
| 15731 | + | |
15726 | 15732 | | |
15727 | 15733 | | |
15728 | 15734 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
513 | 513 | | |
514 | 514 | | |
515 | 515 | | |
516 | | - | |
| 516 | + | |
517 | 517 | | |
518 | 518 | | |
519 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
513 | | - | |
| 513 | + | |
514 | 514 | | |
515 | 515 | | |
516 | 516 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
| 3 | + | |
3 | 4 | | |
4 | 5 | | |
5 | 6 | | |
| |||
857 | 858 | | |
858 | 859 | | |
859 | 860 | | |
| 861 | + | |
| 862 | + | |
| 863 | + | |
| 864 | + | |
| 865 | + | |
| 866 | + | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
860 | 871 | | |
861 | 872 | | |
862 | 873 | | |
| |||
0 commit comments