diff --git a/.git2gus/config.json b/.git2gus/config.json index a6ce991..040dcc9 100644 --- a/.git2gus/config.json +++ b/.git2gus/config.json @@ -1,4 +1,9 @@ { "productTag": "a1aB00000004Bx8IAE", - "defaultBuild": "offcore.tooling.64" + "defaultBuild": "offcore.tooling.64", + "issueTypeLabels": { + "feature": "USER STORY", + "regression": "BUG P1", + "bug": "BUG P3" + } } diff --git a/src/shared/auth.ts b/src/shared/auth.ts index d16e94f..29d89c2 100644 --- a/src/shared/auth.ts +++ b/src/shared/auth.ts @@ -128,12 +128,6 @@ export async function getAllAllowedOrgs(): Promise // Filter out orgs that are not in ORG_ALLOWLIST const allowedOrgs = await filterAllowedOrgs(sanitizedOrgs, orgAllowList); - // If no orgs are found, stop the server - if (allowedOrgs.length === 0) { - console.error('No orgs found that match the allowed orgs configuration. Check MCP Server startup config.'); - process.exit(1); - } - return allowedOrgs; } diff --git a/test/unit/auth.test.ts b/test/unit/auth.test.ts index 6903730..64d7962 100644 --- a/test/unit/auth.test.ts +++ b/test/unit/auth.test.ts @@ -30,7 +30,6 @@ describe('auth tests', () => { const sandbox = sinon.createSandbox(); let configAggregatorCreateStub: sinon.SinonStub; let configAggregatorGetInfoStub: sinon.SinonStub; - let processExitStub: sinon.SinonStub; beforeEach(() => { // Reset ConfigAggregator instance before each test @@ -41,9 +40,6 @@ describe('auth tests', () => { configAggregatorCreateStub = sandbox.stub(ConfigAggregator, 'create'); configAggregatorGetInfoStub = sandbox.stub(); - // Stub process.exit to prevent tests from actually exiting - processExitStub = sandbox.stub(process, 'exit'); - // Mock the ConfigAggregator instance const mockAggregator = { getInfo: configAggregatorGetInfoStub, @@ -302,7 +298,6 @@ describe('auth tests', () => { describe('getAllAllowedOrgs', () => { let authInfoListStub: sinon.SinonStub; - let consoleErrorStub: sinon.SinonStub; beforeEach(() => { // Set up mock org data that will be used across all tests @@ -335,7 +330,6 @@ describe('auth tests', () => { authInfoListStub = sandbox.stub(AuthInfo, 'listAllAuthorizations'); authInfoListStub.resolves(mockOrgs); - consoleErrorStub = sandbox.stub(console, 'error'); // Set up default responses for config queries (empty configs) // This reuses the existing configAggregatorGetInfoStub from the main describe block @@ -363,24 +357,6 @@ describe('auth tests', () => { configAggregatorGetInfoStub.withArgs(OrgConfigProperties.TARGET_DEV_HUB).returns(emptyDevHubConfig); }); - it('should exit on an empty org list', async () => { - authInfoListStub.resolves([]); - - // @ts-expect-error Dynamic import with query string to control ORG_ALLOWLIST for testing - const authModule = (await import('../../src/shared/auth.js?orgs=NONEXISTENT_ORG')) as typeof AuthModuleType; - const { getAllAllowedOrgs } = authModule; - - await getAllAllowedOrgs(); - - expect(authInfoListStub.calledOnce).to.be.true; - expect(processExitStub.calledWith(1)).to.be.true; - expect( - consoleErrorStub.calledWith( - 'No orgs found that match the allowed orgs configuration. Check MCP Server startup config.' - ) - ).to.be.true; - }); - it('should only return orgs that exists in allowlist', async () => { // @ts-expect-error Dynamic import with query string to control ORG_ALLOWLIST for testing const authModule = (await import('../../src/shared/auth.js?orgs=org1@example.com')) as typeof AuthModuleType;