[FEATURE][UI]: Add gateway credential reveal endpoint with admin UI support#3504
[FEATURE][UI]: Add gateway credential reveal endpoint with admin UI support#3504gandhipratik203 wants to merge 7 commits intomainfrom
Conversation
|
Thanks @gandhipratik203. Well-designed approach — the dedicated POST endpoint with mandatory audit logging is the right pattern for credential reveal. Good comparison with #3201. A few items: (1) CI checks are failing — please investigate, (2) this will conflict with #3508 which removes the same Show buttons — we'll coordinate merge order, (3) the |
5be3b38 to
d6036e9
Compare
d6036e9 to
2b924ca
Compare
Thanks for the review @crivetimihai (1) CI is now passing. (2) Since #3508 has merged, I've rebased on I've intentionally kept the scope limited to the Edit form, since revealing stored credentials is the primary use case. (3) Glad the |
2827dd7 to
b4df80e
Compare
…veal Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
…dential reveal tests Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
…ct resolution Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
…base PR #3508 removed non-functional Show/Hide toggle buttons from admin.html. After rebasing on main, re-add the buttons to the Edit Gateway form only, now wired to the working async toggleInputMask() that calls the POST /admin/gateways/{id}/reveal-credentials endpoint. Also fix button state reset in editGateway() so reopening the Edit dialog always shows the correct initial "Show" label with token masked. Add form intentionally excluded — no stored secret exists at creation time. Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
Add inline comments explaining that data-real-value acts as a per-session cache (backend called at most once per reveal) and that button.disabled prevents duplicate in-flight requests on rapid clicks. Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
87ce09d to
0b83ae5
Compare
…ict in get_gateway_with_credentials _prepare_gateway_for_read was removed in #3570. Inline the equivalent dict construction from convert_gateway_to_read, skipping .masked() so that _populate_auth() leaves plaintext values in the _unmasked fields. Update the test to drop the now-unnecessary monkeypatch of the removed method. Signed-off-by: Pratik Gandhi <gandhipratik203@gmail.com>
gcgoncalves
left a comment
There was a problem hiding this comment.
Disregard my last review, the problem was on my end.
|
@gandhipratik203 - can you please resolve conflicts? |
Security Review — Converting to DraftSecurity review identified issues that need to be addressed before this PR is merge-ready. Summary below, roughly prioritized. Critical
High
Medium
|
|
@gandhipratik203 This one makes me nervous -- let's revisit it after we've gone through the re-engineering of the security architecture. |
🔗 Related Issue
Closes #3346, closes #2968 — see also #3201 for an alternative approach
📝 Summary
credentials without calling .masked()
with mandatory audit logging on every call
on first click, then toggle show/hide on subsequent clicks
Changes are purely additive — masked(), get_gateway(), and the existing GET endpoint are untouched.
🏷️ Type of Change
🧪 Verification
make lintmake testmake coverage🔬 Steps to Test
Prerequisites
Test 1 — UI flow (end-to-end)
supersecrettoken123
Optional for reviewers:
Test 2 — API (Swagger UI)
Test 3 — Unauthenticated request
Test 4 — Non-existent gateway
Test 5 — Audit trail
📸 Observed Output
Edit Gateway modal — before clicking Show
Edit Gateway modal — after clicking Show
✅ Checklist
📓 Notes
This implementation uses a dedicated POST endpoint rather than modifying the existing GET endpoint (as
proposed in #3201). Benefits: explicit user intent, mandatory audit logging on every reveal, no risk of
accidentally exposing credentials in GET responses or logs.