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.
Files changed (94) hide show
  1. package/CHANGELOG.md +23 -1
  2. package/bin/gcb.js +3 -3
  3. package/lib/audit.d.ts +4 -4
  4. package/lib/audit.d.ts.map +1 -1
  5. package/lib/audit.js +15 -14
  6. package/lib/audit.js.map +1 -1
  7. package/lib/broker.d.ts +12 -13
  8. package/lib/broker.d.ts.map +1 -1
  9. package/lib/broker.js +77 -53
  10. package/lib/broker.js.map +1 -1
  11. package/lib/commands/authorize.d.ts +43 -13
  12. package/lib/commands/authorize.d.ts.map +1 -1
  13. package/lib/commands/authorize.js +146 -53
  14. package/lib/commands/authorize.js.map +1 -1
  15. package/lib/commands/compose.d.ts +7 -7
  16. package/lib/commands/compose.d.ts.map +1 -1
  17. package/lib/commands/compose.js +21 -22
  18. package/lib/commands/compose.js.map +1 -1
  19. package/lib/commands/config.d.ts.map +1 -1
  20. package/lib/commands/config.js +59 -41
  21. package/lib/commands/config.js.map +1 -1
  22. package/lib/commands/deployment.d.ts +11 -11
  23. package/lib/commands/deployment.d.ts.map +1 -1
  24. package/lib/commands/deployment.js +19 -18
  25. package/lib/commands/deployment.js.map +1 -1
  26. package/lib/commands/diagnose.d.ts.map +1 -1
  27. package/lib/commands/diagnose.js +51 -33
  28. package/lib/commands/diagnose.js.map +1 -1
  29. package/lib/commands/doctor.d.ts +5 -5
  30. package/lib/commands/doctor.d.ts.map +1 -1
  31. package/lib/commands/doctor.js +53 -32
  32. package/lib/commands/doctor.js.map +1 -1
  33. package/lib/commands/host.d.ts +7 -7
  34. package/lib/commands/host.d.ts.map +1 -1
  35. package/lib/commands/host.js +147 -92
  36. package/lib/commands/host.js.map +1 -1
  37. package/lib/commands/init.d.ts +33 -33
  38. package/lib/commands/init.d.ts.map +1 -1
  39. package/lib/commands/init.js +93 -75
  40. package/lib/commands/init.js.map +1 -1
  41. package/lib/commands/stage.d.ts +6 -6
  42. package/lib/commands/stage.d.ts.map +1 -1
  43. package/lib/commands/stage.js +21 -15
  44. package/lib/commands/stage.js.map +1 -1
  45. package/lib/config.d.ts +29 -28
  46. package/lib/config.d.ts.map +1 -1
  47. package/lib/config.js +101 -85
  48. package/lib/config.js.map +1 -1
  49. package/lib/daemon.d.ts +9 -9
  50. package/lib/daemon.d.ts.map +1 -1
  51. package/lib/daemon.js +21 -18
  52. package/lib/daemon.js.map +1 -1
  53. package/lib/device-flow.d.ts +23 -22
  54. package/lib/device-flow.d.ts.map +1 -1
  55. package/lib/device-flow.js +33 -28
  56. package/lib/device-flow.js.map +1 -1
  57. package/lib/gh.d.ts +2 -2
  58. package/lib/gh.d.ts.map +1 -1
  59. package/lib/gh.js +74 -46
  60. package/lib/gh.js.map +1 -1
  61. package/lib/http.d.ts.map +1 -1
  62. package/lib/http.js +35 -18
  63. package/lib/http.js.map +1 -1
  64. package/lib/index.d.ts.map +1 -1
  65. package/lib/index.js.map +1 -1
  66. package/lib/policy.d.ts +25 -25
  67. package/lib/policy.d.ts.map +1 -1
  68. package/lib/policy.js +57 -36
  69. package/lib/policy.js.map +1 -1
  70. package/lib/providers/github-app.d.ts +12 -12
  71. package/lib/providers/github-app.d.ts.map +1 -1
  72. package/lib/providers/github-app.js +194 -125
  73. package/lib/providers/github-app.js.map +1 -1
  74. package/lib/providers/index.d.ts +8 -9
  75. package/lib/providers/index.d.ts.map +1 -1
  76. package/lib/providers/index.js +5 -5
  77. package/lib/providers/index.js.map +1 -1
  78. package/lib/providers/static.d.ts +3 -3
  79. package/lib/providers/static.d.ts.map +1 -1
  80. package/lib/providers/static.js +14 -12
  81. package/lib/providers/static.js.map +1 -1
  82. package/lib/proxy.d.ts +10 -10
  83. package/lib/proxy.d.ts.map +1 -1
  84. package/lib/proxy.js +18 -16
  85. package/lib/proxy.js.map +1 -1
  86. package/lib/public-repo.d.ts +10 -10
  87. package/lib/public-repo.d.ts.map +1 -1
  88. package/lib/public-repo.js +17 -14
  89. package/lib/public-repo.js.map +1 -1
  90. package/lib/reload.d.ts +4 -4
  91. package/lib/reload.d.ts.map +1 -1
  92. package/lib/reload.js +24 -14
  93. package/lib/reload.js.map +1 -1
  94. package/package.json +10 -10
@@ -1,14 +1,12 @@
1
- /**
2
- * `config` — inspect, edit and validate the broker configuration.
3
- */
1
+ /** `config` — inspect, edit and validate the broker configuration. */
4
2
  import { spawnSync } from 'node:child_process';
5
- import { chmodSync, chownSync, existsSync, linkSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync } from 'node:fs';
6
3
  import { randomUUID } from 'node:crypto';
4
+ import { chmodSync, chownSync, existsSync, linkSync, readFileSync, realpathSync, renameSync, rmSync, statSync, writeFileSync, } from 'node:fs';
7
5
  import { dirname } from 'node:path';
6
+ import { fail, parseArgs, say } from 'gcb-core';
8
7
  import { parseDocument, isMap, isScalar, isSeq } from 'yaml';
9
- import { inferMode, loadConfig, loadConfigText, readConfigText, resolveConfigPath } from '../config.js';
8
+ import { inferMode, loadConfig, loadConfigText, readConfigText, resolveConfigPath, } from '../config.js';
10
9
  import { parseAllowEntry } from '../policy.js';
11
- import { fail, parseArgs, say } from 'gcb-core';
12
10
  export const CONFIG_USAGE = `Usage: gcb config check|edit|allow add|remove [options]
13
11
 
14
12
  Validate or edit the broker configuration, or change one allowlist entry.
@@ -27,14 +25,17 @@ export function runConfig(argv) {
27
25
  return 0;
28
26
  }
29
27
  const configValues = args.values('config');
30
- if (args.has('config') || configValues.length > 1)
28
+ if (args.has('config') || configValues.length > 1) {
31
29
  fail('--config may only be given once and needs a value');
30
+ }
32
31
  const configArg = configValues[0];
33
- if (configArg === '')
32
+ if (configArg === '') {
34
33
  fail('--config needs a value');
34
+ }
35
35
  for (const name of args.names) {
36
- if (name !== 'config' && name !== 'help' && name !== 'h')
36
+ if (name !== 'config' && name !== 'help' && name !== 'h') {
37
37
  fail(`unknown option --${name}`);
38
+ }
38
39
  }
39
40
  const command = args.positionals[0];
40
41
  if (command !== 'check' && command !== 'edit' && command !== 'allow') {
@@ -45,19 +46,25 @@ export function runConfig(argv) {
45
46
  }
46
47
  const path = resolveConfigPath(configArg);
47
48
  if (command === 'edit') {
48
- if (!existsSync(path))
49
+ if (!existsSync(path)) {
49
50
  fail(`cannot edit missing config ${path}`);
51
+ }
50
52
  const editor = process.env['VISUAL'] ?? process.env['EDITOR'];
51
- if (editor === undefined || editor.trim() === '')
53
+ if (editor === undefined || editor.trim() === '') {
52
54
  fail('config edit needs $VISUAL or $EDITOR');
55
+ }
53
56
  // Edit in place: this path needs write access to the file; some editors also need its directory.
54
57
  // `$VISUAL`/`$EDITOR` is a shell command in git's own semantics; `$@` keeps the path intact.
55
- const result = spawnSync('/bin/sh', ['-c', `${editor} "$@"`, editor, path], { stdio: 'inherit' });
58
+ const result = spawnSync('/bin/sh', ['-c', `${editor} "$@"`, editor, path], {
59
+ stdio: 'inherit',
60
+ });
56
61
  if (result.error !== undefined) {
57
62
  fail(`cannot run editor ${JSON.stringify(editor)}: ${result.error.message}`);
58
63
  }
59
64
  if (result.status !== 0) {
60
- const how = result.status === null ? `signal ${String(result.signal)}` : `status ${String(result.status)}`;
65
+ const how = result.status === null
66
+ ? `signal ${String(result.signal)}`
67
+ : `status ${String(result.status)}`;
61
68
  fail(`editor exited with ${how}`);
62
69
  }
63
70
  }
@@ -86,7 +93,7 @@ const LOCK_WAIT_MS = 5_000;
86
93
  /**
87
94
  * Sleep without yielding the event loop; this command is synchronous by design.
88
95
  *
89
- * @param ms - milliseconds to wait.
96
+ * @param ms - Milliseconds to wait.
90
97
  */
91
98
  function sleepSync(ms) {
92
99
  Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms);
@@ -94,8 +101,8 @@ function sleepSync(ms) {
94
101
  /**
95
102
  * Whether a pid is still alive.
96
103
  *
97
- * @param pid - the pid to probe.
98
- * @returns true when the process exists.
104
+ * @param pid - The pid to probe.
105
+ * @returns True when the process exists.
99
106
  */
100
107
  function pidAlive(pid) {
101
108
  try {
@@ -110,10 +117,10 @@ function pidAlive(pid) {
110
117
  /**
111
118
  * Describe a lock-creation failure without exposing an internal temp name.
112
119
  *
113
- * @param path - the config path the user named.
114
- * @param directory - its directory.
115
- * @param error - the underlying filesystem error.
116
- * @returns the error to throw.
120
+ * @param path - The config path the user named.
121
+ * @param directory - Its directory.
122
+ * @param error - The underlying filesystem error.
123
+ * @returns The error to throw.
117
124
  */
118
125
  function lockError(path, directory, error) {
119
126
  const code = error.code ?? 'error';
@@ -125,8 +132,8 @@ function lockError(path, directory, error) {
125
132
  /**
126
133
  * Resolve the real file a config path names, keeping a missing-file message useful.
127
134
  *
128
- * @param path - the configured path, which may be a symlink.
129
- * @returns the target path.
135
+ * @param path - The configured path, which may be a symlink.
136
+ * @returns The target path.
130
137
  */
131
138
  function configTarget(path) {
132
139
  try {
@@ -134,7 +141,7 @@ function configTarget(path) {
134
141
  }
135
142
  catch (error) {
136
143
  if (error.code === 'ENOENT') {
137
- throw new Error(`cannot read config ${path}: ${error.message}`);
144
+ throw new Error(`cannot read config ${path}: ${error.message}`, { cause: error });
138
145
  }
139
146
  throw error;
140
147
  }
@@ -142,9 +149,9 @@ function configTarget(path) {
142
149
  /**
143
150
  * Serialize one read/update/replace sequence on a config file.
144
151
  *
145
- * @param path - the configuration path.
146
- * @param fn - the update to run while holding the lock.
147
- * @returns whatever the update returns.
152
+ * @param path - The configuration path.
153
+ * @param fn - The update to run while holding the lock.
154
+ * @returns Whatever the update returns.
148
155
  */
149
156
  function withConfigLock(path, fn) {
150
157
  const target = configTarget(path);
@@ -168,8 +175,9 @@ function withConfigLock(path, fn) {
168
175
  pid = Number(readFileSync(lock, 'utf8'));
169
176
  }
170
177
  catch (error) {
171
- if (error.code === 'ENOENT')
178
+ if (error.code === 'ENOENT') {
172
179
  continue;
180
+ }
173
181
  throw error;
174
182
  }
175
183
  const usablePid = Number.isInteger(pid) && pid > 0 && pid <= 0x7fffffff;
@@ -179,8 +187,9 @@ function withConfigLock(path, fn) {
179
187
  age = Date.now() - statSync(lock).mtimeMs;
180
188
  }
181
189
  catch (error) {
182
- if (error.code === 'ENOENT')
190
+ if (error.code === 'ENOENT') {
183
191
  continue;
192
+ }
184
193
  throw error;
185
194
  }
186
195
  // Only a lock from an older writer can be empty now; give it a moment, then fail closed.
@@ -188,11 +197,15 @@ function withConfigLock(path, fn) {
188
197
  sleepSync(50);
189
198
  continue;
190
199
  }
191
- throw new Error(`stale lock ${lock}; remove it if no gcb command is running`);
200
+ throw new Error(`stale lock ${lock}; remove it if no gcb command is running`, {
201
+ cause: error,
202
+ });
192
203
  }
193
204
  if (pidAlive(pid)) {
194
205
  if (Date.now() >= deadline) {
195
- throw new Error(`another gcb command is updating ${path}; retry after it finishes`);
206
+ throw new Error(`another gcb command is updating ${path}; retry after it finishes`, {
207
+ cause: error,
208
+ });
196
209
  }
197
210
  sleepSync(50);
198
211
  continue;
@@ -200,7 +213,9 @@ function withConfigLock(path, fn) {
200
213
  // Recovering a stale lock by unlink/rename races the holder's release and a new acquirer,
201
214
  // and the loser can delete a lock the winner just created. Fail closed instead; removing the
202
215
  // file is a deliberate operator action once no gcb command is running.
203
- throw new Error(`stale lock ${lock}; remove it if no gcb command is running`);
216
+ throw new Error(`stale lock ${lock}; remove it if no gcb command is running`, {
217
+ cause: error,
218
+ });
204
219
  }
205
220
  finally {
206
221
  rmSync(temporary, { force: true });
@@ -216,7 +231,7 @@ function withConfigLock(path, fn) {
216
231
  /**
217
232
  * Apply one allowlist add or remove, validate the result, then replace the file atomically.
218
233
  *
219
- * @param path - the configuration file.
234
+ * @param path - The configuration file.
220
235
  * @param positionals - `allow`, `add|remove`, host, `owner/name`.
221
236
  */
222
237
  function changeAllow(path, positionals) {
@@ -236,19 +251,20 @@ function changeAllow(path, positionals) {
236
251
  repository.toLowerCase().endsWith('.git')) {
237
252
  throw new Error(`repository must be one exact owner/name without a wildcard or .git, got ${JSON.stringify(repository)}`);
238
253
  }
239
- withConfigLock(path, (target) => {
254
+ withConfigLock(path, target => {
240
255
  const before = readConfigText(target);
241
256
  if (before.includes('\r\n') && /(^|[^\r])\n/u.test(before)) {
242
257
  throw new Error(`config ${path} has mixed line endings; normalize it to LF or CRLF first`);
243
258
  }
244
259
  const document = parseDocument(before, { schema: 'core', uniqueKeys: true, prettyErrors: true });
245
260
  if (document.errors.length > 0) {
246
- throw new Error(`config ${path} is not valid YAML: ${document.errors.map((error) => error.message).join('; ')}`);
261
+ throw new Error(`config ${path} is not valid YAML: ${document.errors.map(error => error.message).join('; ')}`);
247
262
  }
248
263
  const hostsNode = document.getIn(['hosts'], true);
249
- if (!isMap(hostsNode))
264
+ if (!isMap(hostsNode)) {
250
265
  throw new Error(`no hosts in ${path}`);
251
- const pair = hostsNode.items.find((item) => isScalar(item.key) && String(item.key.value).toLowerCase() === host.toLowerCase());
266
+ }
267
+ const pair = hostsNode.items.find(item => isScalar(item.key) && String(item.key.value).toLowerCase() === host.toLowerCase());
252
268
  if (pair === undefined || !isMap(pair.value)) {
253
269
  throw new Error(`no host ${JSON.stringify(host)} in ${path}`);
254
270
  }
@@ -259,14 +275,15 @@ function changeAllow(path, positionals) {
259
275
  throw new Error(`hosts.${hostKey}.allow must be a list`);
260
276
  }
261
277
  const entries = isSeq(allowNode)
262
- ? allowNode.items.map((item) => (isScalar(item) ? String(item.value) : undefined))
278
+ ? allowNode.items.map(item => (isScalar(item) ? String(item.value) : undefined))
263
279
  : [];
264
- const normalized = entries.map((entry) => entry?.trim().toLowerCase());
280
+ const normalized = entries.map(entry => entry?.trim().toLowerCase());
265
281
  const wanted = repository.toLowerCase();
266
- const index = normalized.findIndex((entry) => entry === wanted);
282
+ const index = normalized.findIndex(entry => entry === wanted);
267
283
  if (action === 'add') {
268
- if (index !== -1)
284
+ if (index !== -1) {
269
285
  throw new Error(`${repository} is already in ${hostKey}.allow`);
286
+ }
270
287
  if (isSeq(allowNode)) {
271
288
  allowNode.add(repository);
272
289
  }
@@ -275,8 +292,9 @@ function changeAllow(path, positionals) {
275
292
  }
276
293
  }
277
294
  else {
278
- if (index === -1 || !isSeq(allowNode))
295
+ if (index === -1 || !isSeq(allowNode)) {
279
296
  throw new Error(`${repository} is not in ${hostKey}.allow`);
297
+ }
280
298
  const kept = allowNode.items.filter((_item, position) => normalized[position] !== wanted);
281
299
  if (kept.length === 0) {
282
300
  throw new Error(`refusing to remove: this would leave the allowlist empty for ${hostKey}`);
@@ -1 +1 @@
1
- {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/commands/config.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,QAAQ,EAAE,YAAY,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC9I,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,MAAM,CAAC;AAE7D,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACxG,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEhD,MAAM,CAAC,MAAM,YAAY,GAAG;;;;;;;;;;CAU3B,CAAC;AAEF,MAAM,UAAU,SAAS,CAAC,IAAuB;IAC/C,MAAM,IAAI,GAAG,SAAS,CAAC,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC;IACrD,IAAI,IAAI,CAAC,GAAG,CAAC,MAAM,CAAC,IAAI,IAAI,CAAC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oB,UAAU,sHAAsH,CAC1L,CAAA;IACH,CAAC,CAAC,CAAA;AACJ,CAAC"}
@@ -20,17 +20,17 @@ export declare const HOST_SOCKET_PATH_DEFAULT = "/run/git-cred-broker/broker.soc
20
20
  /**
21
21
  * The host-side files a deployment needs, regardless of mode.
22
22
  *
23
- * @param dir - the host directory holding the deployment.
24
- * @returns the paths on the host.
23
+ * @param dir - The host directory holding the deployment.
24
+ * @returns The paths on the host.
25
25
  */
26
26
  export declare function hostArtifacts(dir: string): HostArtifacts;
27
27
  /**
28
28
  * The paths to record in the configuration for one deployment.
29
29
  *
30
- * @param mode - which deployment the broker will run as.
31
- * @param dir - the host directory holding the deployment.
32
- * @param hostSocketPath - the socket path a host process should use; ignored in sidecar mode.
33
- * @returns the paths as the broker will resolve them.
30
+ * @param mode - Which deployment the broker will run as.
31
+ * @param dir - The host directory holding the deployment.
32
+ * @param hostSocketPath - The socket path a host process should use; ignored in sidecar mode.
33
+ * @returns The paths as the broker will resolve them.
34
34
  */
35
35
  export declare function brokerPaths(mode: DeploymentMode, dir: string, hostSocketPath?: string): BrokerPaths;
36
36
  /**
@@ -39,11 +39,11 @@ export declare function brokerPaths(mode: DeploymentMode, dir: string, hostSocke
39
39
  * The compose file fixes these locations, so silently ignoring a different value would produce a
40
40
  * broker that starts and then cannot find its own key. Failing loudly is the only kind option.
41
41
  *
42
- * @param flag - the flag name, for the message.
43
- * @param given - the value the user supplied, if any.
44
- * @param fixed - the value the deployment requires.
45
- * @param mode - the chosen deployment.
46
- * @throws {Error} when sidecar mode was chosen and a conflicting value was supplied.
42
+ * @param flag - The flag name, for the message.
43
+ * @param given - The value the user supplied, if any.
44
+ * @param fixed - The value the deployment requires.
45
+ * @param mode - The chosen deployment.
46
+ * @throws {Error} When sidecar mode was chosen and a conflicting value was supplied.
47
47
  */
48
48
  export declare function requireFixedInSidecar(flag: string, given: string | undefined, fixed: string, mode: DeploymentMode): void;
49
49
  //# sourceMappingURL=deployment.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/commands/deployment.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAC;AAEnD,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAAwB,CAAC;AAE/E,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;CAC5B;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;CAC3B;AAED,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,qCAAqC,CAAC;AAE3E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAOxD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,cAAc,GAAE,MAAiC,GAChD,WAAW,CAab;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,cAAc,GACnB,IAAI,CAKN"}
1
+ {"version":3,"file":"deployment.d.ts","sourceRoot":"","sources":["../../src/commands/deployment.ts"],"names":[],"mappings":"AAeA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAElD,+CAA+C;AAC/C,eAAO,MAAM,gBAAgB,EAAE,SAAS,cAAc,EAAwB,CAAA;AAE9E,oFAAoF;AACpF,MAAM,WAAW,WAAW;IAC1B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAA;IAC/B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;CAC3B;AAED,+FAA+F;AAC/F,MAAM,WAAW,aAAa;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;IACxB,gEAAgE;IAChE,QAAQ,CAAC,aAAa,EAAE,MAAM,CAAA;IAC9B,QAAQ,CAAC,UAAU,EAAE,MAAM,CAAA;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAA;CAC1B;AAED,4EAA4E;AAC5E,eAAO,MAAM,wBAAwB,qCAAqC,CAAA;AAE1E;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,aAAa,CAOxD;AAED;;;;;;;GAOG;AACH,wBAAgB,WAAW,CACzB,IAAI,EAAE,cAAc,EACpB,GAAG,EAAE,MAAM,EACX,cAAc,GAAE,MAAiC,GAChD,WAAW,CAab;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,cAAc,GACnB,IAAI,CAON"}
@@ -2,13 +2,13 @@
2
2
  * Where each deployment expects its files, from the **broker's** point of view.
3
3
  *
4
4
  * This module exists because of one easily-missed fact: the paths inside `broker.config.yml` are
5
- * resolved by whichever process reads the file. A broker running as a host process sees the
6
- * host's filesystem, and a broker running as a sidecar sees only what its `volumes:` mount.
7
- * The same file therefore means two different things, and one config cannot serve both.
5
+ * resolved by whichever process reads the file. A broker running as a host process sees the host's
6
+ * filesystem, and a broker running as a sidecar sees only what its `volumes:` mount. The same file
7
+ * therefore means two different things, and one config cannot serve both.
8
8
  *
9
- * Both `init --mode` and `compose` derive from here, so the two halves cannot drift apart —
10
- * which they did once: `init` recorded host paths while `compose` mounted the files at container
11
- * paths, producing a sidecar that could not read its own key.
9
+ * Both `init --mode` and `compose` derive from here, so the two halves cannot drift apart — which
10
+ * they did once: `init` recorded host paths while `compose` mounted the files at container paths,
11
+ * producing a sidecar that could not read its own key.
12
12
  */
13
13
  import path from 'node:path';
14
14
  import { USER_TOKEN_FILE, SIDECAR } from '../config.js';
@@ -19,8 +19,8 @@ export const HOST_SOCKET_PATH_DEFAULT = '/run/git-cred-broker/broker.sock';
19
19
  /**
20
20
  * The host-side files a deployment needs, regardless of mode.
21
21
  *
22
- * @param dir - the host directory holding the deployment.
23
- * @returns the paths on the host.
22
+ * @param dir - The host directory holding the deployment.
23
+ * @returns The paths on the host.
24
24
  */
25
25
  export function hostArtifacts(dir) {
26
26
  return {
@@ -33,10 +33,10 @@ export function hostArtifacts(dir) {
33
33
  /**
34
34
  * The paths to record in the configuration for one deployment.
35
35
  *
36
- * @param mode - which deployment the broker will run as.
37
- * @param dir - the host directory holding the deployment.
38
- * @param hostSocketPath - the socket path a host process should use; ignored in sidecar mode.
39
- * @returns the paths as the broker will resolve them.
36
+ * @param mode - Which deployment the broker will run as.
37
+ * @param dir - The host directory holding the deployment.
38
+ * @param hostSocketPath - The socket path a host process should use; ignored in sidecar mode.
39
+ * @returns The paths as the broker will resolve them.
40
40
  */
41
41
  export function brokerPaths(mode, dir, hostSocketPath = HOST_SOCKET_PATH_DEFAULT) {
42
42
  if (mode === 'sidecar') {
@@ -58,15 +58,16 @@ export function brokerPaths(mode, dir, hostSocketPath = HOST_SOCKET_PATH_DEFAULT
58
58
  * The compose file fixes these locations, so silently ignoring a different value would produce a
59
59
  * broker that starts and then cannot find its own key. Failing loudly is the only kind option.
60
60
  *
61
- * @param flag - the flag name, for the message.
62
- * @param given - the value the user supplied, if any.
63
- * @param fixed - the value the deployment requires.
64
- * @param mode - the chosen deployment.
65
- * @throws {Error} when sidecar mode was chosen and a conflicting value was supplied.
61
+ * @param flag - The flag name, for the message.
62
+ * @param given - The value the user supplied, if any.
63
+ * @param fixed - The value the deployment requires.
64
+ * @param mode - The chosen deployment.
65
+ * @throws {Error} When sidecar mode was chosen and a conflicting value was supplied.
66
66
  */
67
67
  export function requireFixedInSidecar(flag, given, fixed, mode) {
68
- if (mode !== 'sidecar' || given === undefined || given === fixed)
68
+ if (mode !== 'sidecar' || given === undefined || given === fixed) {
69
69
  return;
70
+ }
70
71
  throw new Error(`${flag} must be ${fixed} with --mode sidecar, because the compose file mounts it there; got ${given}`);
71
72
  }
72
73
  //# sourceMappingURL=deployment.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"deployment.js","sourceRoot":"","sources":["../../src/commands/deployment.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AAGxD,+CAA+C;AAC/C,MAAM,CAAC,MAAM,gBAAgB,GAA8B,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;AAkB/E,4EAA4E;AAC5E,MAAM,CAAC,MAAM,wBAAwB,GAAG,kCAAkC,CAAC;AAE3E;;;;;GAKG;AACH,MAAM,UAAU,aAAa,CAAC,GAAW;IACvC,OAAO;QACL,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC;QAClC,aAAa,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,eAAe,CAAC;QAC9C,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;QAC/C,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;KAChC,CAAC;AACJ,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,IAAoB,EACpB,GAAW,EACX,cAAc,GAAW,wBAAwB;IAEjD,IAAI,IAAI,KAA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AI,CAAC,IAAI,CAAC,GAAG,EAAE,mBAAmB,CAAC;QAC/C,QAAQ,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,CAAC;KAChC,CAAA;AACH,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,WAAW,CACzB,IAAoB,EACpB,GAAW,EACX,cAAc,GAAW,wBAAwB;IAEjD,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,OAAO;YACL,UAAU,EAAE,OAAO,CAAC,UAAU;YAC9B,cAAc,EAAE,OAAO,CAAC,OAAO;YAC/B,SAAS,EAAE,OAAO,CAAC,SAAS;SAC7B,CAAA;IACH,CAAC;IACD,OAAO;QACL,UAAU,EAAE,cAAc;QAC1B,cAAc,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,SAAS,CAAC;QACzC,SAAS,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,KAAK,EAAE,aAAa,CAAC;KAChD,CAAA;AACH,CAAC;AAED;;;;;;;;;;;GAWG;AACH,MAAM,UAAU,qBAAqB,CACnC,IAAY,EACZ,KAAyB,EACzB,KAAa,EACb,IAAoB;IAEpB,IAAI,IAAI,KAAK,SAAS,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,KAAK,EAAE,CAAC;QACjE,OAAM;IACR,CAAC;IACD,MAAM,IAAI,KAAK,CACb,GAAG,IAAI,YAAY,KAAK,uEAAuE,KAAK,EAAE,CACvG,CAAA;AACH,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAqCA,iCAAiC;AACjC,eAAO,MAAM,cAAc,iiBAU1B,CAAC;AAUF,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAwL1E"}
1
+ {"version":3,"file":"diagnose.d.ts","sourceRoot":"","sources":["../../src/commands/diagnose.ts"],"names":[],"mappings":"AAsCA,iCAAiC;AACjC,eAAO,MAAM,cAAc,iiBAU1B,CAAA;AAUD,wBAAsB,WAAW,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,OAAO,CAAC,MAAM,CAAC,CAmO1E"}
@@ -1,23 +1,23 @@
1
1
  /**
2
2
  * `diagnose` — explain why the broker could not mint a token.
3
3
  *
4
- * The broker deliberately answers the pushing side with a generic message, because provider
5
- * errors can embed API responses. This asks GitHub directly and prints what the app can
6
- * actually see, which is what separates the two causes of
4
+ * The broker deliberately answers the pushing side with a generic message, because provider errors
5
+ * can embed API responses. This asks GitHub directly and prints what the app can actually see,
6
+ * which is what separates the two causes of
7
7
  *
8
- * 422 "There is at least one repository that does not exist or is not accessible to the
9
- * parent installation"
8
+ * 422 "There is at least one repository that does not exist or is not accessible to the parent
9
+ * installation"
10
10
  *
11
- * — the repository was never created, or the installation was granted "only select
12
- * repositories" and this one is not on that list. The message is identical for both.
11
+ * — the repository was never created, or the installation was granted "only select repositories"
12
+ * and this one is not on that list. The message is identical for both.
13
13
  *
14
14
  * It never prints a key or a token.
15
15
  */
16
16
  import { readFileSync } from 'node:fs';
17
+ import { fail, parseArgs, say, warn } from 'gcb-core';
17
18
  import { assertKeysReadable, loadConfig, resolveConfigPath } from '../config.js';
18
- import { nextLink, signAppJwt } from '../providers/github-app.js';
19
19
  import { fetcherFor, parseProxy } from '../http.js';
20
- import { fail, parseArgs, say, warn } from 'gcb-core';
20
+ import { nextLink, signAppJwt } from '../providers/github-app.js';
21
21
  /** Usage text for `diagnose`. */
22
22
  export const DIAGNOSE_USAGE = `Usage: gcb diagnose [options]
23
23
 
@@ -33,21 +33,25 @@ repositories each installation can reach. Never prints a key or a token.
33
33
  /**
34
34
  * Run the `diagnose` command.
35
35
  *
36
- * @param argv - arguments after the command name.
37
- * @returns the process exit code: 0 everything reachable, 1 something is not.
36
+ * @param argv - Arguments after the command name.
37
+ * @returns The process exit code: 0 everything reachable, 1 something is not.
38
38
  */
39
39
  import { assertProxyEnabled } from '../proxy.js';
40
40
  export async function runDiagnose(argv) {
41
41
  const args = parseArgs(argv, { booleans: ['help', 'no-proxy'] });
42
- if (args.has('no-proxy') && args.value('proxy') !== undefined)
42
+ if (args.has('no-proxy') && args.value('proxy') !== undefined) {
43
43
  fail('--proxy and --no-proxy are mutually exclusive');
44
- if (args.has('proxy') && args.value('proxy') === undefined)
44
+ }
45
+ if (args.has('proxy') && args.value('proxy') === undefined) {
45
46
  fail('--proxy needs a value');
47
+ }
46
48
  const proxy = args.has('no-proxy') ? null : args.value('proxy');
47
- if (proxy !== undefined && parseProxy(proxy) === false)
49
+ if (proxy !== undefined && parseProxy(proxy) === false) {
48
50
  fail('--proxy must be an http(s) URL');
49
- if (proxy === undefined)
51
+ }
52
+ if (proxy === undefined) {
50
53
  assertProxyEnabled();
54
+ }
51
55
  if (args.has('help') || args.has('h')) {
52
56
  say(DIAGNOSE_USAGE);
53
57
  return 0;
@@ -60,27 +64,33 @@ export async function runDiagnose(argv) {
60
64
  assertKeysReadable(config);
61
65
  const wanted = args.value('host');
62
66
  const entry = Object.entries(config.hosts).find(([host, block]) => block.provider === 'github-app' && (wanted ? host === wanted : true));
63
- if (!entry)
67
+ if (!entry) {
64
68
  fail(`no github-app host${wanted ? ` named ${wanted}` : ''} in ${configPath}`);
69
+ }
65
70
  const [host, block] = entry;
66
71
  if (!block.privateKeyPath) {
67
72
  fail('this host uses privateKeyPem; point the command at a config that references a key file');
68
73
  }
69
74
  const pem = readFileSync(block.privateKeyPath, 'utf8');
70
75
  const issuer = block.clientId ?? block.appId;
71
- if (issuer === undefined)
76
+ if (issuer === undefined) {
72
77
  fail('the host block has neither clientId nor appId');
78
+ }
73
79
  const api = block.apiBaseUrl ?? 'https://api.github.com';
74
80
  const apiVersion = block.apiVersion ?? '2022-11-28';
75
81
  const fetcher = fetcherFor(proxy);
76
82
  /**
77
83
  * Call the API authenticated as the app.
78
84
  *
79
- * @param path - path below the API root.
80
- * @returns the parsed body and the Link header.
85
+ * @param path - Path below the API root.
86
+ * @returns The parsed body and the Link header.
81
87
  */
82
88
  async function asApp(path) {
83
- const jwt = signAppJwt({ privateKeyPem: pem, iss: issuer, nowMs: Date.now() });
89
+ const jwt = signAppJwt({
90
+ privateKeyPem: pem,
91
+ iss: issuer,
92
+ nowMs: Date.now(),
93
+ });
84
94
  const response = await fetcher(`${api}${path}`, {
85
95
  method: 'GET',
86
96
  headers: {
@@ -109,12 +119,16 @@ export async function runDiagnose(argv) {
109
119
  /**
110
120
  * Call the API authenticated as one installation.
111
121
  *
112
- * @param installationId - the installation to act as.
113
- * @param path - path below the API root.
114
- * @returns the parsed body.
122
+ * @param installationId - The installation to act as.
123
+ * @param path - Path below the API root.
124
+ * @returns The parsed body.
115
125
  */
116
126
  async function asInstallation(installationId, path) {
117
- const jwt = signAppJwt({ privateKeyPem: pem, iss: issuer, nowMs: Date.now() });
127
+ const jwt = signAppJwt({
128
+ privateKeyPem: pem,
129
+ iss: issuer,
130
+ nowMs: Date.now(),
131
+ });
118
132
  const minted = await fetcher(`${api}/app/installations/${installationId}/access_tokens`, {
119
133
  method: 'POST',
120
134
  headers: {
@@ -129,8 +143,9 @@ export async function runDiagnose(argv) {
129
143
  throw new Error(`token request for installation ${installationId} -> ${minted.status}: ${mintedText.slice(0, 200)}`);
130
144
  }
131
145
  const token = JSON.parse(mintedText).token;
132
- if (!token)
146
+ if (!token) {
133
147
  throw new Error(`installation ${installationId} returned no token`);
148
+ }
134
149
  const response = await fetcher(`${api}${path}`, {
135
150
  method: 'GET',
136
151
  headers: {
@@ -141,8 +156,9 @@ export async function runDiagnose(argv) {
141
156
  },
142
157
  });
143
158
  const text = await response.text();
144
- if (!response.ok)
159
+ if (!response.ok) {
145
160
  throw new Error(`${path} -> ${response.status}: ${text.slice(0, 200)}`);
161
+ }
146
162
  return JSON.parse(text);
147
163
  }
148
164
  const app = (await asApp('/app')).json;
@@ -154,8 +170,9 @@ export async function runDiagnose(argv) {
154
170
  let page = '/app/installations?per_page=100';
155
171
  for (let index = 0; index < 10 && page; index += 1) {
156
172
  const result = await asApp(page);
157
- if (Array.isArray(result.json))
173
+ if (Array.isArray(result.json)) {
158
174
  installations.push(...result.json);
175
+ }
159
176
  page = nextLink(result.link);
160
177
  }
161
178
  if (installations.length === 0) {
@@ -175,7 +192,7 @@ export async function runDiagnose(argv) {
175
192
  // naming one that does not exist still fails with the same 422, so without this list a
176
193
  // repository that was never created looks exactly like one that is merely not selected.
177
194
  const listed = (await asInstallation(installation.id, '/installation/repositories?per_page=100'));
178
- const names = (listed.repositories ?? []).map((repo) => repo.full_name ?? '?');
195
+ const names = (listed.repositories ?? []).map(repo => repo.full_name ?? '?');
179
196
  reachable.set(installation.id, names);
180
197
  const shown = names.slice(0, 20).join(', ');
181
198
  say(` repositories (${names.length}${names.length >= 100 ? '+' : ''}): ${shown || '(none)'}${names.length > 20 ? ', …' : ''}`);
@@ -185,22 +202,23 @@ export async function runDiagnose(argv) {
185
202
  let problems = 0;
186
203
  for (const allowEntry of block.allow) {
187
204
  const [owner, repoPattern] = allowEntry.split('/');
188
- const matching = installations.filter((installation) => installation.account?.login?.toLowerCase() === owner?.toLowerCase());
205
+ const matching = installations.filter(installation => installation.account?.login?.toLowerCase() === owner?.toLowerCase());
189
206
  if (matching.length === 0) {
190
207
  say(` ${allowEntry}: no installation on account "${owner}"`);
191
208
  problems += 1;
192
209
  continue;
193
210
  }
194
- const visible = matching.some((installation) => {
211
+ const visible = matching.some(installation => {
195
212
  const known = reachable.get(installation.id) ?? [];
196
213
  if (repoPattern === '*') {
197
- return known.some((name) => name.toLowerCase().startsWith(`${owner?.toLowerCase()}/`));
214
+ return known.some(name => name.toLowerCase().startsWith(`${owner?.toLowerCase()}/`));
198
215
  }
199
- return known.some((name) => name.toLowerCase() === `${owner?.toLowerCase()}/${repoPattern?.toLowerCase()}`);
216
+ return known.some(name => name.toLowerCase() === `${owner?.toLowerCase()}/${repoPattern?.toLowerCase()}`);
200
217
  });
201
218
  say(` ${allowEntry}: ${visible ? 'reachable' : 'NOT in the repositories this installation can see'}`);
202
- if (!visible)
219
+ if (!visible) {
203
220
  problems += 1;
221
+ }
204
222
  }
205
223
  if (problems > 0) {
206
224
  warn('');