Compare commits

..
Author SHA1 Message Date
admin 97895dabd1 Merge pull request 'fix(ci): repair 0pt baseline typecheck and pnpm supply-chain config' (#627) from ci-baseline-fix-20261117 into main
CI (SIAX Cloud) / security (push) Successful in 19s
CI (SIAX Cloud) / Component conformance (blocking) (push) Successful in 9s
masterplan-lock / check (push) Successful in 6s
CI (SIAX Cloud) / sonar (push) Successful in 1m17s
security / scan (push) Failing after 1m0s
CI (SIAX Cloud) / integration (push) Successful in 1m25s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m47s
CI (SIAX Cloud) / quality (push) Successful in 2m14s
Deploy to Coolify / deploy (push) Successful in 2m29s
2026-11-17 20:30:15 +00:00
siax-bot 680fa7ee6b 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.
2026-11-17 21:17:32 +01:00
admin 80d51a43cd Merge pull request 'SEO: add Cross-Origin-Resource-Policy: cross-origin header' (#624) from seo-corp-20261117 into main
CI (SIAX Cloud) / security (push) Successful in 57s
CI (SIAX Cloud) / Component conformance (blocking) (push) Successful in 16s
masterplan-lock / check (push) Successful in 13s
CI (SIAX Cloud) / integration (push) Successful in 2m9s
CI (SIAX Cloud) / sonar (push) Successful in 1m41s
security / scan (push) Failing after 1m17s
CI (SIAX Cloud) / quality (push) Successful in 2m51s
Release chain (G17, ADR-W16-003) / Build, push, G17 (SBOM/scan/attest/verify/evidence) (push) Successful in 1m44s
Deploy to Coolify / deploy (push) Successful in 3m10s
security / scan (pull_request) Failing after 41s
CI (SIAX Cloud) / sonar (pull_request) Skipped
masterplan-lock / check (pull_request) Successful in 5s
CI (SIAX Cloud) / Component conformance (blocking) (pull_request) Successful in 9s
CI (SIAX Cloud) / security (pull_request) Successful in 16s
CI (SIAX Cloud) / integration (pull_request) Successful in 1m11s
CI (SIAX Cloud) / quality (pull_request) Successful in 4m18s
2026-11-17 16:09:52 +00:00
6 changed files with 37 additions and 9 deletions
+8
View File
@@ -16,3 +16,11 @@ packages:
onlyBuiltDependencies:
- sharp
- esbuild
# Supply-chain hardening (Semgrep p/ci blocking rules):
# - no transitive dependency from an untrusted/exotic source
# - wait 7 days (10080 min) for newly published versions
# - never accept a downgrade of security settings via a dependency update
blockExoticSubdeps: true
minimumReleaseAge: 10080
trustPolicy: no-downgrade
+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;
+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 () => {
+8 -3
View File
@@ -36,6 +36,11 @@ function h(init: Record<string, string>): Headers {
return new Headers(init);
}
// @types/node 22 declares NODE_ENV readonly. These tests deliberately save
// and restore it; a typed mutable view keeps that exact without weakening the
// fail-closed auth contract under test.
const mutableEnv = process.env as Record<string, string | undefined>;
describe('auth default -- fail-closed (no AUTH_ENFORCE in the environment)', () => {
const saved = { auth: process.env.AUTH_ENFORCE, node: process.env.NODE_ENV };
@@ -46,8 +51,8 @@ describe('auth default -- fail-closed (no AUTH_ENFORCE in the environment)', ()
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: with the variable unset, an unauthenticated request is REJECTED (401)', async () => {
@@ -98,7 +103,7 @@ describe('auth default -- fail-closed (no AUTH_ENFORCE in the environment)', ()
});
it('a production process with AUTH_ENFORCE=false cannot serve a request at all (throws)', async () => {
process.env.NODE_ENV = 'production';
mutableEnv.NODE_ENV = 'production';
process.env.AUTH_ENFORCE = 'false';
await expect(
resolveAuthContext(h({ 'x-tenant-id': 'tenant_attacker' }), { verify: okVerify }),
+6 -2
View File
@@ -20,6 +20,10 @@ function req(path: string, headers: Record<string, string> = {}): NextRequest {
return new NextRequest(new URL(path, 'http://localhost'), { headers });
}
// @types/node 22 declares NODE_ENV readonly. This key is one of the three
// restored below; a typed mutable view keeps that exact.
const mutableEnv = process.env as Record<string, string | undefined>;
describe('middleware.ts: internal-token path for /api/0pt/quality/bridge-run', () => {
const saved = { auth: process.env.AUTH_ENFORCE, internal: process.env.INTERNAL_TOKEN, node: process.env.NODE_ENV };
@@ -31,8 +35,8 @@ describe('middleware.ts: internal-token path for /api/0pt/quality/bridge-run', (
afterEach(() => {
for (const [k, v] of Object.entries(saved)) {
const envKey = k === 'auth' ? 'AUTH_ENFORCE' : k === 'internal' ? 'INTERNAL_TOKEN' : 'NODE_ENV';
if (v === undefined) delete process.env[envKey];
else process.env[envKey] = v;
if (v === undefined) delete mutableEnv[envKey];
else mutableEnv[envKey] = v;
}
});