@marcusrbrown/infra 0.9.10 → 0.9.12
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/package.json
CHANGED
|
@@ -13,7 +13,9 @@ const envKeys = [
|
|
|
13
13
|
'DISCORD_GUILD_ID',
|
|
14
14
|
'DISCORD_TOKEN',
|
|
15
15
|
'GATEWAY_HOST',
|
|
16
|
+
'GATEWAY_PRESENCE_CHANNEL_ID',
|
|
16
17
|
'GATEWAY_TRIGGER_ROLE_ID',
|
|
18
|
+
'GATEWAY_WEBHOOK_SECRET',
|
|
17
19
|
'HOME',
|
|
18
20
|
'OBJECT_STORE_HOSTS',
|
|
19
21
|
'PATH',
|
|
@@ -361,6 +363,56 @@ describe('gateway deploy', () => {
|
|
|
361
363
|
const env = getGatewayDeployEnv()
|
|
362
364
|
expect(env.GATEWAY_TRIGGER_ROLE_ID).toBe('987654321098765432')
|
|
363
365
|
})
|
|
366
|
+
|
|
367
|
+
// ── announce opt-in vars parity ───────────────────────────────────────────
|
|
368
|
+
|
|
369
|
+
it('forwards GATEWAY_WEBHOOK_SECRET when set', () => {
|
|
370
|
+
setManagedEnv({
|
|
371
|
+
GATEWAY_HOST: 'gateway.example.com',
|
|
372
|
+
GATEWAY_WEBHOOK_SECRET: 'hmac-secret-value',
|
|
373
|
+
HOME: '/tmp/test-home',
|
|
374
|
+
PATH: '/usr/bin:/bin',
|
|
375
|
+
SSH_AUTH_SOCK: '/tmp/test-sock',
|
|
376
|
+
})
|
|
377
|
+
const env = getGatewayDeployEnv()
|
|
378
|
+
expect(env.GATEWAY_WEBHOOK_SECRET).toBe('hmac-secret-value')
|
|
379
|
+
})
|
|
380
|
+
|
|
381
|
+
it('GATEWAY_WEBHOOK_SECRET unset → forwarded as empty string', () => {
|
|
382
|
+
setManagedEnv({
|
|
383
|
+
GATEWAY_HOST: 'gateway.example.com',
|
|
384
|
+
GATEWAY_WEBHOOK_SECRET: undefined,
|
|
385
|
+
HOME: '/tmp/test-home',
|
|
386
|
+
PATH: '/usr/bin:/bin',
|
|
387
|
+
SSH_AUTH_SOCK: '/tmp/test-sock',
|
|
388
|
+
})
|
|
389
|
+
const env = getGatewayDeployEnv()
|
|
390
|
+
expect(env.GATEWAY_WEBHOOK_SECRET).toBe('')
|
|
391
|
+
})
|
|
392
|
+
|
|
393
|
+
it('forwards GATEWAY_PRESENCE_CHANNEL_ID when set', () => {
|
|
394
|
+
setManagedEnv({
|
|
395
|
+
GATEWAY_HOST: 'gateway.example.com',
|
|
396
|
+
GATEWAY_PRESENCE_CHANNEL_ID: '111222333444555666',
|
|
397
|
+
HOME: '/tmp/test-home',
|
|
398
|
+
PATH: '/usr/bin:/bin',
|
|
399
|
+
SSH_AUTH_SOCK: '/tmp/test-sock',
|
|
400
|
+
})
|
|
401
|
+
const env = getGatewayDeployEnv()
|
|
402
|
+
expect(env.GATEWAY_PRESENCE_CHANNEL_ID).toBe('111222333444555666')
|
|
403
|
+
})
|
|
404
|
+
|
|
405
|
+
it('GATEWAY_PRESENCE_CHANNEL_ID unset → forwarded as empty string', () => {
|
|
406
|
+
setManagedEnv({
|
|
407
|
+
GATEWAY_HOST: 'gateway.example.com',
|
|
408
|
+
GATEWAY_PRESENCE_CHANNEL_ID: undefined,
|
|
409
|
+
HOME: '/tmp/test-home',
|
|
410
|
+
PATH: '/usr/bin:/bin',
|
|
411
|
+
SSH_AUTH_SOCK: '/tmp/test-sock',
|
|
412
|
+
})
|
|
413
|
+
const env = getGatewayDeployEnv()
|
|
414
|
+
expect(env.GATEWAY_PRESENCE_CHANNEL_ID).toBe('')
|
|
415
|
+
})
|
|
364
416
|
})
|
|
365
417
|
|
|
366
418
|
describe('validateGatewayRemotePreconditions', () => {
|
|
@@ -56,6 +56,8 @@ export function getGatewayDeployEnv(): Record<string, string> {
|
|
|
56
56
|
WORKSPACE_OPENCODE_MODEL: process.env.WORKSPACE_OPENCODE_MODEL ?? '',
|
|
57
57
|
WORKSPACE_OPENCODE_CONFIG: process.env.WORKSPACE_OPENCODE_CONFIG ?? '',
|
|
58
58
|
GATEWAY_TRIGGER_ROLE_ID: process.env.GATEWAY_TRIGGER_ROLE_ID ?? '',
|
|
59
|
+
GATEWAY_WEBHOOK_SECRET: process.env.GATEWAY_WEBHOOK_SECRET ?? '',
|
|
60
|
+
GATEWAY_PRESENCE_CHANNEL_ID: process.env.GATEWAY_PRESENCE_CHANNEL_ID ?? '',
|
|
59
61
|
}
|
|
60
62
|
}
|
|
61
63
|
|