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

Update PAT validation #148

Closed
jennybc opened this issue Mar 19, 2021 · 1 comment · Fixed by #149
Closed

Update PAT validation #148

jennybc opened this issue Mar 19, 2021 · 1 comment · Fixed by #149
Labels
bug an unexpected problem or unintended behavior

Comments

@jennybc
Copy link
Member

jennybc commented Mar 19, 2021

https://github.blog/changelog/2021-03-04-authentication-token-format-updates/

PATs are included in in "each of these token types" here:

For each of these token types we are making the following changes:

  • The character set is changing from [a-f0-9] to [A-Za-z0-9_]
  • The format is changing to include a prefix:
    • gp1_ for Personal Access Tokens
      ...

The overall length of our tokens will remain the same for now. However, GitHub tokens will likely increase in length in future updates, so integrators should plan to support tokens up to 255 characters after June 1, 2021.

This needs to change:

gh/R/gh_token.R

Lines 75 to 83 in 978cb6e

# validates PAT only in a very narrow, technical, and local sense
validate_gh_pat <- function(x) {
stopifnot(inherits(x, "gh_pat"))
if (x == "" || grepl("[[:xdigit:]]{40}", x)) {
x
} else {
throw(new_error("A GitHub PAT must consist of 40 hexadecimal digits"))
}
}

@gaborcsardi gaborcsardi added the bug an unexpected problem or unintended behavior label Mar 19, 2021
@pat-s
Copy link

pat-s commented Apr 1, 2021

It seems like starting today many of or CI builds got bit by this.

Is this likely to be solved in {gh} soon or should we manually update all of our tokens?
It seems the GITHUB_TOKEN provided by GH in every build via the hidden secret GITHUB_TOKEN causes the validation issue in {gh}.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug an unexpected problem or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants