GitHub: assume installation token length of 40 (#1486)

In the documentation 16 characters were displayed.
But testing showed we're typically seeing 40.

Fixes #1474
This commit is contained in:
Robin van Boven 2019-12-10 18:45:54 +01:00 committed by GitHub
parent ef3e1d6c48
commit a41eb71949
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -30,7 +30,7 @@ export function validateToken(token: string) {
);
}
if (hexCode.length != 16) {
if (hexCode.length != 40) {
console.warn(
`Warning: GitHub installation access token has an unexpected hexadecimal component ` +
`length of ${hexCode.length}.`

View File

@ -59,7 +59,7 @@ describe("plugins/github/token", () => {
it("should accept an installation access token format", () => {
// Given
const token = "v1.1bfb713d900c4962";
const token = "v1.1bfb713d900c49621bfb713d900c49621bfb713d";
// When
validateToken(token);
@ -70,7 +70,7 @@ describe("plugins/github/token", () => {
it("should warn when installation access token has an unexpected version", () => {
// Given
const token = "v5.1bfb713d900c4962";
const token = "v5.1bfb713d900c49621bfb713d900c49621bfb713d";
// When
validateToken(token);