@abtnode/auth 1.16.23-beta-06c3a221 → 1.16.23-beta-a2f9b088

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.
@@ -1,7 +1,7 @@
1
1
  const { getAppUrl, getAppName, getAppDescription } = require('@blocklet/meta/lib/util');
2
2
  const { Joi } = require('@arcblock/validator');
3
- const logger = require('@abtnode/logger')(require('../../../package.json').name);
4
3
  const { DID_SPACES } = require('@blocklet/constant');
4
+ const logger = require('./logger');
5
5
  const { messages } = require('./auth');
6
6
  const { getDidSpacesInfoByClaims, silentAuthorizationInConnect } = require('./util/spaces');
7
7
 
package/lib/server.js CHANGED
@@ -200,9 +200,12 @@ const authenticateByNFT = async ({ node, claims, userDid, challenge, locale, isA
200
200
  // serverless 应用通过 querystring 传递 chainHost
201
201
  const state = await verifyNFT({ claims, challenge, chainHost: chainHost || info.launcher.chainHost, locale });
202
202
 
203
- const trustedLaunchers = await getLauncherAppIdList(get(info, 'launcher.url'));
204
- if (!trustedLaunchers.includes(state.issuer)) {
205
- throw new Error(messages.invalidNftIssuer[locale]);
203
+ // 本地开发模式下,不校验 nft issuer, Launcher 会使用该字段
204
+ if (info.launcher?.mode !== 'development') {
205
+ const trustedLaunchers = await getLauncherAppIdList(get(info, 'launcher.url'));
206
+ if (!trustedLaunchers.includes(state.issuer)) {
207
+ throw new Error(messages.invalidNftIssuer[locale]);
208
+ }
206
209
  }
207
210
 
208
211
  if (state.tags.includes(NFT_TYPE_SERVERLESS)) {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.23-beta-06c3a221",
6
+ "version": "1.16.23-beta-a2f9b088",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -20,19 +20,19 @@
20
20
  "author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
21
21
  "license": "Apache-2.0",
22
22
  "dependencies": {
23
- "@abtnode/constant": "1.16.23-beta-06c3a221",
24
- "@abtnode/logger": "1.16.23-beta-06c3a221",
25
- "@abtnode/util": "1.16.23-beta-06c3a221",
26
- "@arcblock/did": "1.18.108",
27
- "@arcblock/nft-display": "2.9.17",
28
- "@arcblock/validator": "^1.18.108",
29
- "@arcblock/vc": "1.18.108",
30
- "@blocklet/constant": "1.16.23-beta-06c3a221",
31
- "@blocklet/meta": "1.16.23-beta-06c3a221",
32
- "@ocap/client": "^1.18.108",
33
- "@ocap/mcrypto": "1.18.108",
34
- "@ocap/util": "1.18.108",
35
- "@ocap/wallet": "1.18.108",
23
+ "@abtnode/constant": "1.16.23-beta-a2f9b088",
24
+ "@abtnode/logger": "1.16.23-beta-a2f9b088",
25
+ "@abtnode/util": "1.16.23-beta-a2f9b088",
26
+ "@arcblock/did": "1.18.110",
27
+ "@arcblock/nft-display": "2.9.24",
28
+ "@arcblock/validator": "^1.18.110",
29
+ "@arcblock/vc": "1.18.110",
30
+ "@blocklet/constant": "1.16.23-beta-a2f9b088",
31
+ "@blocklet/meta": "1.16.23-beta-a2f9b088",
32
+ "@ocap/client": "^1.18.110",
33
+ "@ocap/mcrypto": "1.18.110",
34
+ "@ocap/util": "1.18.110",
35
+ "@ocap/wallet": "1.18.110",
36
36
  "axios": "^0.27.2",
37
37
  "flat": "^5.0.2",
38
38
  "fs-extra": "^11.2.0",
@@ -49,5 +49,5 @@
49
49
  "devDependencies": {
50
50
  "jest": "^29.7.0"
51
51
  },
52
- "gitHead": "10d2351eb9a0a222781d803798e15390622e421b"
52
+ "gitHead": "cc060de5d06e1759112a787dd10b780e628ce0b7"
53
53
  }