initial commit of actions
This commit is contained in:
commit
949ece5785
44660 changed files with 12034344 additions and 0 deletions
12
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
12
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/auth.js
generated
vendored
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
export async function auth(token) {
|
||||
const tokenType = token.split(/\./).length === 3
|
||||
? "app"
|
||||
: /^v\d+\./.test(token)
|
||||
? "installation"
|
||||
: "oauth";
|
||||
return {
|
||||
type: "token",
|
||||
token: token,
|
||||
tokenType
|
||||
};
|
||||
}
|
||||
6
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/hook.js
generated
vendored
Normal file
6
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/hook.js
generated
vendored
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
import { withAuthorizationPrefix } from "./with-authorization-prefix";
|
||||
export async function hook(token, request, route, parameters) {
|
||||
const endpoint = request.endpoint.merge(route, parameters);
|
||||
endpoint.headers.authorization = withAuthorizationPrefix(token);
|
||||
return request(endpoint);
|
||||
}
|
||||
14
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/index.js
generated
vendored
Normal file
14
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/index.js
generated
vendored
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
import { auth } from "./auth";
|
||||
import { hook } from "./hook";
|
||||
export const createTokenAuth = function createTokenAuth(token) {
|
||||
if (!token) {
|
||||
throw new Error("[@octokit/auth-token] No token passed to createTokenAuth");
|
||||
}
|
||||
if (typeof token !== "string") {
|
||||
throw new Error("[@octokit/auth-token] Token passed to createTokenAuth is not a string");
|
||||
}
|
||||
token = token.replace(/^(token|bearer) +/i, "");
|
||||
return Object.assign(auth.bind(null, token), {
|
||||
hook: hook.bind(null, token)
|
||||
});
|
||||
};
|
||||
0
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/types.js
generated
vendored
Normal file
0
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/types.js
generated
vendored
Normal file
11
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js
generated
vendored
Normal file
11
github/codeql-action-v1/node_modules/@octokit/auth-token/dist-src/with-authorization-prefix.js
generated
vendored
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
/**
|
||||
* Prefix token for usage in the Authorization header
|
||||
*
|
||||
* @param token OAuth token or JSON Web Token
|
||||
*/
|
||||
export function withAuthorizationPrefix(token) {
|
||||
if (token.split(/\./).length === 3) {
|
||||
return `bearer ${token}`;
|
||||
}
|
||||
return `token ${token}`;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue