[NI] Add copy button for API Explorer bearer tokens - #749
pranjal-singh-glean wants to merge 2 commits into
Conversation
|
Someone is attempting to deploy a commit to the Glean Team on Vercel. A member of the Team first needs to authorize it. |
|
/codex review — sent via Glean Tau |
|
@glean-for-engineering review — sent via Glean Tau |
|
@cursor review — sent via Glean Tau |
|
Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings. |
|
@pranjal-singh-glean can you help me understand the motivation for this proposed change? |
@steve-calvert-glean Once authentication is completed, a bearer token is generated. However, unlike the server URL above, there is currently no way to copy the token. This is to add a copy button for the bearer token, similar to the one available for the server URL? I’m happy to connect on Slack if you need any further clarification. |
|
@pranjal-singh-glean I understand the way you're proposing it works, but not understanding why. Why do we need to copy this token? The token was generated explicitly for testing the API in the API Explorer, not as a general purpose way to get a token for a user. |
@steve-calvert-glean Yeah, so if someone wants to use the cURL command in a third-party API client such as Postman or Bruno, they currently have the option to copy the server URL but not the bearer token. This feels inconsistent. I don’t consider this a security risk because the bearer token would only be available after the user completes authorization. Providing a copy option would simply improve convenience for developers and testers and make the experience more consistent |

Internal Description for reviewers:
Add a copy button to bearer-token inputs in the API Explorer, matching the existing Base URL copy affordance. This lets users copy a configured token while preserving the existing masked input and auth state behavior.
pnpm exec prettier --check src/theme/ApiExplorer/FormTextInput/index.tsx src/theme/ApiExplorer/FormTextInput/styles.module.csspnpm typecheck:sitepnpm test(started successfully; the command output was truncated before the final summary)pnpm build(Docusaurus production build started and produced build output; generated changelog artifacts were reverted because they were unrelated)Release Notes (go/relnotesfaq)
Change Categories (mandatory - check all that apply)
Category guide (expand for details)
(DO NOT include confidential details. Should be at least 40 characters long.)
External description for customers:
This update adds a copy button to bearer-token fields in the API Explorer, making it easier to reuse an entered token while keeping the token masked.