fix(ci): repair baseline typecheck and pnpm supply-chain config
CI (SIAX Cloud) / sonar (pull_request) Skipped
CI (SIAX Cloud) / Component conformance (blocking) (pull_request) Successful in 13s
CI (SIAX Cloud) / security (pull_request) Successful in 25s
masterplan-lock / check (pull_request) Successful in 8s
security / scan (pull_request) Failing after 51s
CI (SIAX Cloud) / integration (pull_request) Successful in 3m33s
CI (SIAX Cloud) / quality (pull_request) Successful in 4m30s

- pnpm-workspace.yaml: blockExoticSubdeps, minimumReleaseAge=10080,
  trustPolicy=no-downgrade (Semgrep p/ci blocking rules)
- src/auth/{internal-service-tenant,internal-token}.ts: type-only view of
  process.env for narrow named-property defaults (@types/node 22 ProcessEnv)
- tests: typed mutable env view for NODE_ENV save/restore (readonly in
  @types/node 22). No auth check weakened, no runtime behaviour changed.

Verification: pnpm run typecheck EXIT 0 (was 8 errors); vitest 30/30 PASS.
This commit is contained in:
2026-11-17 21:17:32 +01:00
parent 80d51a43cd
commit 680fa7ee6b
6 changed files with 37 additions and 9 deletions
+7 -2
View File
@@ -23,6 +23,11 @@ function req(url: string, headers: Record<string, string> = {}): NextRequest {
return new NextRequest(new URL(url, 'http://localhost'), { headers });
}
// @types/node 22 declares NODE_ENV readonly. These tests deliberately save
// and restore it; a typed mutable view keeps that exact without weakening the
// production auth checks under test.
const mutableEnv = process.env as Record<string, string | undefined>;
describe('anonymous-access regression: /api/orders (GET) and /api/admin/metrics (GET)', () => {
const saved = { auth: process.env.AUTH_ENFORCE, node: process.env.NODE_ENV };
@@ -35,8 +40,8 @@ describe('anonymous-access regression: /api/orders (GET) and /api/admin/metrics
afterEach(() => {
if (saved.auth === undefined) delete process.env.AUTH_ENFORCE;
else process.env.AUTH_ENFORCE = saved.auth;
if (saved.node === undefined) delete process.env.NODE_ENV;
else process.env.NODE_ENV = saved.node;
if (saved.node === undefined) delete mutableEnv.NODE_ENV;
else mutableEnv.NODE_ENV = saved.node;
});
it('REGRESSION: GET /api/orders 401s with no Authorization header (was: 200 + full order list)', async () => {