@abtnode/auth 1.16.26-beta-4831bf3f → 1.16.26-beta-5251ab18

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.
Files changed (2) hide show
  1. package/lib/server.js +3 -3
  2. package/package.json +8 -8
package/lib/server.js CHANGED
@@ -16,6 +16,7 @@ const { getBlockletChainInfo, isInProgress, isRunning } = require('@blocklet/met
16
16
 
17
17
  const getBlockletInfo = require('@blocklet/meta/lib/info');
18
18
  const formatContext = require('@abtnode/util/lib/format-context');
19
+ const { isInServerlessMode } = require('@abtnode/util/lib/serverless');
19
20
  const {
20
21
  ROLES,
21
22
  VC_TYPE_GENERAL_PASSPORT,
@@ -25,7 +26,6 @@ const {
25
26
  NFT_TYPE_SERVERLESS,
26
27
  MAIN_CHAIN_ENDPOINT,
27
28
  APP_STRUCT_VERSION,
28
- NODE_MODES,
29
29
  } = require('@abtnode/constant');
30
30
  const parseBooleanString = require('@abtnode/util/lib/parse-boolean-string');
31
31
  const {
@@ -958,7 +958,7 @@ const createServerlessInstallGuard = (node) => {
958
958
  ]);
959
959
 
960
960
  // check if serverless is supported
961
- if (blocklet && info.mode === NODE_MODES.SERVERLESS) {
961
+ if (blocklet && isInServerlessMode(info)) {
962
962
  const isServerlessSupported = get(blocklet.meta, 'capabilities.serverless', true);
963
963
  if (!isServerlessSupported) {
964
964
  throw new Error(messages.notSupported[locale]);
@@ -967,7 +967,7 @@ const createServerlessInstallGuard = (node) => {
967
967
 
968
968
  // check if launcher session consumed
969
969
  // 只在 launch serverless 时校验 launch session 的合法性
970
- if (launcherUrl && launcherSessionId && info.mode === NODE_MODES.SERVERLESS) {
970
+ if (launcherUrl && launcherSessionId && isInServerlessMode(info)) {
971
971
  if (await node.isLauncherSessionConsumed({ launcherUrl, launcherSessionId })) {
972
972
  throw new Error(messages.sessionAlreadyConsumed[locale]);
973
973
  }
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.26-beta-4831bf3f",
6
+ "version": "1.16.26-beta-5251ab18",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -20,17 +20,17 @@
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.26-beta-4831bf3f",
24
- "@abtnode/logger": "1.16.26-beta-4831bf3f",
25
- "@abtnode/util": "1.16.26-beta-4831bf3f",
23
+ "@abtnode/constant": "1.16.26-beta-5251ab18",
24
+ "@abtnode/logger": "1.16.26-beta-5251ab18",
25
+ "@abtnode/util": "1.16.26-beta-5251ab18",
26
26
  "@arcblock/did": "1.18.115",
27
27
  "@arcblock/jwt": "^1.18.115",
28
28
  "@arcblock/nft-display": "^2.9.65",
29
29
  "@arcblock/validator": "^1.18.115",
30
30
  "@arcblock/vc": "1.18.115",
31
- "@blocklet/constant": "1.16.26-beta-4831bf3f",
32
- "@blocklet/meta": "1.16.26-beta-4831bf3f",
33
- "@blocklet/sdk": "1.16.26-beta-4831bf3f",
31
+ "@blocklet/constant": "1.16.26-beta-5251ab18",
32
+ "@blocklet/meta": "1.16.26-beta-5251ab18",
33
+ "@blocklet/sdk": "1.16.26-beta-5251ab18",
34
34
  "@ocap/client": "^1.18.115",
35
35
  "@ocap/mcrypto": "1.18.115",
36
36
  "@ocap/util": "1.18.115",
@@ -51,5 +51,5 @@
51
51
  "devDependencies": {
52
52
  "jest": "^29.7.0"
53
53
  },
54
- "gitHead": "e1b75eed1841ae3589b3f854a9f027f1b7da64ba"
54
+ "gitHead": "759e8dbab81a3ae2fa02f32776fe388d13337da7"
55
55
  }