Skip to content

feat: Use Bearer scheme for auth token headers - #11667

Closed
nishithsoni wants to merge 2 commits into
cli:trunkfrom
nishithsoni:enable_pr_create_override
Closed

nishithsoni wants to merge 2 commits into
cli:trunkfrom
nishithsoni:enable_pr_create_override

Conversation

@nishithsoni

Copy link
Copy Markdown

Copilot AI review requested due to automatic review settings September 4, 2025 18:31
@nishithsoni
nishithsoni requested a review from a team as a code owner September 4, 2025 18:31
@nishithsoni
nishithsoni requested a review from babakks September 4, 2025 18:31
@cliAutomation cliAutomation added the external pull request originating outside of the CLI core team label Sep 4, 2025

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Updates the authorization header format from using "token" scheme to the standard "Bearer" scheme for auth tokens across the codebase and tests.

  • Changes all authorization headers from "token {token}" to "Bearer {token}" format
  • Updates corresponding test assertions to match the new Bearer scheme format
  • Aligns with RFC 6750 Bearer Token Usage standard

Reviewed Changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated no comments.

Show a summary per file
File Description
pkg/cmd/auth/shared/oauth_scopes.go Updates authorization header to use Bearer scheme
pkg/cmd/auth/shared/login_flow.go Updates authorization header to use Bearer scheme
api/http_client.go Updates authorization header formatting to use Bearer scheme
pkg/cmd/auth/shared/oauth_scopes_test.go Updates test assertion to expect Bearer scheme
api/http_client_test.go Updates multiple test cases to expect Bearer scheme in headers

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@cliAutomation

Copy link
Copy Markdown
Contributor

Hi! Thanks for the pull request. Please ensure that this change is linked to an issue by mentioning an issue number in the description of the pull request. If this pull request would close the issue, please put the word 'Fixes' before the issue number somewhere in the pull request body. If this is a tiny change like fixing a typo, feel free to ignore this message.

@nishithsoni

Copy link
Copy Markdown
Author

cc: @BagToad @babakks Gentle ping, if someone could give a quick review.

@BagToad

BagToad commented Sep 5, 2025

Copy link
Copy Markdown
Member

Hi @nishithsoni, thanks for the PR.

A couple clarifications:

  • I don't understand the motivation behind the change - I'm sorry. The link you provided is general technical resource by a third party, not GitHub. I'd like to see a rationalization with regard to GitHub's APIs and why you believe this is now required; I want to know what problems this addresses and links to the corresponding GitHub docs, if any.
  • This change might seem small, but as an API dependent product, you are requesting changes to the most critical and high traffic parts of our codebase which affect almost every user.
  • Please ensure you are following our contributing guidelines; we do not accept complex PRs without issues as our automation pointed out in feat: Use Bearer scheme for auth token headers #11667 (comment). We also typically only accept PRs for issues labelled help wanted; that is another aspect to keep in mind when opening issues that you might want to work on.

With all that in mind, I'm going to close this PR for now to align with our desired contribution flow. I invite you to open an issue with more information and we can get to the bottom of why this change might be required together with myself and the other maintainers 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

external pull request originating outside of the CLI core team

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants