@camstack/server 1.1.58 → 1.1.59
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.
|
@@ -179,11 +179,15 @@ async function passkeySecondFactorOptedIn(userId, provider) {
|
|
|
179
179
|
// `redirect` buttons (OIDC / magic-link) + pre-auth `widget`s (passkey).
|
|
180
180
|
// The widget arm is enriched server-side with a public `bundleUrl` from
|
|
181
181
|
// `addonId` + `bundle`, so the addon never encodes the static-route
|
|
182
|
-
// scheme.
|
|
183
|
-
//
|
|
182
|
+
// scheme. The version is a PATH prefix (`v<…>/`), not a `?v=` query, so the
|
|
183
|
+
// bundle's relative sibling imports inherit it and a CDN busts the WHOLE
|
|
184
|
+
// bundle atomically on deploy (see the stamping site below).
|
|
184
185
|
const PublicWidgetLoginMethodSchema = types_1.WidgetLoginMethodSchema.extend({
|
|
185
186
|
bundleUrl: zod_1.z.string(),
|
|
186
187
|
});
|
|
188
|
+
/** Stable per hub PROCESS — busts the login widget bundle URL on each
|
|
189
|
+
* restart/deploy while caching cleanly within the process's uptime. */
|
|
190
|
+
const AUTH_BUNDLE_VERSION = String(Date.now());
|
|
187
191
|
const PublicLoginMethodSchema = zod_1.z.discriminatedUnion('kind', [
|
|
188
192
|
types_1.RedirectLoginMethodSchema,
|
|
189
193
|
PublicWidgetLoginMethodSchema,
|
|
@@ -961,10 +965,18 @@ function createAuthRouter(auth, registry, moleculer = null, shareTokens = null,
|
|
|
961
965
|
}
|
|
962
966
|
continue;
|
|
963
967
|
}
|
|
964
|
-
// Widget arm — stamp a public bundleUrl
|
|
968
|
+
// Widget arm — stamp a public bundleUrl with the version in the
|
|
969
|
+
// PATH, not a `?v=` query. Module-Federation bundles import their
|
|
970
|
+
// fixed-name siblings (`./_stub.js`) by RELATIVE url, which never
|
|
971
|
+
// inherit a query — so a `?v=` busts only the entry and a CDN edge
|
|
972
|
+
// keeps serving a stale `_stub.js` (missing the newest widget). A
|
|
973
|
+
// path prefix makes every relative import inherit it → one atomic
|
|
974
|
+
// whole-bundle cache miss per deploy, on any CDN. `AUTH_BUNDLE_VERSION`
|
|
975
|
+
// is stable per hub process (busts on restart/deploy, caches within
|
|
976
|
+
// uptime). The `/api/addon-widgets` route strips the `v<…>/` segment.
|
|
965
977
|
const parsed = PublicWidgetLoginMethodSchema.safeParse({
|
|
966
978
|
...raw,
|
|
967
|
-
bundleUrl: `/api/addon-widgets/${raw.addonId}/${raw.bundle}
|
|
979
|
+
bundleUrl: `/api/addon-widgets/${raw.addonId}/v${AUTH_BUNDLE_VERSION}/${raw.bundle}`,
|
|
968
980
|
});
|
|
969
981
|
if (parsed.success) {
|
|
970
982
|
out.push(parsed.data);
|
|
@@ -308,6 +308,10 @@ class MoleculerService {
|
|
|
308
308
|
this.brokerSafe.createService((0, system_1.createHubCapForwardService)(onUnownedCall));
|
|
309
309
|
const registry = new system_1.LocalChildRegistry({
|
|
310
310
|
server: (0, system_1.createLocalTransport)().createServer(nodeId),
|
|
311
|
+
// This node's own id — lets the cap-call-out router serve a pin-to-self
|
|
312
|
+
// from the co-resident sibling instead of bouncing it through
|
|
313
|
+
// onUnownedCall (a pin to ANOTHER node still bypasses the sibling).
|
|
314
|
+
ownNodeId: nodeId,
|
|
311
315
|
onUnownedCall,
|
|
312
316
|
logger: {
|
|
313
317
|
info: (msg, meta) => logger.info(msg, meta !== null && meta !== undefined
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camstack/server",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.59",
|
|
4
4
|
"private": false,
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -23,19 +23,19 @@
|
|
|
23
23
|
"test:watch": "vitest"
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@camstack/addon-admin-ui": "1.1.
|
|
26
|
+
"@camstack/addon-admin-ui": "1.1.48",
|
|
27
27
|
"@camstack/addon-advanced-notifier": "1.1.21",
|
|
28
28
|
"@camstack/addon-auth": "1.1.6",
|
|
29
29
|
"@camstack/addon-decoder-nodeav": "1.1.9",
|
|
30
30
|
"@camstack/addon-notifiers": "1.1.21",
|
|
31
|
-
"@camstack/addon-pipeline": "1.1.
|
|
32
|
-
"@camstack/addon-pipeline-orchestrator": "1.1.
|
|
33
|
-
"@camstack/addon-post-analysis": "1.1.
|
|
31
|
+
"@camstack/addon-pipeline": "1.1.53",
|
|
32
|
+
"@camstack/addon-pipeline-orchestrator": "1.1.43",
|
|
33
|
+
"@camstack/addon-post-analysis": "1.1.25",
|
|
34
34
|
"@camstack/sdk": "1.1.22",
|
|
35
35
|
"@camstack/shm-ring": "1.0.21",
|
|
36
|
-
"@camstack/system": "1.1.
|
|
37
|
-
"@camstack/types": "1.1.
|
|
38
|
-
"@camstack/ui-library": "1.1.
|
|
36
|
+
"@camstack/system": "1.1.46",
|
|
37
|
+
"@camstack/types": "1.1.41",
|
|
38
|
+
"@camstack/ui-library": "1.1.33",
|
|
39
39
|
"@fastify/compress": "^9.0.0",
|
|
40
40
|
"@fastify/cookie": "^11.0.2",
|
|
41
41
|
"@fastify/multipart": "^10.0.0",
|