Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Url: fix sanitize for new github tokens #10048

Merged
merged 1 commit into from Aug 11, 2021

Conversation

glaubinix
Copy link
Contributor

New GitHub tokens have one of the following prefixes:

  • ghp for GitHub personal access tokens
  • gho for OAuth access tokens
  • ghu for GitHub user-to-server tokens
  • ghs for GitHub server-to-server tokens
  • ghr for refresh tokens

I am not sure what the comment above was referring to or a modern github token (e.g. gp1_xxx) this is now using the same regex as the ProcessExecutor https://github.com/composer/composer/blob/master/src/Composer/Util/ProcessExecutor.php#L93

@Seldaek
Copy link
Member

Seldaek commented Aug 11, 2021

The gp1_ format was the original format they announced.. https://web.archive.org/web/20210304181246/https://github.blog/changelog/2021-03-04-authentication-token-format-updates/ then they switched a month later and we forgot to update all the things it seems.

@Seldaek Seldaek merged commit c65bd83 into composer:master Aug 11, 2021
@Seldaek Seldaek added this to the 2.1 milestone Aug 11, 2021
@Seldaek Seldaek self-assigned this Aug 11, 2021
@Seldaek Seldaek added the Bug label Aug 11, 2021
@glaubinix glaubinix deleted the f/sanitize-gh-tokens branch August 11, 2021 11:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants