@bleedingdev/modern-js-server-runtime-extensions 3.9.0-ultramodern.5 → 3.9.0-ultramodern.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/README.md +5 -5
  2. package/dist/cjs/bff-policy/crossProjectPolicy.js +1 -11
  3. package/dist/cjs/contract-gate-snapshot-store/http-store.js +1 -8
  4. package/dist/cjs/telemetry/exporters.js +4 -4
  5. package/dist/cjs/telemetry/healthSetup.js +14 -18
  6. package/dist/cjs/telemetry/lifecycle.js +5 -5
  7. package/dist/cjs/telemetry/plugin.js +3 -4
  8. package/dist/cjs/telemetry/runtimeEndpoints.js +1 -7
  9. package/dist/cjs/telemetryCore.js +5 -5
  10. package/dist/esm/bff-policy/crossProjectPolicy.mjs +1 -11
  11. package/dist/esm/contract-gate-snapshot-store/http-store.mjs +1 -8
  12. package/dist/esm/telemetry/exporters.mjs +2 -2
  13. package/dist/esm/telemetry/healthSetup.mjs +14 -18
  14. package/dist/esm/telemetry/lifecycle.mjs +6 -6
  15. package/dist/esm/telemetry/plugin.mjs +3 -4
  16. package/dist/esm/telemetry/runtimeEndpoints.mjs +1 -7
  17. package/dist/esm/telemetryCore.mjs +1 -1
  18. package/dist/esm-node/bff-policy/crossProjectPolicy.mjs +1 -11
  19. package/dist/esm-node/contract-gate-snapshot-store/http-store.mjs +1 -8
  20. package/dist/esm-node/telemetry/exporters.mjs +2 -2
  21. package/dist/esm-node/telemetry/healthSetup.mjs +14 -18
  22. package/dist/esm-node/telemetry/lifecycle.mjs +6 -6
  23. package/dist/esm-node/telemetry/plugin.mjs +3 -4
  24. package/dist/esm-node/telemetry/runtimeEndpoints.mjs +1 -7
  25. package/dist/esm-node/telemetryCore.mjs +1 -1
  26. package/dist/types/bff-policy/crossProjectPolicy.d.ts +2 -11
  27. package/dist/types/telemetry/exporters.d.ts +1 -1
  28. package/dist/types/telemetry/healthSetup.d.ts +2 -4
  29. package/dist/types/telemetry/lifecycle.d.ts +2 -2
  30. package/dist/types/telemetry/runtimeEndpoints.d.ts +1 -3
  31. package/dist/types/telemetryCore.d.ts +1 -1
  32. package/dist/types-esm/bff-policy/crossProjectPolicy.d.mts +2 -11
  33. package/dist/types-esm/telemetry/exporters.d.mts +1 -1
  34. package/dist/types-esm/telemetry/healthSetup.d.mts +2 -4
  35. package/dist/types-esm/telemetry/lifecycle.d.mts +2 -2
  36. package/dist/types-esm/telemetry/runtimeEndpoints.d.mts +1 -3
  37. package/dist/types-esm/telemetryCore.d.mts +1 -1
  38. package/package.json +10 -10
  39. package/src/bff-policy/crossProjectPolicy.ts +7 -34
  40. package/src/contract-gate-snapshot-store/http-store.ts +1 -11
  41. package/src/telemetry/exporters.ts +1 -1
  42. package/src/telemetry/healthSetup.ts +16 -27
  43. package/src/telemetry/lifecycle.ts +7 -7
  44. package/src/telemetry/plugin.ts +2 -4
  45. package/src/telemetry/runtimeEndpoints.ts +0 -10
  46. package/src/telemetryCore.ts +1 -1
  47. package/tests/bff-policy/crossProjectPolicy.matrix.test.ts +0 -37
  48. package/tests/bff-policy/crossProjectPolicy.test.ts +26 -833
  49. package/tests/bff-policy/resolveCrossProjectPolicy.test.ts +0 -58
  50. package/tests/contractGateSnapshotStore.test.ts +0 -51
  51. package/tests/nativeErrorResponse.test.ts +0 -81
  52. package/tests/nativeServerAssembly.test.ts +34 -51
  53. package/tests/static-serving/static.test.ts +31 -20
  54. package/tests/telemetry.test.ts +0 -97
  55. package/tests/telemetryHealthMonitor.test.ts +0 -2
  56. package/tests/telemetryHealthObservation.test.ts +302 -0
  57. package/tests/telemetryLifecycle.test.ts +0 -54
  58. package/tests/telemetryRegistryQueueMatrix.test.ts +14 -110
  59. package/dist/cjs/telemetry/canaryCompatibility.js +0 -73
  60. package/dist/esm/telemetry/canaryCompatibility.mjs +0 -35
  61. package/dist/esm-node/telemetry/canaryCompatibility.mjs +0 -36
  62. package/dist/types/telemetry/canaryCompatibility.d.ts +0 -19
  63. package/dist/types-esm/telemetry/canaryCompatibility.d.mts +0 -19
  64. package/src/telemetry/canaryCompatibility.ts +0 -55
  65. package/tests/registration.test.ts +0 -27
  66. package/tests/static-serving/provider.test.ts +0 -83
  67. package/tests/telemetryAutopilot.test.ts +0 -993
  68. package/tests/telemetryCanaryCompatibility.test.ts +0 -152
package/README.md CHANGED
@@ -9,8 +9,8 @@ stays small:
9
9
  exporters, SLO alerts, telemetry-aware metrics wrapping and the
10
10
  `injectTelemetryPlugin()` server plugin (runtime status + runtime fallback
11
11
  signal endpoints).
12
- - **Contract-gate canary autopilot** — `TelemetryCanaryOrchestrator`,
13
- `ContractGateAutopilot` and the file/HTTP contract-gate snapshot stores.
12
+ - **Contract-gate health observation** — `TelemetryHealthMonitor`,
13
+ `ContractGateSnapshotObserver` and the file/HTTP contract-gate snapshot stores.
14
14
  - **Module federation runtime helpers** — remote CSS collection for SSR
15
15
  (`collectDirectRemoteModuleFederationCss`, `injectModuleFederationCssPlugin()`)
16
16
  and MF asset cache-header policies (`resolveMfAssetCacheHeaders`,
@@ -26,7 +26,7 @@ identically:
26
26
 
27
27
  - `injectTelemetryPlugin()` — no-op unless `server.telemetry` is configured.
28
28
  The runtime-fallback-signal endpoint is opt-in
29
- (`canary.autopilot.runtimeFallbackSignal.enabled: true`) and requires an
29
+ (`health.snapshotObservation.runtimeFallbackSignal.enabled: true`) and requires an
30
30
  auth token (`auth.expectedValue` / `auth.expectedValueEnv`); the
31
31
  `/_modern/runtime/status` endpoint returns a bare health probe unless the
32
32
  caller authenticates with that token.
@@ -50,7 +50,7 @@ single typed pass by `parseServerRuntimeExtensionsEnv()` in `src/env.ts`:
50
50
  | --- | --- | --- |
51
51
  | `MODERN_ENV` | _unset_ | Deployment environment name (also drives `.env.{MODERN_ENV}` loading in the server bootstrap). First candidate for the telemetry `environment` label. |
52
52
  | `NODE_ENV` | _unset_ | Standard Node.js environment name. Second candidate for the telemetry `environment` label; the final fallback is `development`. |
53
- | `MODERN_CONTRACT_GATES_FILE` | `.modern/contract-gates.json` (resolved against the app directory) | Path of the contract-gate snapshot file used by the canary autopilot and the runtime fallback signal endpoint when `server.telemetry.canary.autopilot.gateSnapshotPath` is not configured. |
53
+ | `MODERN_CONTRACT_GATES_FILE` | `.modern/contract-gates.json` (resolved against the app directory) | Path of the contract-gate snapshot file used by the health observer and the runtime fallback signal endpoint when `server.telemetry.health.snapshotObservation.gateSnapshotPath` is not configured. |
54
54
 
55
55
  Exporter endpoints and the module federation remote manifest timeout are
56
56
  configured through `server.telemetry.exporters.*.endpoint` and plugin options
@@ -62,6 +62,6 @@ read only at config time by `@modern-js/app-tools` (`baseline.ts`), not at
62
62
  server runtime.
63
63
 
64
64
  One dynamic indirection cannot be statically parsed:
65
- `server.telemetry.canary.autopilot.runtimeFallbackSignal.auth.expectedValueEnv`
65
+ `server.telemetry.health.snapshotObservation.runtimeFallbackSignal.auth.expectedValueEnv`
66
66
  names an arbitrary environment variable that holds the expected runtime-signal
67
67
  auth token; it is read when the auth config is normalized.
@@ -32,7 +32,6 @@ const BFF_OPERATION_CONTEXT_HEADER = 'x-operation-id';
32
32
  const BFF_OPERATION_CONTEXT_DETAIL_HEADER = 'x-modernjs-bff-operation-context';
33
33
  const DEFAULT_DENY_STATUS = 403;
34
34
  const NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE = 'cross-project namespace allowlist requires verifyProducerIdentity';
35
- let hasWarnedAdvisoryNamespaceAllowlist = false;
36
35
  const splitRoutePath = (routePath)=>routePath.split('/').filter(Boolean);
37
36
  const isDynamicRouteSegment = (segment)=>segment.startsWith(':') || '*' === segment || segment.startsWith('*') || segment.startsWith('{*');
38
37
  const hasTrailingSlash = (routePath)=>routePath.length > 1 && routePath.endsWith('/');
@@ -137,11 +136,6 @@ const createViolation = (reason, message, status)=>({
137
136
  message,
138
137
  status
139
138
  });
140
- const warnAdvisoryNamespaceAllowlist = ()=>{
141
- if (hasWarnedAdvisoryNamespaceAllowlist) return;
142
- hasWarnedAdvisoryNamespaceAllowlist = true;
143
- console.warn(`[Modern.js BFF] ${NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE}. allowClientAssertedNamespace=true will continue to evaluate allowlist against client-asserted requestId namespaces only.`);
144
- };
145
139
  const createCrossProjectPolicyEvaluationState = (headers, policy, observedRequest)=>({
146
140
  headers,
147
141
  policy,
@@ -152,7 +146,6 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
152
146
  requireOperationSchemaHash: policy.requireOperationSchemaHash ?? true,
153
147
  requireOperationVersion: policy.requireOperationVersion ?? true,
154
148
  allowUnknownOperations: policy.allowUnknownOperations ?? false,
155
- allowClientAssertedNamespace: policy.allowClientAssertedNamespace ?? false,
156
149
  verifyProducerIdentity: 'function' == typeof policy.verifyProducerIdentity ? policy.verifyProducerIdentity : void 0,
157
150
  allowedNamespaces: (policy.allowedNamespaces || []).map((item)=>item.trim().toLowerCase()).filter(Boolean),
158
151
  envelopeHeader: normalizeHeaderName(policy.envelopeHeader, BFF_ENVELOPE_HEADER),
@@ -168,10 +161,7 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
168
161
  complete: false
169
162
  });
170
163
  const checkNamespaceAllowlistVerifier = (state)=>{
171
- if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) {
172
- if (!state.allowClientAssertedNamespace) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
173
- warnAdvisoryNamespaceAllowlist();
174
- }
164
+ if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
175
165
  };
176
166
  const checkEnvelopeHeader = (state)=>{
177
167
  const envelopeRaw = readHeader(state.headers, state.envelopeHeader);
@@ -34,13 +34,6 @@ __webpack_require__.d(__webpack_exports__, {
34
34
  const external_resolve_js_namespaceObject = require("./resolve.js");
35
35
  const external_types_js_namespaceObject = require("./types.js");
36
36
  const DEFAULT_HTTP_STORE_TIMEOUT_MS = 5000;
37
- const BUILTIN_HTTP_STATE_STORE_MODULES = new Set([
38
- 'http',
39
- '@modern-js/server-core/http',
40
- '@modern-js/server-core/contract-gate-http-store',
41
- '@modern-js/server-runtime-extensions/http',
42
- '@modern-js/server-runtime-extensions/contract-gate-http-store'
43
- ]);
44
37
  const normalizeHttpStoreOptions = (options)=>{
45
38
  const endpoint = 'string' == typeof options?.endpoint ? options.endpoint.trim() : '';
46
39
  if (!endpoint) throw new Error('[telemetry.health.snapshot] HTTP stateStore requires options.endpoint');
@@ -119,7 +112,7 @@ const createHttpContractGateSnapshotStore = (options)=>{
119
112
  };
120
113
  const tryResolveBuiltinSnapshotStore = (input)=>{
121
114
  const moduleName = input.stateStore.module.trim();
122
- if (!BUILTIN_HTTP_STATE_STORE_MODULES.has(moduleName)) return;
115
+ if ('http' !== moduleName) return;
123
116
  return createHttpContractGateSnapshotStore(input.stateStore.options || {});
124
117
  };
125
118
  exports.createHttpContractGateSnapshotStore = __webpack_exports__.createHttpContractGateSnapshotStore;
@@ -126,22 +126,22 @@ function createVictoriaMetricsTelemetryExporter(options = {}) {
126
126
  }
127
127
  };
128
128
  }
129
- function maybeWarnLegacyOtlpEndpoint(endpoint) {
129
+ function warnOnMetricsOtlpEndpoint(endpoint) {
130
130
  if (!endpoint || !endpoint.includes('/v1/metrics')) return;
131
131
  console.warn(`[telemetry] OTLP endpoint "${endpoint}" looks like a metrics path. UltraModern telemetry exporter expects log-style envelopes (default: ${DEFAULT_OTLP_ENDPOINT}).`);
132
132
  }
133
133
  __webpack_require__.d(__webpack_exports__, {
134
134
  createOtlpTelemetryExporter: ()=>createOtlpTelemetryExporter,
135
135
  createVictoriaMetricsTelemetryExporter: ()=>createVictoriaMetricsTelemetryExporter,
136
- maybeWarnLegacyOtlpEndpoint: ()=>maybeWarnLegacyOtlpEndpoint
136
+ warnOnMetricsOtlpEndpoint: ()=>warnOnMetricsOtlpEndpoint
137
137
  });
138
138
  exports.createOtlpTelemetryExporter = __webpack_exports__.createOtlpTelemetryExporter;
139
139
  exports.createVictoriaMetricsTelemetryExporter = __webpack_exports__.createVictoriaMetricsTelemetryExporter;
140
- exports.maybeWarnLegacyOtlpEndpoint = __webpack_exports__.maybeWarnLegacyOtlpEndpoint;
140
+ exports.warnOnMetricsOtlpEndpoint = __webpack_exports__.warnOnMetricsOtlpEndpoint;
141
141
  for(var __rspack_i in __webpack_exports__)if (-1 === [
142
142
  "createOtlpTelemetryExporter",
143
143
  "createVictoriaMetricsTelemetryExporter",
144
- "maybeWarnLegacyOtlpEndpoint"
144
+ "warnOnMetricsOtlpEndpoint"
145
145
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
146
146
  Object.defineProperty(exports, '__esModule', {
147
147
  value: true
@@ -33,7 +33,6 @@ __webpack_require__.d(__webpack_exports__, {
33
33
  const index_js_namespaceObject = require("../contract-gate-snapshot-store/index.js");
34
34
  const external_runtimeFallbackSignal_js_namespaceObject = require("../runtimeFallbackSignal.js");
35
35
  const external_telemetryCore_js_namespaceObject = require("../telemetryCore.js");
36
- const external_canaryCompatibility_js_namespaceObject = require("./canaryCompatibility.js");
37
36
  function emitHealthTransitionMetric(registry, evaluation) {
38
37
  try {
39
38
  registry.enqueueMetric({
@@ -48,36 +47,34 @@ function emitHealthTransitionMetric(registry, evaluation) {
48
47
  });
49
48
  } catch (_error) {}
50
49
  }
51
- const setupTelemetryHealthMonitoring = ({ registry, appDirectory, legacyHealthConfig })=>{
52
- if (!legacyHealthConfig?.enabled) return {};
53
- const contractGates = legacyHealthConfig.contractGates;
54
- const canaryCompatibility = (0, external_canaryCompatibility_js_namespaceObject.createTelemetryCanaryCompatibility)(registry);
50
+ const setupTelemetryHealthMonitoring = ({ registry, appDirectory, healthConfig })=>{
51
+ if (!healthConfig?.enabled) return {};
52
+ const contractGates = healthConfig.contractGates;
55
53
  const healthMonitor = new external_telemetryCore_js_namespaceObject.TelemetryHealthMonitor({
56
54
  registry,
57
- evaluationIntervalMs: legacyHealthConfig.evaluationIntervalMs,
58
- minConsecutiveHealthyEvaluations: legacyHealthConfig.minConsecutiveHealthyEvaluations,
59
- minConsecutiveFailedEvaluations: legacyHealthConfig.rollbackConsecutiveFailures,
60
- maxQueueUtilization: legacyHealthConfig.maxQueueUtilization,
61
- maxTotalDropped: legacyHealthConfig.maxTotalDropped,
62
- maxUnhealthyExporters: legacyHealthConfig.maxUnhealthyExporters,
55
+ evaluationIntervalMs: healthConfig.evaluationIntervalMs,
56
+ minConsecutiveHealthyEvaluations: healthConfig.minConsecutiveHealthyEvaluations,
57
+ minConsecutiveFailedEvaluations: healthConfig.minConsecutiveFailedEvaluations,
58
+ maxQueueUtilization: healthConfig.maxQueueUtilization,
59
+ maxTotalDropped: healthConfig.maxTotalDropped,
60
+ maxUnhealthyExporters: healthConfig.maxUnhealthyExporters,
63
61
  requiredContractGates: Object.keys(contractGates || {}),
64
62
  onTransition: (evaluation)=>{
65
63
  emitHealthTransitionMetric(registry, evaluation);
66
- canaryCompatibility.observe(evaluation);
67
64
  }
68
65
  });
69
66
  if (contractGates) healthMonitor.setContractGates(contractGates);
70
67
  let gateSnapshotStorePromise;
71
68
  let runtimeFallbackSignalConfig;
72
- const snapshotObservationEnabled = legacyHealthConfig.autopilot?.enabled ?? true;
69
+ const snapshotObservationEnabled = healthConfig.snapshotObservation?.enabled ?? true;
73
70
  if (snapshotObservationEnabled) {
74
- const gateSnapshotPath = (0, index_js_namespaceObject.resolveContractGateSnapshotPath)(appDirectory, legacyHealthConfig.autopilot?.gateSnapshotPath);
71
+ const gateSnapshotPath = (0, index_js_namespaceObject.resolveContractGateSnapshotPath)(appDirectory, healthConfig.snapshotObservation?.gateSnapshotPath);
75
72
  gateSnapshotStorePromise = (0, index_js_namespaceObject.resolveContractGateSnapshotStore)({
76
73
  appDirectory,
77
74
  gateSnapshotPath: gateSnapshotPath || index_js_namespaceObject.DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH,
78
- stateStore: legacyHealthConfig.autopilot?.stateStore
75
+ stateStore: healthConfig.snapshotObservation?.stateStore
79
76
  });
80
- const runtimeSignalConfig = legacyHealthConfig.autopilot?.runtimeFallbackSignal;
77
+ const runtimeSignalConfig = healthConfig.snapshotObservation?.runtimeFallbackSignal;
81
78
  if (runtimeSignalConfig?.enabled === true) runtimeFallbackSignalConfig = {
82
79
  endpoint: (0, external_runtimeFallbackSignal_js_namespaceObject.resolveRuntimeFallbackSignalEndpoint)(runtimeSignalConfig.endpoint),
83
80
  gateName: runtimeSignalConfig.gateName?.trim() || external_runtimeFallbackSignal_js_namespaceObject.DEFAULT_RUNTIME_FALLBACK_GATE_NAME,
@@ -89,10 +86,9 @@ const setupTelemetryHealthMonitoring = ({ registry, appDirectory, legacyHealthCo
89
86
  runtimeState: (0, external_runtimeFallbackSignal_js_namespaceObject.createRuntimeFallbackSignalRuntimeState)()
90
87
  };
91
88
  }
92
- const runtimeStatusAuthConfig = runtimeFallbackSignalConfig?.auth ?? (0, external_runtimeFallbackSignal_js_namespaceObject.normalizeRuntimeFallbackSignalAuthConfig)(legacyHealthConfig.autopilot?.runtimeFallbackSignal?.auth);
89
+ const runtimeStatusAuthConfig = runtimeFallbackSignalConfig?.auth ?? (0, external_runtimeFallbackSignal_js_namespaceObject.normalizeRuntimeFallbackSignalAuthConfig)(healthConfig.snapshotObservation?.runtimeFallbackSignal?.auth);
93
90
  return {
94
91
  healthMonitor,
95
- canaryCompatibility,
96
92
  gateSnapshotStorePromise,
97
93
  runtimeFallbackSignalConfig,
98
94
  runtimeStatusAuthConfig
@@ -45,7 +45,7 @@ const ensureTelemetryBeforeExitHook = ()=>{
45
45
  ])close().catch((error)=>utils_namespaceObject.logger.error(error));
46
46
  });
47
47
  };
48
- const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHealthConfig, healthMonitor, gateSnapshotStorePromise, appDirectory })=>{
48
+ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, healthConfig, healthMonitor, gateSnapshotStorePromise, appDirectory })=>{
49
49
  let contractGateSnapshotObserver;
50
50
  let closePromise;
51
51
  const closeTelemetryLane = ()=>{
@@ -65,7 +65,7 @@ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHeal
65
65
  if (prepared || closePromise) return;
66
66
  prepared = true;
67
67
  if (telemetryConfig.exporters?.otlp?.enabled) {
68
- (0, external_telemetryCore_js_namespaceObject.maybeWarnLegacyOtlpEndpoint)(telemetryConfig.exporters.otlp.endpoint);
68
+ (0, external_telemetryCore_js_namespaceObject.warnOnMetricsOtlpEndpoint)(telemetryConfig.exporters.otlp.endpoint);
69
69
  await registry.register((0, external_telemetryCore_js_namespaceObject.createOtlpTelemetryExporter)(telemetryConfig.exporters.otlp));
70
70
  }
71
71
  if (telemetryConfig.exporters?.victoriaMetrics?.enabled) await registry.register((0, external_telemetryCore_js_namespaceObject.createVictoriaMetricsTelemetryExporter)(telemetryConfig.exporters.victoriaMetrics));
@@ -78,10 +78,10 @@ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHeal
78
78
  const gateSnapshotStore = await gateSnapshotStorePromise;
79
79
  contractGateSnapshotObserver = new external_contractGateSnapshotObserver_js_namespaceObject.ContractGateSnapshotObserver({
80
80
  monitor: healthMonitor,
81
- gateSnapshotPath: (0, index_js_namespaceObject.resolveContractGateSnapshotPath)(appDirectory, legacyHealthConfig?.autopilot?.gateSnapshotPath),
81
+ gateSnapshotPath: (0, index_js_namespaceObject.resolveContractGateSnapshotPath)(appDirectory, healthConfig?.snapshotObservation?.gateSnapshotPath),
82
82
  gateSnapshotStore,
83
- pollIntervalMs: legacyHealthConfig?.autopilot?.pollIntervalMs,
84
- gateStaleAfterMs: legacyHealthConfig?.autopilot?.gateStaleAfterMs
83
+ pollIntervalMs: healthConfig?.snapshotObservation?.pollIntervalMs,
84
+ gateStaleAfterMs: healthConfig?.snapshotObservation?.gateStaleAfterMs
85
85
  });
86
86
  }
87
87
  if (contractGateSnapshotObserver) await contractGateSnapshotObserver.start();
@@ -95,16 +95,15 @@ const injectTelemetryPlugin = ()=>({
95
95
  redactionKeys: telemetryConfig.redactionKeys,
96
96
  slo: resolveTelemetrySloOptions(telemetryConfig.slo)
97
97
  });
98
- const { healthMonitor, canaryCompatibility, gateSnapshotStorePromise, runtimeFallbackSignalConfig, runtimeStatusAuthConfig } = (0, external_healthSetup_js_namespaceObject.setupTelemetryHealthMonitoring)({
98
+ const { healthMonitor, gateSnapshotStorePromise, runtimeFallbackSignalConfig, runtimeStatusAuthConfig } = (0, external_healthSetup_js_namespaceObject.setupTelemetryHealthMonitoring)({
99
99
  registry,
100
100
  appDirectory,
101
- legacyHealthConfig: telemetryConfig.canary
101
+ healthConfig: telemetryConfig.health
102
102
  });
103
103
  if (runtimeFallbackSignalConfig) middlewares.push((0, external_runtimeEndpoints_js_namespaceObject.createRuntimeFallbackSignalMiddleware)(runtimeFallbackSignalConfig));
104
104
  middlewares.push((0, external_runtimeEndpoints_js_namespaceObject.createRuntimeStatusMiddleware)({
105
105
  registry,
106
106
  healthMonitor,
107
- canaryCompatibility,
108
107
  runtimeFallbackSignalConfig,
109
108
  runtimeStatusAuthConfig
110
109
  }));
@@ -136,7 +135,7 @@ const injectTelemetryPlugin = ()=>({
136
135
  api,
137
136
  registry,
138
137
  telemetryConfig,
139
- legacyHealthConfig: telemetryConfig.canary,
138
+ healthConfig: telemetryConfig.health,
140
139
  healthMonitor,
141
140
  gateSnapshotStorePromise,
142
141
  appDirectory
@@ -67,7 +67,7 @@ const createRuntimeFallbackSignalMiddleware = (signalConfig)=>({
67
67
  }
68
68
  }
69
69
  });
70
- const createRuntimeStatusMiddleware = ({ registry, healthMonitor, canaryCompatibility, runtimeFallbackSignalConfig, runtimeStatusAuthConfig })=>({
70
+ const createRuntimeStatusMiddleware = ({ registry, healthMonitor, runtimeFallbackSignalConfig, runtimeStatusAuthConfig })=>({
71
71
  name: 'telemetry-runtime-status',
72
72
  path: external_runtimeFallbackSignal_js_namespaceObject.DEFAULT_RUNTIME_STATUS_ENDPOINT,
73
73
  method: 'get',
@@ -93,12 +93,6 @@ const createRuntimeStatusMiddleware = ({ registry, healthMonitor, canaryCompatib
93
93
  } : {
94
94
  enabled: false
95
95
  },
96
- canary: healthSnapshot && canaryCompatibility ? {
97
- enabled: true,
98
- ...canaryCompatibility.getStatusSnapshot(healthSnapshot)
99
- } : {
100
- enabled: false
101
- },
102
96
  runtimeFallbackSignal: runtimeFallbackSignalConfig ? {
103
97
  enabled: true,
104
98
  endpoint: runtimeFallbackSignalConfig.endpoint,
@@ -34,8 +34,8 @@ __webpack_require__.d(__webpack_exports__, {
34
34
  createOtlpTelemetryExporter: ()=>exporters_js_namespaceObject.createOtlpTelemetryExporter,
35
35
  createTelemetryAwareMetrics: ()=>metrics_js_namespaceObject.createTelemetryAwareMetrics,
36
36
  createVictoriaMetricsTelemetryExporter: ()=>exporters_js_namespaceObject.createVictoriaMetricsTelemetryExporter,
37
- maybeWarnLegacyOtlpEndpoint: ()=>exporters_js_namespaceObject.maybeWarnLegacyOtlpEndpoint,
38
- toTelemetryEnvelope: ()=>envelope_js_namespaceObject.toTelemetryEnvelope
37
+ toTelemetryEnvelope: ()=>envelope_js_namespaceObject.toTelemetryEnvelope,
38
+ warnOnMetricsOtlpEndpoint: ()=>exporters_js_namespaceObject.warnOnMetricsOtlpEndpoint
39
39
  });
40
40
  const envelope_js_namespaceObject = require("./telemetry/envelope.js");
41
41
  const exporters_js_namespaceObject = require("./telemetry/exporters.js");
@@ -49,8 +49,8 @@ exports.TelemetryStartupHealthError = __webpack_exports__.TelemetryStartupHealth
49
49
  exports.createOtlpTelemetryExporter = __webpack_exports__.createOtlpTelemetryExporter;
50
50
  exports.createTelemetryAwareMetrics = __webpack_exports__.createTelemetryAwareMetrics;
51
51
  exports.createVictoriaMetricsTelemetryExporter = __webpack_exports__.createVictoriaMetricsTelemetryExporter;
52
- exports.maybeWarnLegacyOtlpEndpoint = __webpack_exports__.maybeWarnLegacyOtlpEndpoint;
53
52
  exports.toTelemetryEnvelope = __webpack_exports__.toTelemetryEnvelope;
53
+ exports.warnOnMetricsOtlpEndpoint = __webpack_exports__.warnOnMetricsOtlpEndpoint;
54
54
  for(var __rspack_i in __webpack_exports__)if (-1 === [
55
55
  "TelemetryHealthMonitor",
56
56
  "TelemetryRegistry",
@@ -58,8 +58,8 @@ for(var __rspack_i in __webpack_exports__)if (-1 === [
58
58
  "createOtlpTelemetryExporter",
59
59
  "createTelemetryAwareMetrics",
60
60
  "createVictoriaMetricsTelemetryExporter",
61
- "maybeWarnLegacyOtlpEndpoint",
62
- "toTelemetryEnvelope"
61
+ "toTelemetryEnvelope",
62
+ "warnOnMetricsOtlpEndpoint"
63
63
  ].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
64
64
  Object.defineProperty(exports, '__esModule', {
65
65
  value: true
@@ -3,7 +3,6 @@ const BFF_OPERATION_CONTEXT_HEADER = 'x-operation-id';
3
3
  const BFF_OPERATION_CONTEXT_DETAIL_HEADER = 'x-modernjs-bff-operation-context';
4
4
  const DEFAULT_DENY_STATUS = 403;
5
5
  const NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE = 'cross-project namespace allowlist requires verifyProducerIdentity';
6
- let hasWarnedAdvisoryNamespaceAllowlist = false;
7
6
  const splitRoutePath = (routePath)=>routePath.split('/').filter(Boolean);
8
7
  const isDynamicRouteSegment = (segment)=>segment.startsWith(':') || '*' === segment || segment.startsWith('*') || segment.startsWith('{*');
9
8
  const hasTrailingSlash = (routePath)=>routePath.length > 1 && routePath.endsWith('/');
@@ -108,11 +107,6 @@ const createViolation = (reason, message, status)=>({
108
107
  message,
109
108
  status
110
109
  });
111
- const warnAdvisoryNamespaceAllowlist = ()=>{
112
- if (hasWarnedAdvisoryNamespaceAllowlist) return;
113
- hasWarnedAdvisoryNamespaceAllowlist = true;
114
- console.warn(`[Modern.js BFF] ${NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE}. allowClientAssertedNamespace=true will continue to evaluate allowlist against client-asserted requestId namespaces only.`);
115
- };
116
110
  const createCrossProjectPolicyEvaluationState = (headers, policy, observedRequest)=>({
117
111
  headers,
118
112
  policy,
@@ -123,7 +117,6 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
123
117
  requireOperationSchemaHash: policy.requireOperationSchemaHash ?? true,
124
118
  requireOperationVersion: policy.requireOperationVersion ?? true,
125
119
  allowUnknownOperations: policy.allowUnknownOperations ?? false,
126
- allowClientAssertedNamespace: policy.allowClientAssertedNamespace ?? false,
127
120
  verifyProducerIdentity: 'function' == typeof policy.verifyProducerIdentity ? policy.verifyProducerIdentity : void 0,
128
121
  allowedNamespaces: (policy.allowedNamespaces || []).map((item)=>item.trim().toLowerCase()).filter(Boolean),
129
122
  envelopeHeader: normalizeHeaderName(policy.envelopeHeader, BFF_ENVELOPE_HEADER),
@@ -139,10 +132,7 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
139
132
  complete: false
140
133
  });
141
134
  const checkNamespaceAllowlistVerifier = (state)=>{
142
- if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) {
143
- if (!state.allowClientAssertedNamespace) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
144
- warnAdvisoryNamespaceAllowlist();
145
- }
135
+ if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
146
136
  };
147
137
  const checkEnvelopeHeader = (state)=>{
148
138
  const envelopeRaw = readHeader(state.headers, state.envelopeHeader);
@@ -1,13 +1,6 @@
1
1
  import { normalizeSnapshot } from "./resolve.mjs";
2
2
  import { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION } from "./types.mjs";
3
3
  const DEFAULT_HTTP_STORE_TIMEOUT_MS = 5000;
4
- const BUILTIN_HTTP_STATE_STORE_MODULES = new Set([
5
- 'http',
6
- '@modern-js/server-core/http',
7
- '@modern-js/server-core/contract-gate-http-store',
8
- '@modern-js/server-runtime-extensions/http',
9
- '@modern-js/server-runtime-extensions/contract-gate-http-store'
10
- ]);
11
4
  const normalizeHttpStoreOptions = (options)=>{
12
5
  const endpoint = 'string' == typeof options?.endpoint ? options.endpoint.trim() : '';
13
6
  if (!endpoint) throw new Error('[telemetry.health.snapshot] HTTP stateStore requires options.endpoint');
@@ -86,7 +79,7 @@ const createHttpContractGateSnapshotStore = (options)=>{
86
79
  };
87
80
  const tryResolveBuiltinSnapshotStore = (input)=>{
88
81
  const moduleName = input.stateStore.module.trim();
89
- if (!BUILTIN_HTTP_STATE_STORE_MODULES.has(moduleName)) return;
82
+ if ('http' !== moduleName) return;
90
83
  return createHttpContractGateSnapshotStore(input.stateStore.options || {});
91
84
  };
92
85
  export { createHttpContractGateSnapshotStore, tryResolveBuiltinSnapshotStore };
@@ -97,8 +97,8 @@ function createVictoriaMetricsTelemetryExporter(options = {}) {
97
97
  }
98
98
  };
99
99
  }
100
- function maybeWarnLegacyOtlpEndpoint(endpoint) {
100
+ function warnOnMetricsOtlpEndpoint(endpoint) {
101
101
  if (!endpoint || !endpoint.includes('/v1/metrics')) return;
102
102
  console.warn(`[telemetry] OTLP endpoint "${endpoint}" looks like a metrics path. UltraModern telemetry exporter expects log-style envelopes (default: ${DEFAULT_OTLP_ENDPOINT}).`);
103
103
  }
104
- export { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, maybeWarnLegacyOtlpEndpoint };
104
+ export { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, warnOnMetricsOtlpEndpoint };
@@ -1,7 +1,6 @@
1
1
  import { DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH, resolveContractGateSnapshotPath, resolveContractGateSnapshotStore } from "../contract-gate-snapshot-store/index.mjs";
2
2
  import { DEFAULT_RUNTIME_FALLBACK_FAILURE_HOLD_MS, DEFAULT_RUNTIME_FALLBACK_GATE_NAME, DEFAULT_RUNTIME_FALLBACK_MAX_BODY_BYTES, createRuntimeFallbackSignalRuntimeState, normalizeRequiredRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackSignalAuthConfig, normalizeRuntimeFallbackTrustPolicy, resolveRuntimeFallbackSignalEndpoint } from "../runtimeFallbackSignal.mjs";
3
3
  import { TelemetryHealthMonitor } from "../telemetryCore.mjs";
4
- import { createTelemetryCanaryCompatibility } from "./canaryCompatibility.mjs";
5
4
  function emitHealthTransitionMetric(registry, evaluation) {
6
5
  try {
7
6
  registry.enqueueMetric({
@@ -16,36 +15,34 @@ function emitHealthTransitionMetric(registry, evaluation) {
16
15
  });
17
16
  } catch (_error) {}
18
17
  }
19
- const setupTelemetryHealthMonitoring = ({ registry, appDirectory, legacyHealthConfig })=>{
20
- if (!legacyHealthConfig?.enabled) return {};
21
- const contractGates = legacyHealthConfig.contractGates;
22
- const canaryCompatibility = createTelemetryCanaryCompatibility(registry);
18
+ const setupTelemetryHealthMonitoring = ({ registry, appDirectory, healthConfig })=>{
19
+ if (!healthConfig?.enabled) return {};
20
+ const contractGates = healthConfig.contractGates;
23
21
  const healthMonitor = new TelemetryHealthMonitor({
24
22
  registry,
25
- evaluationIntervalMs: legacyHealthConfig.evaluationIntervalMs,
26
- minConsecutiveHealthyEvaluations: legacyHealthConfig.minConsecutiveHealthyEvaluations,
27
- minConsecutiveFailedEvaluations: legacyHealthConfig.rollbackConsecutiveFailures,
28
- maxQueueUtilization: legacyHealthConfig.maxQueueUtilization,
29
- maxTotalDropped: legacyHealthConfig.maxTotalDropped,
30
- maxUnhealthyExporters: legacyHealthConfig.maxUnhealthyExporters,
23
+ evaluationIntervalMs: healthConfig.evaluationIntervalMs,
24
+ minConsecutiveHealthyEvaluations: healthConfig.minConsecutiveHealthyEvaluations,
25
+ minConsecutiveFailedEvaluations: healthConfig.minConsecutiveFailedEvaluations,
26
+ maxQueueUtilization: healthConfig.maxQueueUtilization,
27
+ maxTotalDropped: healthConfig.maxTotalDropped,
28
+ maxUnhealthyExporters: healthConfig.maxUnhealthyExporters,
31
29
  requiredContractGates: Object.keys(contractGates || {}),
32
30
  onTransition: (evaluation)=>{
33
31
  emitHealthTransitionMetric(registry, evaluation);
34
- canaryCompatibility.observe(evaluation);
35
32
  }
36
33
  });
37
34
  if (contractGates) healthMonitor.setContractGates(contractGates);
38
35
  let gateSnapshotStorePromise;
39
36
  let runtimeFallbackSignalConfig;
40
- const snapshotObservationEnabled = legacyHealthConfig.autopilot?.enabled ?? true;
37
+ const snapshotObservationEnabled = healthConfig.snapshotObservation?.enabled ?? true;
41
38
  if (snapshotObservationEnabled) {
42
- const gateSnapshotPath = resolveContractGateSnapshotPath(appDirectory, legacyHealthConfig.autopilot?.gateSnapshotPath);
39
+ const gateSnapshotPath = resolveContractGateSnapshotPath(appDirectory, healthConfig.snapshotObservation?.gateSnapshotPath);
43
40
  gateSnapshotStorePromise = resolveContractGateSnapshotStore({
44
41
  appDirectory,
45
42
  gateSnapshotPath: gateSnapshotPath || DEFAULT_CONTRACT_GATE_SNAPSHOT_PATH,
46
- stateStore: legacyHealthConfig.autopilot?.stateStore
43
+ stateStore: healthConfig.snapshotObservation?.stateStore
47
44
  });
48
- const runtimeSignalConfig = legacyHealthConfig.autopilot?.runtimeFallbackSignal;
45
+ const runtimeSignalConfig = healthConfig.snapshotObservation?.runtimeFallbackSignal;
49
46
  if (runtimeSignalConfig?.enabled === true) runtimeFallbackSignalConfig = {
50
47
  endpoint: resolveRuntimeFallbackSignalEndpoint(runtimeSignalConfig.endpoint),
51
48
  gateName: runtimeSignalConfig.gateName?.trim() || DEFAULT_RUNTIME_FALLBACK_GATE_NAME,
@@ -57,10 +54,9 @@ const setupTelemetryHealthMonitoring = ({ registry, appDirectory, legacyHealthCo
57
54
  runtimeState: createRuntimeFallbackSignalRuntimeState()
58
55
  };
59
56
  }
60
- const runtimeStatusAuthConfig = runtimeFallbackSignalConfig?.auth ?? normalizeRuntimeFallbackSignalAuthConfig(legacyHealthConfig.autopilot?.runtimeFallbackSignal?.auth);
57
+ const runtimeStatusAuthConfig = runtimeFallbackSignalConfig?.auth ?? normalizeRuntimeFallbackSignalAuthConfig(healthConfig.snapshotObservation?.runtimeFallbackSignal?.auth);
61
58
  return {
62
59
  healthMonitor,
63
- canaryCompatibility,
64
60
  gateSnapshotStorePromise,
65
61
  runtimeFallbackSignalConfig,
66
62
  runtimeStatusAuthConfig
@@ -1,7 +1,7 @@
1
1
  import { logger } from "@modern-js/utils";
2
2
  import { resolveContractGateSnapshotPath } from "../contract-gate-snapshot-store/index.mjs";
3
3
  import { ContractGateSnapshotObserver } from "../contractGateSnapshotObserver.mjs";
4
- import { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, maybeWarnLegacyOtlpEndpoint } from "../telemetryCore.mjs";
4
+ import { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, warnOnMetricsOtlpEndpoint } from "../telemetryCore.mjs";
5
5
  const activeTelemetryLaneClosers = new Set();
6
6
  let telemetryBeforeExitHookInstalled = false;
7
7
  const ensureTelemetryBeforeExitHook = ()=>{
@@ -13,7 +13,7 @@ const ensureTelemetryBeforeExitHook = ()=>{
13
13
  ])close().catch((error)=>logger.error(error));
14
14
  });
15
15
  };
16
- const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHealthConfig, healthMonitor, gateSnapshotStorePromise, appDirectory })=>{
16
+ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, healthConfig, healthMonitor, gateSnapshotStorePromise, appDirectory })=>{
17
17
  let contractGateSnapshotObserver;
18
18
  let closePromise;
19
19
  const closeTelemetryLane = ()=>{
@@ -33,7 +33,7 @@ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHeal
33
33
  if (prepared || closePromise) return;
34
34
  prepared = true;
35
35
  if (telemetryConfig.exporters?.otlp?.enabled) {
36
- maybeWarnLegacyOtlpEndpoint(telemetryConfig.exporters.otlp.endpoint);
36
+ warnOnMetricsOtlpEndpoint(telemetryConfig.exporters.otlp.endpoint);
37
37
  await registry.register(createOtlpTelemetryExporter(telemetryConfig.exporters.otlp));
38
38
  }
39
39
  if (telemetryConfig.exporters?.victoriaMetrics?.enabled) await registry.register(createVictoriaMetricsTelemetryExporter(telemetryConfig.exporters.victoriaMetrics));
@@ -46,10 +46,10 @@ const registerTelemetryLifecycle = ({ api, registry, telemetryConfig, legacyHeal
46
46
  const gateSnapshotStore = await gateSnapshotStorePromise;
47
47
  contractGateSnapshotObserver = new ContractGateSnapshotObserver({
48
48
  monitor: healthMonitor,
49
- gateSnapshotPath: resolveContractGateSnapshotPath(appDirectory, legacyHealthConfig?.autopilot?.gateSnapshotPath),
49
+ gateSnapshotPath: resolveContractGateSnapshotPath(appDirectory, healthConfig?.snapshotObservation?.gateSnapshotPath),
50
50
  gateSnapshotStore,
51
- pollIntervalMs: legacyHealthConfig?.autopilot?.pollIntervalMs,
52
- gateStaleAfterMs: legacyHealthConfig?.autopilot?.gateStaleAfterMs
51
+ pollIntervalMs: healthConfig?.snapshotObservation?.pollIntervalMs,
52
+ gateStaleAfterMs: healthConfig?.snapshotObservation?.gateStaleAfterMs
53
53
  });
54
54
  }
55
55
  if (contractGateSnapshotObserver) await contractGateSnapshotObserver.start();
@@ -42,16 +42,15 @@ const injectTelemetryPlugin = ()=>({
42
42
  redactionKeys: telemetryConfig.redactionKeys,
43
43
  slo: resolveTelemetrySloOptions(telemetryConfig.slo)
44
44
  });
45
- const { healthMonitor, canaryCompatibility, gateSnapshotStorePromise, runtimeFallbackSignalConfig, runtimeStatusAuthConfig } = setupTelemetryHealthMonitoring({
45
+ const { healthMonitor, gateSnapshotStorePromise, runtimeFallbackSignalConfig, runtimeStatusAuthConfig } = setupTelemetryHealthMonitoring({
46
46
  registry,
47
47
  appDirectory,
48
- legacyHealthConfig: telemetryConfig.canary
48
+ healthConfig: telemetryConfig.health
49
49
  });
50
50
  if (runtimeFallbackSignalConfig) middlewares.push(createRuntimeFallbackSignalMiddleware(runtimeFallbackSignalConfig));
51
51
  middlewares.push(createRuntimeStatusMiddleware({
52
52
  registry,
53
53
  healthMonitor,
54
- canaryCompatibility,
55
54
  runtimeFallbackSignalConfig,
56
55
  runtimeStatusAuthConfig
57
56
  }));
@@ -83,7 +82,7 @@ const injectTelemetryPlugin = ()=>({
83
82
  api,
84
83
  registry,
85
84
  telemetryConfig,
86
- legacyHealthConfig: telemetryConfig.canary,
85
+ healthConfig: telemetryConfig.health,
87
86
  healthMonitor,
88
87
  gateSnapshotStorePromise,
89
88
  appDirectory
@@ -34,7 +34,7 @@ const createRuntimeFallbackSignalMiddleware = (signalConfig)=>({
34
34
  }
35
35
  }
36
36
  });
37
- const createRuntimeStatusMiddleware = ({ registry, healthMonitor, canaryCompatibility, runtimeFallbackSignalConfig, runtimeStatusAuthConfig })=>({
37
+ const createRuntimeStatusMiddleware = ({ registry, healthMonitor, runtimeFallbackSignalConfig, runtimeStatusAuthConfig })=>({
38
38
  name: 'telemetry-runtime-status',
39
39
  path: DEFAULT_RUNTIME_STATUS_ENDPOINT,
40
40
  method: 'get',
@@ -60,12 +60,6 @@ const createRuntimeStatusMiddleware = ({ registry, healthMonitor, canaryCompatib
60
60
  } : {
61
61
  enabled: false
62
62
  },
63
- canary: healthSnapshot && canaryCompatibility ? {
64
- enabled: true,
65
- ...canaryCompatibility.getStatusSnapshot(healthSnapshot)
66
- } : {
67
- enabled: false
68
- },
69
63
  runtimeFallbackSignal: runtimeFallbackSignalConfig ? {
70
64
  enabled: true,
71
65
  endpoint: runtimeFallbackSignalConfig.endpoint,
@@ -1,5 +1,5 @@
1
1
  export { toTelemetryEnvelope } from "./telemetry/envelope.mjs";
2
- export { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, maybeWarnLegacyOtlpEndpoint } from "./telemetry/exporters.mjs";
2
+ export { createOtlpTelemetryExporter, createVictoriaMetricsTelemetryExporter, warnOnMetricsOtlpEndpoint } from "./telemetry/exporters.mjs";
3
3
  export { TelemetryHealthMonitor } from "./telemetry/healthMonitor.mjs";
4
4
  export { createTelemetryAwareMetrics } from "./telemetry/metrics.mjs";
5
5
  export { TelemetryRegistry } from "./telemetry/registry.mjs";
@@ -4,7 +4,6 @@ const BFF_OPERATION_CONTEXT_HEADER = 'x-operation-id';
4
4
  const BFF_OPERATION_CONTEXT_DETAIL_HEADER = 'x-modernjs-bff-operation-context';
5
5
  const DEFAULT_DENY_STATUS = 403;
6
6
  const NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE = 'cross-project namespace allowlist requires verifyProducerIdentity';
7
- let hasWarnedAdvisoryNamespaceAllowlist = false;
8
7
  const splitRoutePath = (routePath)=>routePath.split('/').filter(Boolean);
9
8
  const isDynamicRouteSegment = (segment)=>segment.startsWith(':') || '*' === segment || segment.startsWith('*') || segment.startsWith('{*');
10
9
  const hasTrailingSlash = (routePath)=>routePath.length > 1 && routePath.endsWith('/');
@@ -109,11 +108,6 @@ const createViolation = (reason, message, status)=>({
109
108
  message,
110
109
  status
111
110
  });
112
- const warnAdvisoryNamespaceAllowlist = ()=>{
113
- if (hasWarnedAdvisoryNamespaceAllowlist) return;
114
- hasWarnedAdvisoryNamespaceAllowlist = true;
115
- console.warn(`[Modern.js BFF] ${NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE}. allowClientAssertedNamespace=true will continue to evaluate allowlist against client-asserted requestId namespaces only.`);
116
- };
117
111
  const createCrossProjectPolicyEvaluationState = (headers, policy, observedRequest)=>({
118
112
  headers,
119
113
  policy,
@@ -124,7 +118,6 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
124
118
  requireOperationSchemaHash: policy.requireOperationSchemaHash ?? true,
125
119
  requireOperationVersion: policy.requireOperationVersion ?? true,
126
120
  allowUnknownOperations: policy.allowUnknownOperations ?? false,
127
- allowClientAssertedNamespace: policy.allowClientAssertedNamespace ?? false,
128
121
  verifyProducerIdentity: 'function' == typeof policy.verifyProducerIdentity ? policy.verifyProducerIdentity : void 0,
129
122
  allowedNamespaces: (policy.allowedNamespaces || []).map((item)=>item.trim().toLowerCase()).filter(Boolean),
130
123
  envelopeHeader: normalizeHeaderName(policy.envelopeHeader, BFF_ENVELOPE_HEADER),
@@ -140,10 +133,7 @@ const createCrossProjectPolicyEvaluationState = (headers, policy, observedReques
140
133
  complete: false
141
134
  });
142
135
  const checkNamespaceAllowlistVerifier = (state)=>{
143
- if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) {
144
- if (!state.allowClientAssertedNamespace) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
145
- warnAdvisoryNamespaceAllowlist();
146
- }
136
+ if (state.allowedNamespaces.length > 0 && void 0 === state.verifyProducerIdentity) return createViolation('producer_identity_mismatch', NAMESPACE_ALLOWLIST_REQUIRES_VERIFIER_MESSAGE, state.status);
147
137
  };
148
138
  const checkEnvelopeHeader = (state)=>{
149
139
  const envelopeRaw = readHeader(state.headers, state.envelopeHeader);
@@ -2,13 +2,6 @@ import "node:module";
2
2
  import { normalizeSnapshot } from "./resolve.mjs";
3
3
  import { CONTRACT_GATE_SNAPSHOT_SCHEMA_VERSION } from "./types.mjs";
4
4
  const DEFAULT_HTTP_STORE_TIMEOUT_MS = 5000;
5
- const BUILTIN_HTTP_STATE_STORE_MODULES = new Set([
6
- 'http',
7
- '@modern-js/server-core/http',
8
- '@modern-js/server-core/contract-gate-http-store',
9
- '@modern-js/server-runtime-extensions/http',
10
- '@modern-js/server-runtime-extensions/contract-gate-http-store'
11
- ]);
12
5
  const normalizeHttpStoreOptions = (options)=>{
13
6
  const endpoint = 'string' == typeof options?.endpoint ? options.endpoint.trim() : '';
14
7
  if (!endpoint) throw new Error('[telemetry.health.snapshot] HTTP stateStore requires options.endpoint');
@@ -87,7 +80,7 @@ const createHttpContractGateSnapshotStore = (options)=>{
87
80
  };
88
81
  const tryResolveBuiltinSnapshotStore = (input)=>{
89
82
  const moduleName = input.stateStore.module.trim();
90
- if (!BUILTIN_HTTP_STATE_STORE_MODULES.has(moduleName)) return;
83
+ if ('http' !== moduleName) return;
91
84
  return createHttpContractGateSnapshotStore(input.stateStore.options || {});
92
85
  };
93
86
  export { createHttpContractGateSnapshotStore, tryResolveBuiltinSnapshotStore };