@abtnode/blocklet-services 1.16.47-beta-20250721-025348-9ccb2d62 → 1.16.47-beta-20250721-073316-a6de1fa3
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/api/middlewares/launcher-login.js +20 -6
- package/package.json +23 -23
|
@@ -20,6 +20,7 @@ const launcherLogin = (node, options) => async (req, res, next) => {
|
|
|
20
20
|
|
|
21
21
|
const blocklet = await req.getBlocklet();
|
|
22
22
|
if (!blocklet.controller) {
|
|
23
|
+
logger.warn('Launcher login is not supported for this blocklet', { blockletDid: blocklet.appDid });
|
|
23
24
|
return next();
|
|
24
25
|
}
|
|
25
26
|
|
|
@@ -28,12 +29,25 @@ const launcherLogin = (node, options) => async (req, res, next) => {
|
|
|
28
29
|
const decoded = JWT.decode(token);
|
|
29
30
|
const info = await req.getNodeInfo();
|
|
30
31
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
const isSameLauncher = isSameDid(decoded.iss, info.registerInfo?.appId);
|
|
33
|
+
const isSameOwner = isSameDid(decoded.oid, blocklet.settings?.owner?.did);
|
|
34
|
+
const isSameLauncherSessionId = decoded.lid === blocklet.controller.launcherSessionId;
|
|
35
|
+
const isSameBlocklet = [blocklet.appDid, blocklet.appPid].includes(decoded.aid);
|
|
36
|
+
|
|
37
|
+
// FIXME: @wangshijun remove this after stable
|
|
38
|
+
logger.info('Launcher login check', {
|
|
39
|
+
isSameLauncher,
|
|
40
|
+
isSameOwner,
|
|
41
|
+
isSameLauncherSessionId,
|
|
42
|
+
isSameBlocklet,
|
|
43
|
+
decoded,
|
|
44
|
+
owner: blocklet.settings?.owner,
|
|
45
|
+
launcher: info.registerInfo,
|
|
46
|
+
controller: blocklet.controller,
|
|
47
|
+
appDids: [blocklet.appDid, blocklet.appPid],
|
|
48
|
+
});
|
|
49
|
+
|
|
50
|
+
if (isSameLauncher && isSameOwner && isSameLauncherSessionId && isSameBlocklet) {
|
|
37
51
|
const verified = await JWT.verify(token, info.registerInfo?.appPk);
|
|
38
52
|
if (verified) {
|
|
39
53
|
const user = await node.getUser({
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.47-beta-20250721-
|
|
6
|
+
"version": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
7
7
|
"description": "Provide unified services for every blocklet",
|
|
8
8
|
"main": "api/index.js",
|
|
9
9
|
"files": [
|
|
@@ -34,18 +34,18 @@
|
|
|
34
34
|
"author": "wangshijun <wangshijun2010@gmail.com> (http://github.com/wangshijun)",
|
|
35
35
|
"license": "Apache-2.0",
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@abtnode/analytics": "1.16.47-beta-20250721-
|
|
38
|
-
"@abtnode/auth": "1.16.47-beta-20250721-
|
|
39
|
-
"@abtnode/client": "1.16.47-beta-20250721-
|
|
40
|
-
"@abtnode/connect-storage": "1.16.47-beta-20250721-
|
|
41
|
-
"@abtnode/constant": "1.16.47-beta-20250721-
|
|
42
|
-
"@abtnode/core": "1.16.47-beta-20250721-
|
|
43
|
-
"@abtnode/cron": "1.16.47-beta-20250721-
|
|
44
|
-
"@abtnode/db-cache": "1.16.47-beta-20250721-
|
|
45
|
-
"@abtnode/logger": "1.16.47-beta-20250721-
|
|
46
|
-
"@abtnode/models": "1.16.47-beta-20250721-
|
|
47
|
-
"@abtnode/router-templates": "1.16.47-beta-20250721-
|
|
48
|
-
"@abtnode/util": "1.16.47-beta-20250721-
|
|
37
|
+
"@abtnode/analytics": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
38
|
+
"@abtnode/auth": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
39
|
+
"@abtnode/client": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
40
|
+
"@abtnode/connect-storage": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
41
|
+
"@abtnode/constant": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
42
|
+
"@abtnode/core": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
43
|
+
"@abtnode/cron": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
44
|
+
"@abtnode/db-cache": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
45
|
+
"@abtnode/logger": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
46
|
+
"@abtnode/models": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
47
|
+
"@abtnode/router-templates": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
48
|
+
"@abtnode/util": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
49
49
|
"@arcblock/did": "1.20.16",
|
|
50
50
|
"@arcblock/did-auth": "1.20.16",
|
|
51
51
|
"@arcblock/did-ext": "1.20.16",
|
|
@@ -55,18 +55,18 @@
|
|
|
55
55
|
"@arcblock/jwt": "1.20.16",
|
|
56
56
|
"@arcblock/validator": "1.20.16",
|
|
57
57
|
"@arcblock/ws": "1.20.16",
|
|
58
|
-
"@blocklet/constant": "1.16.47-beta-20250721-
|
|
58
|
+
"@blocklet/constant": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
59
59
|
"@blocklet/dbhub": "^0.2.9",
|
|
60
|
-
"@blocklet/env": "1.16.47-beta-20250721-
|
|
60
|
+
"@blocklet/env": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
61
61
|
"@blocklet/error": "^0.2.5",
|
|
62
62
|
"@blocklet/form-builder": "^0.1.12",
|
|
63
63
|
"@blocklet/form-collector": "^0.1.8",
|
|
64
|
-
"@blocklet/images": "1.16.47-beta-20250721-
|
|
65
|
-
"@blocklet/js-sdk": "1.16.47-beta-20250721-
|
|
64
|
+
"@blocklet/images": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
65
|
+
"@blocklet/js-sdk": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
66
66
|
"@blocklet/mcp": "^1.10.2",
|
|
67
|
-
"@blocklet/meta": "1.16.47-beta-20250721-
|
|
68
|
-
"@blocklet/rate-limit": "1.16.47-beta-20250721-
|
|
69
|
-
"@blocklet/sdk": "1.16.47-beta-20250721-
|
|
67
|
+
"@blocklet/meta": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
68
|
+
"@blocklet/rate-limit": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
69
|
+
"@blocklet/sdk": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
70
70
|
"@blocklet/theme": "^3.0.26",
|
|
71
71
|
"@blocklet/theme-builder": "0.4.2",
|
|
72
72
|
"@blocklet/uploader-server": "^0.2.2",
|
|
@@ -123,7 +123,7 @@
|
|
|
123
123
|
"whatwg-url": "14.0.0"
|
|
124
124
|
},
|
|
125
125
|
"devDependencies": {
|
|
126
|
-
"@abtnode/ux": "1.16.47-beta-20250721-
|
|
126
|
+
"@abtnode/ux": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
127
127
|
"@arcblock/bridge": "^3.0.26",
|
|
128
128
|
"@arcblock/did-connect": "^3.0.26",
|
|
129
129
|
"@arcblock/icons": "^3.0.26",
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
"@blocklet/did-space-react": "^1.1.7",
|
|
134
134
|
"@blocklet/launcher-layout": "^3.0.26",
|
|
135
135
|
"@blocklet/payment-react": "^1.19.5",
|
|
136
|
-
"@blocklet/tracker": "1.16.47-beta-20250721-
|
|
136
|
+
"@blocklet/tracker": "1.16.47-beta-20250721-073316-a6de1fa3",
|
|
137
137
|
"@blocklet/ui-react": "^3.0.26",
|
|
138
138
|
"@blocklet/uploader": "^0.2.4",
|
|
139
139
|
"@emotion/react": "^11.14.0",
|
|
@@ -213,5 +213,5 @@
|
|
|
213
213
|
"url": "https://github.com/ArcBlock/blocklet-server/issues",
|
|
214
214
|
"email": "shijun@arcblock.io"
|
|
215
215
|
},
|
|
216
|
-
"gitHead": "
|
|
216
|
+
"gitHead": "2163d72cfb533e6dbcedd7082c45d7f3dbe3cd90"
|
|
217
217
|
}
|