mirror of
https://github.com/status-im/sourcecred.git
synced 2025-01-15 23:25:35 +00:00
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:
parent
ef3e1d6c48
commit
a41eb71949
@ -30,7 +30,7 @@ export function validateToken(token: string) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (hexCode.length != 16) {
|
if (hexCode.length != 40) {
|
||||||
console.warn(
|
console.warn(
|
||||||
`Warning: GitHub installation access token has an unexpected hexadecimal component ` +
|
`Warning: GitHub installation access token has an unexpected hexadecimal component ` +
|
||||||
`length of ${hexCode.length}.`
|
`length of ${hexCode.length}.`
|
||||||
|
@ -59,7 +59,7 @@ describe("plugins/github/token", () => {
|
|||||||
|
|
||||||
it("should accept an installation access token format", () => {
|
it("should accept an installation access token format", () => {
|
||||||
// Given
|
// Given
|
||||||
const token = "v1.1bfb713d900c4962";
|
const token = "v1.1bfb713d900c49621bfb713d900c49621bfb713d";
|
||||||
|
|
||||||
// When
|
// When
|
||||||
validateToken(token);
|
validateToken(token);
|
||||||
@ -70,7 +70,7 @@ describe("plugins/github/token", () => {
|
|||||||
|
|
||||||
it("should warn when installation access token has an unexpected version", () => {
|
it("should warn when installation access token has an unexpected version", () => {
|
||||||
// Given
|
// Given
|
||||||
const token = "v5.1bfb713d900c4962";
|
const token = "v5.1bfb713d900c49621bfb713d900c49621bfb713d";
|
||||||
|
|
||||||
// When
|
// When
|
||||||
validateToken(token);
|
validateToken(token);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user