@lunora/runtime 1.0.0-alpha.15 → 1.0.0-alpha.16

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.
package/dist/index.d.mts CHANGED
@@ -1808,15 +1808,19 @@ interface WorkerOptions {
1808
1808
  /**
1809
1809
  * Opt into an authorization-open posture for sharded and fan-out access.
1810
1810
  *
1811
- * By default (this flag unset/`false`) the runtime FAILS CLOSED: when
1812
- * neither {@link WorkerOptions.authorizeShard} nor {@link WorkerOptions.authorizeFanOut}
1813
- * is configured, naming a non-default shard (a potential cross-tenant hop)
1814
- * or sending a fan-out envelope is rejected with a `403`
1815
- * (`FORBIDDEN_SHARD`/`FORBIDDEN_FANOUT`). Set this to `true` to allow such
1816
- * requests from any caller (including unauthenticated ones) appropriate
1817
- * only when every table is protected by per-row RLS. The runtime then emits
1818
- * a single `console.warn` so the open posture stays visible in logs. Has no
1819
- * effect once an `authorize*` callback is configured (those gate directly).
1811
+ * By default (this flag unset/`false`) the runtime FAILS CLOSED per
1812
+ * operation: naming a non-default shard (a potential cross-tenant hop) is
1813
+ * rejected with a `403` (`FORBIDDEN_SHARD`) unless
1814
+ * {@link WorkerOptions.authorizeShard} is configured, and a fan-out
1815
+ * envelope is rejected (`FORBIDDEN_FANOUT`) unless
1816
+ * {@link WorkerOptions.authorizeFanOut} is. Set this to `true` to allow
1817
+ * such requests from any caller (including unauthenticated ones)
1818
+ * appropriate only when every table is protected by per-row RLS. The
1819
+ * runtime then emits a single `console.warn` so the open posture stays
1820
+ * visible in logs. The flag is consulted per operation: it has no effect
1821
+ * on an operation whose own `authorize*` callback is configured (that
1822
+ * callback gates directly), but configuring only one of the two callbacks
1823
+ * does NOT cover the other operation.
1820
1824
  *
1821
1825
  * NOTE: this is a behaviour change from earlier alphas, where the same
1822
1826
  * situation was warn-once-then-allow. Apps that relied on client-chosen
package/dist/index.d.ts CHANGED
@@ -1808,15 +1808,19 @@ interface WorkerOptions {
1808
1808
  /**
1809
1809
  * Opt into an authorization-open posture for sharded and fan-out access.
1810
1810
  *
1811
- * By default (this flag unset/`false`) the runtime FAILS CLOSED: when
1812
- * neither {@link WorkerOptions.authorizeShard} nor {@link WorkerOptions.authorizeFanOut}
1813
- * is configured, naming a non-default shard (a potential cross-tenant hop)
1814
- * or sending a fan-out envelope is rejected with a `403`
1815
- * (`FORBIDDEN_SHARD`/`FORBIDDEN_FANOUT`). Set this to `true` to allow such
1816
- * requests from any caller (including unauthenticated ones) appropriate
1817
- * only when every table is protected by per-row RLS. The runtime then emits
1818
- * a single `console.warn` so the open posture stays visible in logs. Has no
1819
- * effect once an `authorize*` callback is configured (those gate directly).
1811
+ * By default (this flag unset/`false`) the runtime FAILS CLOSED per
1812
+ * operation: naming a non-default shard (a potential cross-tenant hop) is
1813
+ * rejected with a `403` (`FORBIDDEN_SHARD`) unless
1814
+ * {@link WorkerOptions.authorizeShard} is configured, and a fan-out
1815
+ * envelope is rejected (`FORBIDDEN_FANOUT`) unless
1816
+ * {@link WorkerOptions.authorizeFanOut} is. Set this to `true` to allow
1817
+ * such requests from any caller (including unauthenticated ones)
1818
+ * appropriate only when every table is protected by per-row RLS. The
1819
+ * runtime then emits a single `console.warn` so the open posture stays
1820
+ * visible in logs. The flag is consulted per operation: it has no effect
1821
+ * on an operation whose own `authorize*` callback is configured (that
1822
+ * callback gates directly), but configuring only one of the two callbacks
1823
+ * does NOT cover the other operation.
1820
1824
  *
1821
1825
  * NOTE: this is a behaviour change from earlier alphas, where the same
1822
1826
  * situation was warn-once-then-allow. Apps that relied on client-chosen
package/dist/index.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  export { toAirbyteMessages, toFivetranResponse } from './packem_shared/toAirbyteMessages-DrHdplb4.mjs';
2
- export { composeWorker, createLunoraHandler, createWorker, defineRpcEnvelope, resolveLunoraOptions, withFrameworkWorker } from './packem_shared/composeWorker-BUf56-tZ.mjs';
2
+ export { composeWorker, createLunoraHandler, createWorker, defineRpcEnvelope, resolveLunoraOptions, withFrameworkWorker } from './packem_shared/composeWorker-BnZf6iRH.mjs';
3
3
  export { createCrossShardRelationCapabilities } from './packem_shared/createCrossShardRelationCapabilities-C0KOf7er.mjs';
4
4
  export { DEFAULT_REGISTRY_CACHE_TTL_MS, SHARD_REGISTRY_DO_NAME, createDynamicShardRegistry } from './packem_shared/DEFAULT_REGISTRY_CACHE_TTL_MS-ocax8v0n.mjs';
5
5
  export { LunoraError, toErrorResponse } from './packem_shared/LunoraError-CL0aOtpo.mjs';
@@ -7,7 +7,7 @@ export { emitLogEvent, emitRpcEvent } from './packem_shared/emitLogEvent-pEdtqAK
7
7
  export { analyticsEngineSink, combineSinks, consoleSink, sentrySink, webhookSink } from './packem_shared/analyticsEngineSink-DqEvrQs0.mjs';
8
8
  export { createQueryCoordinator, createStaticShardRegistry, mergeStrategyForAggregate } from './packem_shared/createQueryCoordinator-ZeZYUPNu.mjs';
9
9
  export { applyJurisdiction, resolveShard } from './packem_shared/applyJurisdiction-BkZtTkct.mjs';
10
- export { decorateResponse, enforceOrigin, handleCorsPreflight, resolveSecurity } from './packem_shared/decorateResponse-HRXo-oOD.mjs';
10
+ export { decorateResponse, enforceOrigin, handleCorsPreflight, resolveSecurity } from './packem_shared/decorateResponse-igd8FJqk.mjs';
11
11
  export { NOOP_EXECUTION_CONTEXT } from './packem_shared/NOOP_EXECUTION_CONTEXT-CCTu0Bf1.mjs';
12
12
  export { composeIdentityResolvers, routeIdentityResolvers } from './packem_shared/composeIdentityResolvers-YjvUKisc.mjs';
13
13
 
@@ -4,7 +4,7 @@ import { wrapResolverWithContract } from './composeIdentityResolvers-YjvUKisc.mj
4
4
  export { composeIdentityResolvers, routeIdentityResolvers } from './composeIdentityResolvers-YjvUKisc.mjs';
5
5
  import { emitRpcEvent } from './emitLogEvent-pEdtqAK8.mjs';
6
6
  import { resolveShard, applyJurisdiction } from './applyJurisdiction-BkZtTkct.mjs';
7
- import { resolveSecurity, handleCorsPreflight, enforceOrigin, decorateResponse, enforceWebSocketOrigin } from './decorateResponse-HRXo-oOD.mjs';
7
+ import { resolveSecurity, handleCorsPreflight, enforceOrigin, decorateResponse, enforceWebSocketOrigin } from './decorateResponse-igd8FJqk.mjs';
8
8
 
9
9
  const RELAY_NAME_INFIX = "::relay::";
10
10
  const relayName = (ownerKey, index) => `${ownerKey}${RELAY_NAME_INFIX}${String(index)}`;
@@ -251,7 +251,7 @@ const buildAuthAdminRoutes = (deps) => {
251
251
  const candidate = error;
252
252
  const code = typeof candidate.code === "string" ? candidate.code : "AUTH_ADMIN_ERROR";
253
253
  console.error("[lunora] auth admin operation failed:", error);
254
- throw new LunoraError("auth admin operation failed", { code, status: AUTH_ADMIN_ERROR_STATUS[code] ?? 400 });
254
+ throw new LunoraError("auth admin operation failed", { code, status: AUTH_ADMIN_ERROR_STATUS[code] ?? 500 });
255
255
  }
256
256
  };
257
257
  const handle = async (request, descriptor) => {
@@ -75,11 +75,10 @@ const resolveCors = (input) => {
75
75
  if (typeof origins === "function") {
76
76
  isAllowed = origins;
77
77
  isExplicitlyAllowed = origins;
78
- if (allowCredentials) {
79
- console.warn(
80
- "@lunora/runtime: security.cors combines a custom `allowedOrigins` predicate with `allowCredentials: true`. Ensure the predicate matches ONLY trusted origins by exact equality an over-broad predicate (e.g. `() => true`, or `endsWith`/`includes` checks) reflects any origin with credentials, defeating the allowlist and the CSRF guard."
81
- );
82
- }
78
+ const credentialsNote = allowCredentials ? " AND reflects matching origins with credentials (`allowCredentials: true`)" : "";
79
+ console.warn(
80
+ `@lunora/runtime: security.cors uses a custom \`allowedOrigins\` predicate. It is trusted by the CSRF and WebSocket origin checks${credentialsNote} — ensure it matches ONLY trusted origins by exact equality; an over-broad predicate (e.g. \`() => true\`, or \`endsWith\`/\`includes\` checks) defeats the allowlist.`
81
+ );
83
82
  } else {
84
83
  const originsList = origins;
85
84
  if (originsList.includes("*") && allowCredentials) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/runtime",
3
- "version": "1.0.0-alpha.15",
3
+ "version": "1.0.0-alpha.16",
4
4
  "description": "Lunora Worker runtime: the RPC router, shard resolver, and query coordinator",
5
5
  "keywords": [
6
6
  "cloudflare",