@abtnode/auth 1.16.4-beta-f058f4e8 → 1.16.4
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 +0 -4
- package/lib/server.js +12 -3
- package/package.json +7 -7
package/lib/auth.js
CHANGED
|
@@ -16,7 +16,6 @@ const {
|
|
|
16
16
|
NODE_DATA_DIR_NAME,
|
|
17
17
|
AUTH_CERT_TYPE,
|
|
18
18
|
WELLKNOWN_BLOCKLET_ADMIN_PATH,
|
|
19
|
-
USER_TYPE,
|
|
20
19
|
} = require('@abtnode/constant');
|
|
21
20
|
const axios = require('@abtnode/util/lib/axios');
|
|
22
21
|
const { extractUserAvatar, parseUserAvatar } = require('@abtnode/util/lib/user-avatar');
|
|
@@ -436,7 +435,6 @@ const handleInvitationReceive = async ({
|
|
|
436
435
|
inviteId,
|
|
437
436
|
userDid,
|
|
438
437
|
userPk,
|
|
439
|
-
userSource = USER_TYPE.WALLET,
|
|
440
438
|
newNftOwner,
|
|
441
439
|
statusEndpointBaseUrl,
|
|
442
440
|
endpoint,
|
|
@@ -546,7 +544,6 @@ const handleInvitationReceive = async ({
|
|
|
546
544
|
user: {
|
|
547
545
|
...profile,
|
|
548
546
|
avatar,
|
|
549
|
-
source: userSource,
|
|
550
547
|
did: userDid,
|
|
551
548
|
pk: userPk,
|
|
552
549
|
locale,
|
|
@@ -570,7 +567,6 @@ const handleInvitationReceive = async ({
|
|
|
570
567
|
teamDid,
|
|
571
568
|
user: {
|
|
572
569
|
...profile,
|
|
573
|
-
source: userSource,
|
|
574
570
|
avatar,
|
|
575
571
|
did: userDid,
|
|
576
572
|
pk: userPk,
|
package/lib/server.js
CHANGED
|
@@ -11,10 +11,10 @@ const { fromPublicKey } = require('@ocap/wallet');
|
|
|
11
11
|
const { types } = require('@ocap/mcrypto');
|
|
12
12
|
const { fromBase58, toAddress, toHex } = require('@ocap/util');
|
|
13
13
|
const { toTypeInfo, isFromPublicKey, DidType, isEthereumType } = require('@arcblock/did');
|
|
14
|
-
const
|
|
14
|
+
const urlPathFriendly = require('@blocklet/meta/lib/url-path-friendly').default;
|
|
15
15
|
const getApplicationWallet = require('@blocklet/meta/lib/wallet');
|
|
16
16
|
const { slugify } = require('transliteration');
|
|
17
|
-
const { getBlockletChainInfo } = require('@blocklet/meta/lib/util');
|
|
17
|
+
const { getBlockletChainInfo, isInProgress, isRunning } = require('@blocklet/meta/lib/util');
|
|
18
18
|
|
|
19
19
|
const getBlockletInfo = require('@blocklet/meta/lib/info');
|
|
20
20
|
const formatContext = require('@abtnode/util/lib/format-context');
|
|
@@ -416,7 +416,7 @@ const getKeyPairClaim =
|
|
|
416
416
|
const result = {
|
|
417
417
|
mfa: !process.env.DID_CONNECT_MFA_DISABLED,
|
|
418
418
|
description: description[locale] || description.en,
|
|
419
|
-
moniker: (
|
|
419
|
+
moniker: (urlPathFriendly(slugify(appName)) || 'application').toLowerCase(),
|
|
420
420
|
declare: !!declare,
|
|
421
421
|
migrateFrom: declare ? migrateFrom : '',
|
|
422
422
|
chainInfo,
|
|
@@ -450,6 +450,15 @@ const getRotateKeyPairClaims = (node) => {
|
|
|
450
450
|
if (!blocklet) {
|
|
451
451
|
throw new Error(messages.invalidBlocklet[locale]);
|
|
452
452
|
}
|
|
453
|
+
|
|
454
|
+
if (isInProgress(blocklet.status)) {
|
|
455
|
+
throw new Error('Blocklet is in progress, please wait for it to finish');
|
|
456
|
+
}
|
|
457
|
+
|
|
458
|
+
if (isRunning(blocklet.status)) {
|
|
459
|
+
throw new Error('Blocklet is running, please stop it first');
|
|
460
|
+
}
|
|
461
|
+
|
|
453
462
|
if (blocklet.structVersion !== APP_STRUCT_VERSION) {
|
|
454
463
|
throw new Error(messages.invalidAppVersion[locale]);
|
|
455
464
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.16.4
|
|
6
|
+
"version": "1.16.4",
|
|
7
7
|
"description": "Simple lib to manage auth in ABT Node",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"author": "linchen <linchen1987@foxmail.com> (http://github.com/linchen1987)",
|
|
21
21
|
"license": "MIT",
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@abtnode/constant": "1.16.4
|
|
24
|
-
"@abtnode/logger": "1.16.4
|
|
25
|
-
"@abtnode/util": "1.16.4
|
|
23
|
+
"@abtnode/constant": "1.16.4",
|
|
24
|
+
"@abtnode/logger": "1.16.4",
|
|
25
|
+
"@abtnode/util": "1.16.4",
|
|
26
26
|
"@arcblock/did": "1.18.67",
|
|
27
27
|
"@arcblock/jwt": "^1.18.67",
|
|
28
28
|
"@arcblock/vc": "1.18.67",
|
|
29
|
-
"@blocklet/constant": "1.16.4
|
|
30
|
-
"@blocklet/meta": "1.16.4
|
|
29
|
+
"@blocklet/constant": "1.16.4",
|
|
30
|
+
"@blocklet/meta": "1.16.4",
|
|
31
31
|
"@ocap/client": "1.18.67",
|
|
32
32
|
"@ocap/mcrypto": "1.18.67",
|
|
33
33
|
"@ocap/util": "1.18.67",
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"devDependencies": {
|
|
45
45
|
"jest": "^27.5.1"
|
|
46
46
|
},
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "8d1062af0f4e4f491b6a7205c9d6542328ca6b20"
|
|
48
48
|
}
|