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
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:
@@ -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);
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user