Skip to content

feat: add API key visibility toggle in Endpoint dashboard - #214

Merged
decolua merged 1 commit into
decolua:masterfrom
toanalien:feat/hide-api-key
Feb 28, 2026
Merged

decolua merged 1 commit into
decolua:masterfrom
toanalien:feat/hide-api-key

Conversation

@toanalien

Copy link
Copy Markdown
Contributor
  • Added eye icon button to show/hide individual API keys
  • Keys hidden by default on page load for security
CleanShot 2026-02-28 at 10 55 14@2x CleanShot 2026-02-28 at 10 55 59@2x

- Added eye icon button to show/hide individual API keys
- Keys hidden by default on page load for security
- Copy button always copies full key regardless of visibility state
- Implemented per-key visibility state with React useState
- Added maskKey helper to display first 8 characters + "..."
- Clean up visibility state when keys are deleted

Improves security and UX when managing API keys in the dashboard.
@decolua
decolua merged commit d1ce98c into decolua:master Feb 28, 2026
fgogolli pushed a commit to fgogolli/9router that referenced this pull request Mar 13, 2026
- Added eye icon button to show/hide individual API keys
- Keys hidden by default on page load for security
- Copy button always copies full key regardless of visibility state
- Implemented per-key visibility state with React useState
- Added maskKey helper to display first 8 characters + "..."
- Clean up visibility state when keys are deleted

Improves security and UX when managing API keys in the dashboard.
idbara pushed a commit to idbara/9router that referenced this pull request Apr 23, 2026
- Added eye icon button to show/hide individual API keys
- Keys hidden by default on page load for security
- Copy button always copies full key regardless of visibility state
- Implemented per-key visibility state with React useState
- Added maskKey helper to display first 8 characters + "..."
- Clean up visibility state when keys are deleted

Improves security and UX when managing API keys in the dashboard.
luckystart79-lang pushed a commit to luckystart79-lang/minirouter that referenced this pull request May 2, 2026
- Added eye icon button to show/hide individual API keys
- Keys hidden by default on page load for security
- Copy button always copies full key regardless of visibility state
- Implemented per-key visibility state with React useState
- Added maskKey helper to display first 8 characters + "..."
- Clean up visibility state when keys are deleted

Improves security and UX when managing API keys in the dashboard.
diegosouzapw pushed a commit to cheaper-inference/OmniRoute that referenced this pull request Jun 21, 2026
…page

Each row in the API keys list now exposes an eye / eye-off button next to
the masked key. Clicking it lazy-fetches the full key via the existing
/api/keys/{id}/reveal endpoint (so the server-side policy gate is unchanged),
caches the plaintext client-side, and renders it inline. Clicking again
hides it. The toggle only appears when `allowKeyReveal` is true; when the
server policy disables reveal, the existing locked stub is preserved.

Implementation:
- Two pure helpers in apiManagerPageUtils.ts: `maskKey(s)` (keep first 8
  chars + ellipsis) and `toggleKeyVisibility(prev, id)` (immutable Set
  toggle, returns a fresh Set so React state setters always see a new
  reference). 6-case TDD covers both, including the no-mutation contract.
- New `visibleKeys: Set<string>` and `revealedKeys: Map<string, string>`
  state in ApiManagerPageClient.tsx. The reveal cache is cleared on
  delete, so a recreated key cannot inherit a stale plaintext.
- Reuses the i18n keys `apiManager.showKey` / `apiManager.hideKey` that
  already ship in all 42 locale catalogs — no new translation keys.

Inspired-by: decolua/9router#214
Co-authored-by: Thiên Toán <toanalien@gmail.com>
diegosouzapw pushed a commit to cheaper-inference/OmniRoute that referenced this pull request Jun 21, 2026
…page

Each row in the API keys list now exposes an eye / eye-off button next to
the masked key. Clicking it lazy-fetches the full key via the existing
/api/keys/{id}/reveal endpoint (so the server-side policy gate is unchanged),
caches the plaintext client-side, and renders it inline. Clicking again
hides it. The toggle only appears when `allowKeyReveal` is true; when the
server policy disables reveal, the existing locked stub is preserved.

Implementation:
- Two pure helpers in apiManagerPageUtils.ts: `maskKey(s)` (keep first 8
  chars + ellipsis) and `toggleKeyVisibility(prev, id)` (immutable Set
  toggle, returns a fresh Set so React state setters always see a new
  reference). 6-case TDD covers both, including the no-mutation contract.
- New `visibleKeys: Set<string>` and `revealedKeys: Map<string, string>`
  state in ApiManagerPageClient.tsx. The reveal cache is cleared on
  delete, so a recreated key cannot inherit a stale plaintext.
- Reuses the i18n keys `apiManager.showKey` / `apiManager.hideKey` that
  already ship in all 42 locale catalogs — no new translation keys.

Inspired-by: decolua/9router#214
Co-authored-by: Thiên Toán <toanalien@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.

2 participants