@@ -4,7 +4,7 @@ import fs from "node:fs";
44import os from "node:os" ;
55import path from "node:path" ;
66import { createServer } from "node:http" ;
7- import { pathToFileURL } from "node:url" ;
7+ import { fileURLToPath , pathToFileURL } from "node:url" ;
88import {
99 parseArgs ,
1010 normalizeBrokerUrl ,
@@ -266,6 +266,19 @@ test("runRegistration integration path succeeds against live local HTTP server",
266266 }
267267} ) ;
268268
269+ test ( "env schema accepts org IDs for deprecated workspace aliases" , ( ) => {
270+ const schemaPath = fileURLToPath ( new URL ( "../.env.schema" , import . meta. url ) ) ;
271+ const lines = fs . readFileSync ( schemaPath , "utf8" ) . split ( / \r ? \n / ) ;
272+
273+ const gatewayWorkspaceIndex = lines . findIndex ( ( line ) => line . startsWith ( "GATEWAY_BROKER_WORKSPACE_ID=" ) ) ;
274+ assert . notEqual ( gatewayWorkspaceIndex , - 1 , "GATEWAY_BROKER_WORKSPACE_ID missing from .env.schema" ) ;
275+ assert . equal ( lines [ gatewayWorkspaceIndex - 1 ] . trim ( ) , "# @sensitive=false @type=string" ) ;
276+
277+ const slackWorkspaceIndex = lines . findIndex ( ( line ) => line . startsWith ( "SLACK_BROKER_WORKSPACE_ID=" ) ) ;
278+ assert . notEqual ( slackWorkspaceIndex , - 1 , "SLACK_BROKER_WORKSPACE_ID missing from .env.schema" ) ;
279+ assert . equal ( lines [ slackWorkspaceIndex - 1 ] . trim ( ) , "# @sensitive=false @type=string" ) ;
280+ } ) ;
281+
269282test ( "runRegistration does not write SLACK_BOT_TOKEN even when broker returns encrypted_bot_token" , async ( ) => {
270283 const fetchImpl = async ( url ) => {
271284 if ( String ( url ) . endsWith ( "/api/broker-pubkey" ) ) {
0 commit comments