@abtnode/auth 1.16.54-beta-20251017-133309-7d40faa6 → 1.16.54-beta-20251021-070951-25e3083c

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/lib/auth.js CHANGED
@@ -14,7 +14,8 @@ const { fromPublicKey } = require('@ocap/wallet');
14
14
  const { fromBase58, toAddress } = require('@ocap/util');
15
15
  const { toTypeInfo, isFromPublicKey } = require('@arcblock/did');
16
16
  const { getRandomBytes } = require('@ocap/mcrypto');
17
- const getBlockletInfo = require('@blocklet/meta/lib/info');
17
+ const { getBlockletInfo } = require('@blocklet/meta/lib/info');
18
+ const { getApplicationWallet } = require('@blocklet/meta/lib/wallet');
18
19
  const {
19
20
  PASSPORT_STATUS,
20
21
  VC_TYPE_NODE_PASSPORT,
@@ -254,6 +255,7 @@ const getApplicationInfo = async ({ node, nodeInfo = {}, teamDid, baseUrl = '' }
254
255
  let secret;
255
256
  let logo;
256
257
  let appUrl;
258
+ let accessKeyWallet;
257
259
 
258
260
  if (teamDid === nodeInfo.did) {
259
261
  name = nodeInfo.name;
@@ -282,6 +284,7 @@ const getApplicationInfo = async ({ node, nodeInfo = {}, teamDid, baseUrl = '' }
282
284
  secret = blockletInfo.secret;
283
285
  logo = getAppAvatarUrl(baseUrl || blockletInfo.appUrl);
284
286
  appUrl = blockletInfo.appUrl;
287
+ accessKeyWallet = getApplicationWallet(teamDid, nodeInfo.sk, undefined, 1);
285
288
  }
286
289
 
287
290
  return {
@@ -296,6 +299,7 @@ const getApplicationInfo = async ({ node, nodeInfo = {}, teamDid, baseUrl = '' }
296
299
  secret,
297
300
  logo,
298
301
  appUrl,
302
+ accessKeyWallet,
299
303
  };
300
304
  };
301
305
 
@@ -1138,16 +1142,16 @@ const getPassportStatus = async ({ node, teamDid, userDid, vcId, locale = 'en' }
1138
1142
  }
1139
1143
 
1140
1144
  actionList.push(
1141
- ...createCredentialList({
1145
+ ...(await createCredentialList({
1142
1146
  issuer,
1143
1147
  claims,
1144
- })
1148
+ }))
1145
1149
  );
1146
1150
  }
1147
1151
 
1148
1152
  return {
1149
1153
  id: vcId,
1150
- statusList: createCredentialList({
1154
+ statusList: await createCredentialList({
1151
1155
  issuer,
1152
1156
  claims: [
1153
1157
  {
package/lib/launcher.js CHANGED
@@ -53,7 +53,7 @@ const doRequest = async (serverSk, { launcherUrl, pathname, payload, method = 'p
53
53
  url,
54
54
  params,
55
55
  headers: {
56
- 'x-server-sig': toBase58(wallet.sign(stableStringify(payload))),
56
+ 'x-server-sig': toBase58(await wallet.sign(stableStringify(payload))),
57
57
  'User-Agent': `ABTNode/${version}`,
58
58
  },
59
59
  };
@@ -4,7 +4,7 @@ const uniq = require('lodash/uniq');
4
4
  const get = require('lodash/get');
5
5
  const isFunction = require('lodash/isFunction');
6
6
  const isEmpty = require('lodash/isEmpty');
7
- const getBlockletInfo = require('@blocklet/meta/lib/info');
7
+ const { getBlockletInfo } = require('@blocklet/meta/lib/info');
8
8
  const formatContext = require('@abtnode/util/lib/format-context');
9
9
  const getRandomMessage = require('@abtnode/util/lib/get-random-message');
10
10
  const getNodeWallet = require('@abtnode/util/lib/get-app-wallet');
package/lib/server.js CHANGED
@@ -12,11 +12,11 @@ const { joinURL } = require('ufo');
12
12
  const { types } = require('@ocap/mcrypto');
13
13
  const { toHex, fromBase64 } = require('@ocap/util');
14
14
  const { DidType, isEthereumType } = require('@arcblock/did');
15
- const getApplicationWallet = require('@blocklet/meta/lib/wallet');
15
+ const { getApplicationWallet } = require('@blocklet/meta/lib/wallet');
16
16
  const { getBlockletChainInfo, isInProgress, isRunning } = require('@blocklet/meta/lib/util');
17
17
  const { getChainClient } = require('@abtnode/util/lib/get-chain-client');
18
18
 
19
- const getBlockletInfo = require('@blocklet/meta/lib/info');
19
+ const { getBlockletInfo } = require('@blocklet/meta/lib/info');
20
20
  const formatContext = require('@abtnode/util/lib/format-context');
21
21
  const { isInServerlessMode } = require('@abtnode/util/lib/serverless');
22
22
  const getRequestIP = require('@abtnode/util/lib/get-request-ip');
@@ -7,7 +7,7 @@ const { toStakeAddress } = require('@arcblock/did-util');
7
7
  const { sign } = require('@arcblock/jwt');
8
8
  const { toBN, fromUnitToToken } = require('@ocap/util');
9
9
  const { toTxHash } = require('@ocap/mcrypto');
10
- const getBlockletInfo = require('@blocklet/meta/lib/info');
10
+ const { getBlockletInfo } = require('@blocklet/meta/lib/info');
11
11
 
12
12
  const logger = require('../logger');
13
13
 
@@ -4,7 +4,7 @@ const pRetry = require('p-retry');
4
4
  const { signV2 } = require('@arcblock/jwt');
5
5
  const { joinURL } = require('ufo');
6
6
  const { normalizePathPrefix } = require('@blocklet/meta/lib/normalize-path-prefix');
7
- const getBlockletInfo = require('@blocklet/meta/lib/info');
7
+ const { getBlockletInfo } = require('@blocklet/meta/lib/info');
8
8
  const { getSignData } = require('@blocklet/sdk/lib/util/verify-sign');
9
9
  const { SIG_VERSION } = require('@blocklet/constant');
10
10
  const cloneDeep = require('@abtnode/util/lib/deep-clone');
@@ -123,7 +123,7 @@ async function callFederated({ site, permanentWallet, action, data = {}, customU
123
123
  let requestFn = () => {};
124
124
  // default 永远会指向最新版
125
125
  if (siteEnv.sigVersion === SIG_VERSION.DEFAULT) {
126
- const { exp, iat, sig, version } = getSignData(
126
+ const { exp, iat, sig, version } = await getSignData(
127
127
  { data, method: 'post', url },
128
128
  {
129
129
  appSk: permanentWallet.secretKey,
@@ -145,7 +145,7 @@ async function callFederated({ site, permanentWallet, action, data = {}, customU
145
145
  url,
146
146
  {
147
147
  signer: permanentWallet.address,
148
- data: signV2(permanentWallet.address, permanentWallet.secretKey, data),
148
+ data: await signV2(permanentWallet.address, permanentWallet.secretKey, data),
149
149
  },
150
150
  {
151
151
  baseURL: site.appUrl,
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.16.54-beta-20251017-133309-7d40faa6",
6
+ "version": "1.16.54-beta-20251021-070951-25e3083c",
7
7
  "description": "Simple lib to manage auth in ABT Node",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -13,32 +13,32 @@
13
13
  "scripts": {
14
14
  "lint": "eslint tests lib",
15
15
  "lint:fix": "eslint --fix tests lib",
16
- "test": "node tools/jest.js",
17
- "coverage": "npm run test -- --coverage"
16
+ "test": "bun test",
17
+ "coverage": "bun test -- --coverage"
18
18
  },
19
19
  "keywords": [],
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.54-beta-20251017-133309-7d40faa6",
24
- "@abtnode/logger": "1.16.54-beta-20251017-133309-7d40faa6",
25
- "@abtnode/util": "1.16.54-beta-20251017-133309-7d40faa6",
26
- "@arcblock/did": "1.25.6",
27
- "@arcblock/did-connect-js": "1.25.6",
28
- "@arcblock/did-ext": "1.25.6",
29
- "@arcblock/did-util": "1.25.6",
30
- "@arcblock/jwt": "1.25.6",
23
+ "@abtnode/constant": "1.16.54-beta-20251021-070951-25e3083c",
24
+ "@abtnode/logger": "1.16.54-beta-20251021-070951-25e3083c",
25
+ "@abtnode/util": "1.16.54-beta-20251021-070951-25e3083c",
26
+ "@arcblock/did": "^1.26.2",
27
+ "@arcblock/did-connect-js": "^1.26.2",
28
+ "@arcblock/did-ext": "^1.26.2",
29
+ "@arcblock/did-util": "^1.26.2",
30
+ "@arcblock/jwt": "^1.26.2",
31
31
  "@arcblock/nft-display": "^3.1.51",
32
- "@arcblock/validator": "1.25.6",
33
- "@arcblock/vc": "1.25.6",
34
- "@blocklet/constant": "1.16.54-beta-20251017-133309-7d40faa6",
32
+ "@arcblock/validator": "^1.26.2",
33
+ "@arcblock/vc": "^1.26.2",
34
+ "@blocklet/constant": "1.16.54-beta-20251021-070951-25e3083c",
35
35
  "@blocklet/error": "^0.2.5",
36
- "@blocklet/meta": "1.16.54-beta-20251017-133309-7d40faa6",
37
- "@blocklet/sdk": "1.16.54-beta-20251017-133309-7d40faa6",
38
- "@ocap/client": "1.25.6",
39
- "@ocap/mcrypto": "1.25.6",
40
- "@ocap/util": "1.25.6",
41
- "@ocap/wallet": "1.25.6",
36
+ "@blocklet/meta": "1.16.54-beta-20251021-070951-25e3083c",
37
+ "@blocklet/sdk": "1.16.54-beta-20251021-070951-25e3083c",
38
+ "@ocap/client": "^1.26.2",
39
+ "@ocap/mcrypto": "^1.26.2",
40
+ "@ocap/util": "^1.26.2",
41
+ "@ocap/wallet": "^1.26.2",
42
42
  "@simplewebauthn/server": "^13.1.1",
43
43
  "axios": "^1.7.9",
44
44
  "flat": "^5.0.2",
@@ -54,7 +54,8 @@
54
54
  "ufo": "^1.5.3"
55
55
  },
56
56
  "devDependencies": {
57
+ "axios-mock-adapter": "^2.1.0",
57
58
  "jest": "^29.7.0"
58
59
  },
59
- "gitHead": "78c11632ed47a75502a20c257568fc9e1655ca05"
60
+ "gitHead": "db517e9013dbad744e38883f56e4eba1fa1615c1"
60
61
  }