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
+4 -1
View File
@@ -70,7 +70,10 @@ export function parseServiceTenants(value: string | undefined | null): string[]
/** Read the configured service tenant allowlist from the environment. */
export function resolveInternalServiceTenants(
env: { INTERNAL_SERVICE_TENANTS?: string } = process.env,
// @types/node 22's ProcessEnv has only an index signature, so a direct
// default is not assignable to the narrow named-property shape. This is a
// type-only view of the same object; runtime behaviour is unchanged.
env: { INTERNAL_SERVICE_TENANTS?: string } = process.env as { INTERNAL_SERVICE_TENANTS?: string },
): string[] {
return parseServiceTenants(env.INTERNAL_SERVICE_TENANTS);
}
+4 -1
View File
@@ -63,7 +63,10 @@ function timingSafeEqualStr(a: string, b: string): boolean {
*/
export function verifyInternalServiceToken(
headers: HeaderLookup,
env: { INTERNAL_TOKEN?: string } = process.env,
// @types/node 22's ProcessEnv has only an index signature, so a direct
// default is not assignable to the narrow named-property shape. This is a
// type-only view of the same object; runtime behaviour is unchanged.
env: { INTERNAL_TOKEN?: string } = process.env as { INTERNAL_TOKEN?: string },
): boolean {
const expected = env.INTERNAL_TOKEN?.trim();
if (!expected) return false;