@rpcbase/server 0.545.0 → 0.546.0

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.js CHANGED
@@ -9,7 +9,7 @@ import { posix, dirname, sep } from "path";
9
9
  import fs, { createReadStream, readFileSync } from "node:fs";
10
10
  import { createInterface } from "node:readline";
11
11
  import { AsyncLocalStorage } from "node:async_hooks";
12
- import { g as getDerivedKey, r as resolveRtsRequestTenantId, i as isRtsRequestAuthorized, b as buildRtsAbilityFromRequest, n as normalizeRtsQueryOptions, a as runRtsQuery, c as runRtsCount } from "./queryExecutor-DTEFEB5Z.js";
12
+ import { g as getDerivedKey, s as syncAuthenticatedSessionMiddleware, r as resolveRtsRequestTenantId, i as isRtsRequestAuthorized, b as buildRtsAbilityFromRequest, n as normalizeRtsQueryOptions, a as runRtsQuery, c as runRtsCount } from "./queryExecutor-Bzs0SJym.js";
13
13
  import httpProxy from "http-proxy-3";
14
14
  import fsPromises from "node:fs/promises";
15
15
  import inspector from "node:inspector";
@@ -4074,6 +4074,9 @@ const initServer = async (app, serverEnv) => {
4074
4074
  if (!serverEnv.MASTER_KEY) {
4075
4075
  throw new Error("MASTER_KEY must be defined to derive the session secret");
4076
4076
  }
4077
+ if (!serverEnv.RB_PROXY_SHARED_SECRET?.trim()) {
4078
+ throw new Error("RB_PROXY_SHARED_SECRET must be defined");
4079
+ }
4077
4080
  const sessionSecret = getDerivedKey(serverEnv.MASTER_KEY, "express_session_key");
4078
4081
  const redisUrl = serverEnv.REDIS_URL?.trim();
4079
4082
  let store;
@@ -4102,6 +4105,7 @@ const initServer = async (app, serverEnv) => {
4102
4105
  registerDevCoverageEndpoints(app);
4103
4106
  }
4104
4107
  app.use(sessionMiddleware);
4108
+ app.use(syncAuthenticatedSessionMiddleware);
4105
4109
  return {
4106
4110
  sessionMiddleware
4107
4111
  };