Skip to content

[NI] Add copy button for API Explorer bearer tokens - #749

Open
pranjal-singh-glean wants to merge 2 commits into
gleanwork:mainfrom
pranjal-singh-glean:codex/pranjal-singh-glean/copy-api-explorer-bearer-token
Open

pranjal-singh-glean wants to merge 2 commits into
gleanwork:mainfrom
pranjal-singh-glean:codex/pranjal-singh-glean/copy-api-explorer-bearer-token

Conversation

@pranjal-singh-glean

Copy link
Copy Markdown

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.


  • Context/Jira (Mandatory if external):
  • The JIRA(s) will need additional PR(s) to be fully resolved
  • Test plan:
    • pnpm exec prettier --check src/theme/ApiExplorer/FormTextInput/index.tsx src/theme/ApiExplorer/FormTextInput/styles.module.css
    • pnpm typecheck:site
    • pnpm 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)
  • Need review from all reviewers (default: 1)

Release Notes (go/relnotesfaq)

Change Categories (mandatory - check all that apply)

  • Internal (This PR will not be included in the external release notes)
    • Flag-gated development
    • Internally reported Bug Fix
    • Non-Customer-Facing Internal Change
    • Experiment ramp up (please include a screenshot from go/experiment-ramp)
  • External (This PR has a customer impact and will be included in the release notes)
    • Feature Launch
      • If selected, choose one:
        • GCP only
        • AWS only
        • Platform Agnostic
      • And:
        • Customer Managed Key
        • Glean Key
        • Key Agnostic
    • Feature Enhancement
      • If selected, choose one:
        • Any UI / Usability improvement
        • Connector data types / Action Expansion
        • Admin Setup / Configuration improvement
    • Security or Permissions related change
      • If selected, choose one:
        • GCP only
        • AWS only
        • Platform Agnostic
    • Customer Reported Escalation Fix
    • Customer Impact Infra Update
      • If selected, choose one:
        • GCP only
        • AWS only
        • Platform Agnostic
    • API Breaking Changes
    • Customer Logging Impact
    • Feature Deprecation
Category guide (expand for details)
Category Mandatory Optional Use when
Feature Launch External Description; ROAD JIRA link Net-new customer-facing capabilities or major functionality becoming available by default.
Feature Enhancement External Description JIRA link Meaningful improvements to existing customer-facing functionality, UI, usability, configuration, or connector behavior.
Security or Permissions related change External Description JIRA link Auth, access controls, roles, or permissions changes customers/admins may need to review.
Customer Reported Escalation Fix External Description; EE JIRA link Fixes directly resolving a customer-reported issue, support escalation, or production problem.
Customer Impact Infra Update External Description JIRA link Infra/platform changes that can affect customer experience, behavior, availability, or performance.
API Breaking Changes External Description JIRA link API changes that can break existing customer integrations unless they take action.
Customer Logging Impact External Description JIRA link Changes to customer-visible audit logs, event exports, or logging behavior.
Feature Deprecation External Description JIRA link Deprecations, removals, or customer-facing functionality being phased out or sunset.
  • Docs.glean.com (External docs) update needed
  • I have verified that the deleted SC flag(s) are also removed from defaultSearchConfigCustomizations in all deployments

(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.

@vercel

vercel Bot commented Sep 2, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the Glean Team on Vercel.

A member of the Team first needs to authorize it.

@pranjal-singh-glean

Copy link
Copy Markdown
Author

/codex review

— sent via Glean Tau

@pranjal-singh-glean

Copy link
Copy Markdown
Author

@glean-for-engineering review

— sent via Glean Tau

@pranjal-singh-glean

Copy link
Copy Markdown
Author

@cursor review

— sent via Glean Tau

@cursor

cursor Bot commented Sep 2, 2026

Copy link
Copy Markdown

Skipping Bugbot: Bugbot is disabled for this repository. Visit the Bugbot dashboard to update your settings.

@steve-calvert-glean

Copy link
Copy Markdown
Contributor

@pranjal-singh-glean can you help me understand the motivation for this proposed change?

@pranjal-singh-glean

Copy link
Copy Markdown
Author

@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

Copy link
Copy Markdown
Author
Screenshot 2026-09-02 at 7 31 12 PM

@steve-calvert-glean

Copy link
Copy Markdown
Contributor

@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.

@pranjal-singh-glean

Copy link
Copy Markdown
Author

@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
Additionally, this is public-facing documentation, so the option should be available to all customers who need to verify this for their instance

@pranjal-singh-glean
pranjal-singh-glean marked this pull request as ready for review September 9, 2026 13:46
@pranjal-singh-glean
pranjal-singh-glean requested a review from a team as a code owner September 9, 2026 13:46
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