Update GitHub token pattern
GitHub is updating the format of auth tokens from `a-z0-9` to `A-Za-z0-9` ([notice](https://github.blog/changelog/2021-03-04-authentication-token-format-updates/)). I'm not sure why `.` is allowed, but I dare not to remove it. In this PR, the token validation regex is updated to allow `A-Za-z0-9` instead of the current all lower-case `a-z` and disallowed `_`.pull/9771/head
parent
06003f4da6
commit
dc83ba93f3
|
@ -125,7 +125,7 @@ abstract class BaseIO implements IOInterface, LoggerInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($githubOauth as $domain => $token) {
|
foreach ($githubOauth as $domain => $token) {
|
||||||
if (!preg_match('{^[.a-z0-9]+$}', $token)) {
|
if (!preg_match('{^[.A-Za-z0-9_]+$}', $token)) {
|
||||||
throw new \UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"');
|
throw new \UnexpectedValueException('Your github oauth token for '.$domain.' contains invalid characters: "'.$token.'"');
|
||||||
}
|
}
|
||||||
$this->checkAndSetAuthentication($domain, $token, 'x-oauth-basic');
|
$this->checkAndSetAuthentication($domain, $token, 'x-oauth-basic');
|
||||||
|
|
Loading…
Reference in New Issue