@floegence/floe-webapp-boot 0.56.7 → 0.56.9
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/proxy-bootstrap.js +39 -35
- package/package.json +2 -2
package/dist/proxy-bootstrap.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { createProxyRuntime as f } from "@floegence/flowersec-core/proxy";
|
|
2
|
-
import { connectedAcquisitionDetails as
|
|
2
|
+
import { connectedAcquisitionDetails as y, AcquisitionError as s } from "./acquisition.js";
|
|
3
3
|
class d {
|
|
4
4
|
#e = void 0;
|
|
5
5
|
constructor() {
|
|
@@ -13,64 +13,68 @@ class d {
|
|
|
13
13
|
}
|
|
14
14
|
}
|
|
15
15
|
const b = /* @__PURE__ */ new WeakMap();
|
|
16
|
-
function
|
|
16
|
+
function P(e) {
|
|
17
17
|
const t = d.create();
|
|
18
18
|
return b.set(t, { options: e, generation: 0 }), t;
|
|
19
19
|
}
|
|
20
|
-
function
|
|
21
|
-
const o =
|
|
20
|
+
function m(e, t) {
|
|
21
|
+
const o = h(e);
|
|
22
22
|
if (t === null)
|
|
23
23
|
return l(o), null;
|
|
24
24
|
if (o.acquisition === t && o.snapshot !== void 0) return o.snapshot;
|
|
25
|
-
const
|
|
25
|
+
const n = y(t);
|
|
26
26
|
l(o);
|
|
27
27
|
const c = o.generation + 1;
|
|
28
28
|
o.generation = c;
|
|
29
|
-
const
|
|
30
|
-
session:
|
|
31
|
-
...
|
|
32
|
-
...
|
|
29
|
+
const r = n.scope, p = f({
|
|
30
|
+
session: n.session,
|
|
31
|
+
...r.limits ?? {},
|
|
32
|
+
...r.http?.extraRequestHeaders === void 0 ? {} : { extraRequestHeaders: r.http.extraRequestHeaders },
|
|
33
|
+
...r.appBasePath === void 0 ? {} : { pathPolicy: {
|
|
34
|
+
allowedPathPrefixes: Object.freeze([r.appBasePath, ...r.http?.additionalPathPrefixes ?? []]),
|
|
35
|
+
allowedWebSocketPathPrefixes: Object.freeze([r.appBasePath])
|
|
36
|
+
} }
|
|
33
37
|
});
|
|
34
38
|
try {
|
|
35
39
|
let i;
|
|
36
|
-
if (
|
|
37
|
-
const
|
|
38
|
-
if (
|
|
39
|
-
i =
|
|
40
|
+
if (r.mode === "service_worker") {
|
|
41
|
+
const a = o.options.serviceWorker;
|
|
42
|
+
if (a === void 0) throw new s("service_worker_bootstrap_unavailable");
|
|
43
|
+
i = a(Object.freeze({
|
|
40
44
|
runtime: p,
|
|
41
45
|
generation: c,
|
|
42
|
-
bindingIdentity:
|
|
43
|
-
scriptUrl:
|
|
44
|
-
serviceWorkerScope:
|
|
45
|
-
...
|
|
46
|
+
bindingIdentity: n.bindingIdentity,
|
|
47
|
+
scriptUrl: r.serviceWorker.scriptUrl,
|
|
48
|
+
serviceWorkerScope: r.serviceWorker.scope,
|
|
49
|
+
...r.appBasePath === void 0 ? {} : { appBasePath: r.appBasePath }
|
|
46
50
|
}));
|
|
47
51
|
} else {
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
50
|
-
i =
|
|
52
|
+
const a = o.options.controllerBridge;
|
|
53
|
+
if (a === void 0) throw new s("controller_bridge_bootstrap_unavailable");
|
|
54
|
+
i = a(Object.freeze({
|
|
51
55
|
runtime: p,
|
|
52
56
|
generation: c,
|
|
53
|
-
bindingIdentity:
|
|
54
|
-
allowedOrigins:
|
|
55
|
-
...
|
|
56
|
-
capabilityNonce:
|
|
57
|
+
bindingIdentity: n.bindingIdentity,
|
|
58
|
+
allowedOrigins: r.controllerBridge.allowedOrigins,
|
|
59
|
+
...r.appBasePath === void 0 ? {} : { appBasePath: r.appBasePath },
|
|
60
|
+
capabilityNonce: g()
|
|
57
61
|
}));
|
|
58
62
|
}
|
|
59
63
|
if (i === null || typeof i != "object" || typeof i.dispose != "function")
|
|
60
|
-
throw new
|
|
61
|
-
const u = Object.freeze({ generation: c, mode:
|
|
64
|
+
throw new s("invalid_proxy_bootstrap_binding");
|
|
65
|
+
const u = Object.freeze({ generation: c, mode: r.mode, bindingIdentity: n.bindingIdentity });
|
|
62
66
|
return o.acquisition = t, o.runtime = p, o.binding = i, o.snapshot = u, u;
|
|
63
67
|
} catch (i) {
|
|
64
68
|
throw p.dispose(), i;
|
|
65
69
|
}
|
|
66
70
|
}
|
|
67
|
-
function
|
|
68
|
-
l(
|
|
71
|
+
function B(e) {
|
|
72
|
+
l(h(e));
|
|
69
73
|
}
|
|
70
|
-
function
|
|
74
|
+
function h(e) {
|
|
71
75
|
d.assertAuthentic(e);
|
|
72
76
|
const t = b.get(e);
|
|
73
|
-
if (t === void 0) throw new
|
|
77
|
+
if (t === void 0) throw new s("invalid_proxy_bootstrap_owner");
|
|
74
78
|
return t;
|
|
75
79
|
}
|
|
76
80
|
function l(e) {
|
|
@@ -82,8 +86,8 @@ function l(e) {
|
|
|
82
86
|
o?.dispose();
|
|
83
87
|
}
|
|
84
88
|
}
|
|
85
|
-
function
|
|
86
|
-
if (globalThis.crypto?.getRandomValues === void 0) throw new
|
|
89
|
+
function g() {
|
|
90
|
+
if (globalThis.crypto?.getRandomValues === void 0) throw new s("acquisition_entropy_unavailable");
|
|
87
91
|
const e = globalThis.crypto.getRandomValues(new Uint8Array(32));
|
|
88
92
|
let t = "";
|
|
89
93
|
for (const o of e) t += String.fromCharCode(o);
|
|
@@ -91,7 +95,7 @@ function h() {
|
|
|
91
95
|
}
|
|
92
96
|
export {
|
|
93
97
|
d as ProxyBootstrapOwner,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
98
|
+
B as closeProxyBootstrap,
|
|
99
|
+
P as createProxyBootstrapOwner,
|
|
100
|
+
m as synchronizeProxyBootstrap
|
|
97
101
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@floegence/floe-webapp-boot",
|
|
3
|
-
"version": "0.56.
|
|
3
|
+
"version": "0.56.9",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"clean": "rm -rf dist *.tsbuildinfo"
|
|
36
36
|
},
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@floegence/flowersec-core": "5.2.
|
|
38
|
+
"@floegence/flowersec-core": "5.2.2",
|
|
39
39
|
"@noble/hashes": "2.4.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|