Repository navigation
fix(ui): populate issuer field when editing OAuth gateway - #3756
Conversation
|
Thanks @kimsehwan96. Clean fix — correctly addresses #3755 by populating the missing |
The editGateway() function populates all OAuth config fields (client_id, token_url, authorization_url, redirect_uri, scopes) but omits the issuer field. This causes the issuer to be silently dropped when saving, breaking OAuth flows that depend on it. Signed-off-by: kimsehwan96 <[email protected]>
…t coverage Apply the same issuer field fix to the editA2AAgent function that was missing the same population logic. Add id="oauth-issuer-a2a-edit" to the A2A edit modal HTML template. Strengthen OAuth form-field assembly tests to verify all fields (issuer, token_url, authorization_url, redirect_uri, client_id) round-trip through edit for both gateways and A2A agents. Signed-off-by: Mihai Criveti <[email protected]>
All OAuth field population guards used `if (field && config.value)` which only sets the field when the value is truthy. When reusing the edit modal for a different entity that lacks a particular OAuth field, the previous value would persist and be silently resubmitted on save. Change all OAuth field assignments to unconditionally set the value with a fallback to empty string (e.g. `config.issuer || ""`), matching the pattern already used by oauthClientSecretField. Signed-off-by: Mihai Criveti <[email protected]>
c445243 to
75cebda
Compare
crivetimihai
left a comment
There was a problem hiding this comment.
Good catch — the missing issuer field population was causing it to be silently dropped on save, breaking OAuth flows that depend on it (e.g. DCR).
I rebased onto main and added two follow-up commits on top of yours:
-
A2A agent same-bug fix + tests — the
editA2AAgent()function had the identical omission. Addedid="oauth-issuer-a2a-edit"to the HTML template and the corresponding JS population. Strengthened existing backend tests to verify all OAuth fields (issuer,token_url,authorization_url,redirect_uri,client_id) round-trip through form assembly for both gateways and A2A agents. -
Stale field value fix — all OAuth field guards used
if (field && config.value)which only sets the field when truthy. When reusing the edit modal for an entity without a particular field, the old value would persist. Changed all assignments toconfig.value || ""so fields are always cleared.
* fix(ui): populate issuer field when editing OAuth gateway The editGateway() function populates all OAuth config fields (client_id, token_url, authorization_url, redirect_uri, scopes) but omits the issuer field. This causes the issuer to be silently dropped when saving, breaking OAuth flows that depend on it. Signed-off-by: kimsehwan96 <[email protected]> * fix(ui): populate issuer field when editing OAuth A2A agent + add test coverage Apply the same issuer field fix to the editA2AAgent function that was missing the same population logic. Add id="oauth-issuer-a2a-edit" to the A2A edit modal HTML template. Strengthen OAuth form-field assembly tests to verify all fields (issuer, token_url, authorization_url, redirect_uri, client_id) round-trip through edit for both gateways and A2A agents. Signed-off-by: Mihai Criveti <[email protected]> * fix(ui): clear stale OAuth fields when editing gateways and A2A agents All OAuth field population guards used `if (field && config.value)` which only sets the field when the value is truthy. When reusing the edit modal for a different entity that lacks a particular OAuth field, the previous value would persist and be silently resubmitted on save. Change all OAuth field assignments to unconditionally set the value with a fallback to empty string (e.g. `config.issuer || ""`), matching the pattern already used by oauthClientSecretField. Signed-off-by: Mihai Criveti <[email protected]> --------- Signed-off-by: kimsehwan96 <[email protected]> Signed-off-by: Mihai Criveti <[email protected]> Co-authored-by: Mihai Criveti <[email protected]>
* fix(ui): populate issuer field when editing OAuth gateway The editGateway() function populates all OAuth config fields (client_id, token_url, authorization_url, redirect_uri, scopes) but omits the issuer field. This causes the issuer to be silently dropped when saving, breaking OAuth flows that depend on it. Signed-off-by: kimsehwan96 <[email protected]> * fix(ui): populate issuer field when editing OAuth A2A agent + add test coverage Apply the same issuer field fix to the editA2AAgent function that was missing the same population logic. Add id="oauth-issuer-a2a-edit" to the A2A edit modal HTML template. Strengthen OAuth form-field assembly tests to verify all fields (issuer, token_url, authorization_url, redirect_uri, client_id) round-trip through edit for both gateways and A2A agents. Signed-off-by: Mihai Criveti <[email protected]> * fix(ui): clear stale OAuth fields when editing gateways and A2A agents All OAuth field population guards used `if (field && config.value)` which only sets the field when the value is truthy. When reusing the edit modal for a different entity that lacks a particular OAuth field, the previous value would persist and be silently resubmitted on save. Change all OAuth field assignments to unconditionally set the value with a fallback to empty string (e.g. `config.issuer || ""`), matching the pattern already used by oauthClientSecretField. Signed-off-by: Mihai Criveti <[email protected]> --------- Signed-off-by: kimsehwan96 <[email protected]> Signed-off-by: Mihai Criveti <[email protected]> Co-authored-by: Mihai Criveti <[email protected]>
🔗 Related Issue
Closes #3755
📝 Summary
The editGateway() function populates all OAuth config fields (client_id, token_url, authorization_url, redirect_uri, scopes) but omits the issuer field. This causes the issuer to be silently dropped when saving, breaking OAuth flows that depend on it.
🏷️ Type of Change
🧪 Verification
make lintmake testmake coverage✅ Checklist
make black isort pre-commit)📓 Notes (optional)