gcb-host 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +23 -1
- package/bin/gcb.js +3 -3
- package/lib/audit.d.ts +4 -4
- package/lib/audit.d.ts.map +1 -1
- package/lib/audit.js +15 -14
- package/lib/audit.js.map +1 -1
- package/lib/broker.d.ts +12 -13
- package/lib/broker.d.ts.map +1 -1
- package/lib/broker.js +77 -53
- package/lib/broker.js.map +1 -1
- package/lib/commands/authorize.d.ts +43 -13
- package/lib/commands/authorize.d.ts.map +1 -1
- package/lib/commands/authorize.js +146 -53
- package/lib/commands/authorize.js.map +1 -1
- package/lib/commands/compose.d.ts +7 -7
- package/lib/commands/compose.d.ts.map +1 -1
- package/lib/commands/compose.js +21 -22
- package/lib/commands/compose.js.map +1 -1
- package/lib/commands/config.d.ts.map +1 -1
- package/lib/commands/config.js +59 -41
- package/lib/commands/config.js.map +1 -1
- package/lib/commands/deployment.d.ts +11 -11
- package/lib/commands/deployment.d.ts.map +1 -1
- package/lib/commands/deployment.js +19 -18
- package/lib/commands/deployment.js.map +1 -1
- package/lib/commands/diagnose.d.ts.map +1 -1
- package/lib/commands/diagnose.js +51 -33
- package/lib/commands/diagnose.js.map +1 -1
- package/lib/commands/doctor.d.ts +5 -5
- package/lib/commands/doctor.d.ts.map +1 -1
- package/lib/commands/doctor.js +53 -32
- package/lib/commands/doctor.js.map +1 -1
- package/lib/commands/host.d.ts +7 -7
- package/lib/commands/host.d.ts.map +1 -1
- package/lib/commands/host.js +147 -92
- package/lib/commands/host.js.map +1 -1
- package/lib/commands/init.d.ts +33 -33
- package/lib/commands/init.d.ts.map +1 -1
- package/lib/commands/init.js +93 -75
- package/lib/commands/init.js.map +1 -1
- package/lib/commands/stage.d.ts +6 -6
- package/lib/commands/stage.d.ts.map +1 -1
- package/lib/commands/stage.js +21 -15
- package/lib/commands/stage.js.map +1 -1
- package/lib/config.d.ts +29 -28
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +101 -85
- package/lib/config.js.map +1 -1
- package/lib/daemon.d.ts +9 -9
- package/lib/daemon.d.ts.map +1 -1
- package/lib/daemon.js +21 -18
- package/lib/daemon.js.map +1 -1
- package/lib/device-flow.d.ts +23 -22
- package/lib/device-flow.d.ts.map +1 -1
- package/lib/device-flow.js +33 -28
- package/lib/device-flow.js.map +1 -1
- package/lib/gh.d.ts +2 -2
- package/lib/gh.d.ts.map +1 -1
- package/lib/gh.js +74 -46
- package/lib/gh.js.map +1 -1
- package/lib/http.d.ts.map +1 -1
- package/lib/http.js +35 -18
- package/lib/http.js.map +1 -1
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib/policy.d.ts +25 -25
- package/lib/policy.d.ts.map +1 -1
- package/lib/policy.js +57 -36
- package/lib/policy.js.map +1 -1
- package/lib/providers/github-app.d.ts +12 -12
- package/lib/providers/github-app.d.ts.map +1 -1
- package/lib/providers/github-app.js +194 -125
- package/lib/providers/github-app.js.map +1 -1
- package/lib/providers/index.d.ts +8 -9
- package/lib/providers/index.d.ts.map +1 -1
- package/lib/providers/index.js +5 -5
- package/lib/providers/index.js.map +1 -1
- package/lib/providers/static.d.ts +3 -3
- package/lib/providers/static.d.ts.map +1 -1
- package/lib/providers/static.js +14 -12
- package/lib/providers/static.js.map +1 -1
- package/lib/proxy.d.ts +10 -10
- package/lib/proxy.d.ts.map +1 -1
- package/lib/proxy.js +18 -16
- package/lib/proxy.js.map +1 -1
- package/lib/public-repo.d.ts +10 -10
- package/lib/public-repo.d.ts.map +1 -1
- package/lib/public-repo.js +17 -14
- package/lib/public-repo.js.map +1 -1
- package/lib/reload.d.ts +4 -4
- package/lib/reload.d.ts.map +1 -1
- package/lib/reload.js +24 -14
- package/lib/reload.js.map +1 -1
- package/package.json +10 -10
package/lib/policy.js
CHANGED
|
@@ -9,111 +9,132 @@ const WILDCARD = '*';
|
|
|
9
9
|
/**
|
|
10
10
|
* Normalize the `path=` value git hands to a credential helper into an `owner/repo` pair.
|
|
11
11
|
*
|
|
12
|
-
* @param rawPath -
|
|
13
|
-
* @returns
|
|
14
|
-
*
|
|
12
|
+
* @param rawPath - The raw `path` field, e.g. `acme/widget.git`.
|
|
13
|
+
* @returns The normalized reference, or null when the value is missing, has more than two segments,
|
|
14
|
+
* is made of dots, or contains characters we refuse to guess about.
|
|
15
15
|
*/
|
|
16
16
|
export function normalizeRepoPath(rawPath) {
|
|
17
|
-
if (typeof rawPath !== 'string')
|
|
17
|
+
if (typeof rawPath !== 'string') {
|
|
18
18
|
return null;
|
|
19
|
+
}
|
|
19
20
|
let candidate = rawPath.trim();
|
|
20
|
-
if (!candidate)
|
|
21
|
+
if (!candidate) {
|
|
21
22
|
return null;
|
|
23
|
+
}
|
|
22
24
|
const hash = candidate.indexOf('#');
|
|
23
|
-
if (hash >= 0)
|
|
25
|
+
if (hash >= 0) {
|
|
24
26
|
candidate = candidate.slice(0, hash);
|
|
27
|
+
}
|
|
25
28
|
const query = candidate.indexOf('?');
|
|
26
|
-
if (query >= 0)
|
|
29
|
+
if (query >= 0) {
|
|
27
30
|
candidate = candidate.slice(0, query);
|
|
28
|
-
|
|
31
|
+
}
|
|
32
|
+
while (candidate.startsWith('/')) {
|
|
29
33
|
candidate = candidate.slice(1);
|
|
30
|
-
|
|
34
|
+
}
|
|
35
|
+
while (candidate.endsWith('/')) {
|
|
31
36
|
candidate = candidate.slice(0, -1);
|
|
32
|
-
|
|
37
|
+
}
|
|
38
|
+
if (candidate.toLowerCase().endsWith('.git')) {
|
|
33
39
|
candidate = candidate.slice(0, -4);
|
|
34
|
-
|
|
40
|
+
}
|
|
41
|
+
if (!candidate) {
|
|
35
42
|
return null;
|
|
43
|
+
}
|
|
36
44
|
const match = REPO_PATH_RE.exec(candidate);
|
|
37
|
-
if (!match)
|
|
45
|
+
if (!match) {
|
|
38
46
|
return null;
|
|
47
|
+
}
|
|
39
48
|
const rawOwner = match[1];
|
|
40
49
|
const rawRepo = match[2];
|
|
41
|
-
if (rawOwner === undefined || rawRepo === undefined)
|
|
50
|
+
if (rawOwner === undefined || rawRepo === undefined) {
|
|
42
51
|
return null;
|
|
52
|
+
}
|
|
43
53
|
// `acme/..` satisfies the segment pattern above but is a traversal attempt, not a name.
|
|
44
|
-
if (ALL_DOTS_RE.test(rawOwner) || ALL_DOTS_RE.test(rawRepo))
|
|
54
|
+
if (ALL_DOTS_RE.test(rawOwner) || ALL_DOTS_RE.test(rawRepo)) {
|
|
45
55
|
return null;
|
|
56
|
+
}
|
|
46
57
|
const owner = rawOwner.toLowerCase();
|
|
47
58
|
const repo = rawRepo.toLowerCase();
|
|
48
59
|
return { owner, repo, full: `${owner}/${repo}` };
|
|
49
60
|
}
|
|
50
61
|
/**
|
|
51
|
-
* Parse one allowlist entry: exactly two segments, each either an identifier or a
|
|
52
|
-
*
|
|
62
|
+
* Parse one allowlist entry: exactly two segments, each either an identifier or a whole-segment
|
|
63
|
+
* wildcard.
|
|
53
64
|
*
|
|
54
|
-
* @param entry -
|
|
55
|
-
* @returns
|
|
65
|
+
* @param entry - The raw entry from configuration.
|
|
66
|
+
* @returns The parsed entry, or null when it is malformed (which matches nothing).
|
|
56
67
|
*/
|
|
57
68
|
export function parseAllowEntry(entry) {
|
|
58
|
-
if (typeof entry !== 'string')
|
|
69
|
+
if (typeof entry !== 'string') {
|
|
59
70
|
return null;
|
|
71
|
+
}
|
|
60
72
|
const parts = entry.trim().toLowerCase().split('/');
|
|
61
|
-
if (parts.length !== 2)
|
|
73
|
+
if (parts.length !== 2) {
|
|
62
74
|
return null;
|
|
75
|
+
}
|
|
63
76
|
const owner = parts[0];
|
|
64
77
|
const repo = parts[1];
|
|
65
|
-
if (owner === undefined || repo === undefined)
|
|
78
|
+
if (owner === undefined || repo === undefined) {
|
|
66
79
|
return null;
|
|
80
|
+
}
|
|
67
81
|
const valid = (segment) => segment === WILDCARD || SEGMENT_RE.test(segment);
|
|
68
|
-
if (!valid(owner) || !valid(repo))
|
|
82
|
+
if (!valid(owner) || !valid(repo)) {
|
|
69
83
|
return null;
|
|
84
|
+
}
|
|
70
85
|
return { owner, repo };
|
|
71
86
|
}
|
|
72
87
|
/**
|
|
73
88
|
* Whether a normalized repository is covered by an allowlist.
|
|
74
89
|
*
|
|
75
|
-
* @param allowList -
|
|
76
|
-
* @param full -
|
|
77
|
-
* @returns
|
|
90
|
+
* @param allowList - Configured allow entries.
|
|
91
|
+
* @param full - A normalized `owner/repo` string.
|
|
92
|
+
* @returns True only for an exact segment-wise match.
|
|
78
93
|
*/
|
|
79
94
|
export function repoAllowed(allowList, full) {
|
|
80
|
-
if (typeof full !== 'string' || !Array.isArray(allowList))
|
|
95
|
+
if (typeof full !== 'string' || !Array.isArray(allowList)) {
|
|
81
96
|
return false;
|
|
97
|
+
}
|
|
82
98
|
// Repository names are case-insensitive on GitHub; the caller may pass the spelling from a remote URL.
|
|
83
99
|
const normalized = full.toLowerCase();
|
|
84
100
|
const slash = normalized.indexOf('/');
|
|
85
|
-
if (slash <= 0)
|
|
101
|
+
if (slash <= 0) {
|
|
86
102
|
return false;
|
|
103
|
+
}
|
|
87
104
|
const owner = normalized.slice(0, slash);
|
|
88
105
|
const repo = normalized.slice(slash + 1);
|
|
89
106
|
for (const raw of allowList) {
|
|
90
107
|
const entry = parseAllowEntry(raw);
|
|
91
|
-
if (!entry)
|
|
108
|
+
if (!entry) {
|
|
92
109
|
continue;
|
|
110
|
+
}
|
|
93
111
|
const ownerMatches = entry.owner === WILDCARD || entry.owner === owner;
|
|
94
112
|
const repoMatches = entry.repo === WILDCARD || entry.repo === repo;
|
|
95
|
-
if (ownerMatches && repoMatches)
|
|
113
|
+
if (ownerMatches && repoMatches) {
|
|
96
114
|
return true;
|
|
115
|
+
}
|
|
97
116
|
}
|
|
98
117
|
return false;
|
|
99
118
|
}
|
|
100
119
|
/**
|
|
101
120
|
* Look up the configuration block for a host as git reports it.
|
|
102
121
|
*
|
|
103
|
-
*
|
|
104
|
-
*
|
|
122
|
+
* Git sends `host=github.com` for the default port and `host=127.0.0.1:8080` otherwise, so the
|
|
123
|
+
* comparison is on the literal string, case-insensitively.
|
|
105
124
|
*
|
|
106
|
-
* @param config -
|
|
107
|
-
* @param host -
|
|
108
|
-
* @returns
|
|
125
|
+
* @param config - A validated broker config.
|
|
126
|
+
* @param host - The `host` field from the credential request.
|
|
127
|
+
* @returns The matching block, or null (default deny).
|
|
109
128
|
*/
|
|
110
129
|
export function hostConfig(config, host) {
|
|
111
|
-
if (typeof host !== 'string' || !host)
|
|
130
|
+
if (typeof host !== 'string' || !host) {
|
|
112
131
|
return null;
|
|
132
|
+
}
|
|
113
133
|
const wanted = host.toLowerCase();
|
|
114
134
|
for (const [configuredHost, block] of Object.entries(config.hosts)) {
|
|
115
|
-
if (configuredHost.toLowerCase() === wanted)
|
|
135
|
+
if (configuredHost.toLowerCase() === wanted) {
|
|
116
136
|
return { host: configuredHost, ...block };
|
|
137
|
+
}
|
|
117
138
|
}
|
|
118
139
|
return null;
|
|
119
140
|
}
|
package/lib/policy.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAgBA,kFAAkF;AAClF,MAAM,UAAU,GAAG,wBAAwB,
|
|
1
|
+
{"version":3,"file":"policy.js","sourceRoot":"","sources":["../src/policy.ts"],"names":[],"mappings":"AAgBA,kFAAkF;AAClF,MAAM,UAAU,GAAG,wBAAwB,CAAA;AAE3C,4EAA4E;AAC5E,MAAM,YAAY,GAAG,mDAAmD,CAAA;AAExE,4FAA4F;AAC5F,MAAM,WAAW,GAAG,OAAO,CAAA;AAE3B,4DAA4D;AAC5D,MAAM,QAAQ,GAAG,GAAG,CAAA;AAQpB;;;;;;GAMG;AACH,MAAM,UAAU,iBAAiB,CAAC,OAAgB;IAChD,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,OAAO,IAAI,CAAA;IACb,CAA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;IAC5D,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,CAAC,IAAI,EAAE,CAAC;QACtC,OAAO,IAAI,CAAA;IACb,CAAC;IACD,MAAM,MAAM,GAAG,IAAI,CAAC,WAAW,EAAE,CAAA;IACjC,KAAK,MAAM,CAAC,cAAc,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAC;QACnE,IAAI,cAAc,CAAC,WAAW,EAAE,KAAK,MAAM,EAAE,CAAC;YAC5C,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,GAAG,KAAK,EAAE,CAAA;QAC3C,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAA;AACb,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type FetchLike, type GithubAppHostConfig, type Provider } from 'gcb-core';
|
|
2
2
|
/** Options for {@link createGithubAppProvider}. */
|
|
3
3
|
export interface GithubAppProviderOptions {
|
|
4
4
|
/** The host this provider serves. */
|
|
@@ -10,7 +10,7 @@ export interface GithubAppProviderOptions {
|
|
|
10
10
|
readonly fetchImpl?: FetchLike;
|
|
11
11
|
/** Clock, injectable for tests. */
|
|
12
12
|
readonly now?: () => number;
|
|
13
|
-
/**
|
|
13
|
+
/** Gh executable, injectable for tests. */
|
|
14
14
|
readonly ghPath?: string;
|
|
15
15
|
/** Host-side diagnostics. */
|
|
16
16
|
readonly log?: (message: string) => void;
|
|
@@ -26,31 +26,31 @@ export interface SignAppJwtOptions {
|
|
|
26
26
|
/**
|
|
27
27
|
* Base64url-encode a string or buffer, without padding, as JWS requires.
|
|
28
28
|
*
|
|
29
|
-
* @param input -
|
|
30
|
-
* @returns
|
|
29
|
+
* @param input - The value to encode.
|
|
30
|
+
* @returns The base64url encoding.
|
|
31
31
|
*/
|
|
32
32
|
export declare function base64url(input: string | Buffer): string;
|
|
33
33
|
/**
|
|
34
34
|
* Sign a GitHub App JWT.
|
|
35
35
|
*
|
|
36
|
-
* @param options -
|
|
37
|
-
* @returns
|
|
38
|
-
* @throws {Error}
|
|
36
|
+
* @param options - Signing options.
|
|
37
|
+
* @returns The compact JWS.
|
|
38
|
+
* @throws {Error} When required inputs are missing or the lifetime exceeds GitHub's limit.
|
|
39
39
|
*/
|
|
40
40
|
export declare function signAppJwt(options: SignAppJwtOptions): string;
|
|
41
41
|
/**
|
|
42
42
|
* Extract the `rel="next"` URL from a `Link` header.
|
|
43
43
|
*
|
|
44
|
-
* @param linkHeader -
|
|
45
|
-
* @returns
|
|
44
|
+
* @param linkHeader - The raw header value.
|
|
45
|
+
* @returns The next page URL, or null when there is none.
|
|
46
46
|
*/
|
|
47
47
|
export declare function nextLink(linkHeader: string | null): string | null;
|
|
48
48
|
/**
|
|
49
49
|
* Build a GitHub App provider for one host.
|
|
50
50
|
*
|
|
51
|
-
* @param options -
|
|
52
|
-
* @returns
|
|
53
|
-
* @throws {Error}
|
|
51
|
+
* @param options - Provider options.
|
|
52
|
+
* @returns The provider.
|
|
53
|
+
* @throws {Error} When the private key or app identity is missing (fail fast).
|
|
54
54
|
*/
|
|
55
55
|
export declare function createGithubAppProvider(options: GithubAppProviderOptions): Provider;
|
|
56
56
|
//# sourceMappingURL=github-app.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"github-app.d.ts","sourceRoot":"","sources":["../../src/providers/github-app.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"github-app.d.ts","sourceRoot":"","sources":["../../src/providers/github-app.ts"],"names":[],"mappings":"AAGA,OAAO,EAML,KAAK,SAAS,EAEd,KAAK,mBAAmB,EACxB,KAAK,QAAQ,EAKd,MAAM,UAAU,CAAA;AAgDjB,mDAAmD;AACnD,MAAM,WAAW,wBAAwB;IACvC,qCAAqC;IACrC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;IACrB,QAAQ,CAAC,GAAG,EAAE,mBAAmB,CAAA;IACjC,kEAAkE;IA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