@blocklet/meta 1.7.8 → 1.7.9
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/verify-multi-sig.js +6 -4
- package/package.json +13 -13
package/lib/verify-multi-sig.js
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
|
-
const
|
|
2
|
-
const stableStringify = require('json-stable-stringify');
|
|
3
|
-
const cloneDeep = require('lodash/cloneDeep');
|
|
1
|
+
const get = require('lodash/get');
|
|
4
2
|
const omit = require('lodash/omit');
|
|
3
|
+
const cloneDeep = require('lodash/cloneDeep');
|
|
4
|
+
const stableStringify = require('json-stable-stringify');
|
|
5
5
|
const { toTypeInfo } = require('@arcblock/did');
|
|
6
6
|
const { fromPublicKey } = require('@ocap/wallet');
|
|
7
7
|
const { verify } = require('@arcblock/jwt');
|
|
8
8
|
const { fromBase64 } = require('@ocap/util');
|
|
9
9
|
|
|
10
|
+
const debug = require('debug')('@blocklet/meta:verifyMultiSig');
|
|
11
|
+
|
|
10
12
|
function verifyDelegationToken(signature) {
|
|
11
13
|
if (signature.delegation) {
|
|
12
14
|
const payload = JSON.parse(fromBase64(signature.delegation.split('.')[1]));
|
|
@@ -21,7 +23,7 @@ function verifyDelegationToken(signature) {
|
|
|
21
23
|
return false;
|
|
22
24
|
}
|
|
23
25
|
|
|
24
|
-
if (!payload
|
|
26
|
+
if (!get(payload, 'permissions', []).includes('publish_blocklet')) {
|
|
25
27
|
debug('verify payload.permissions failed', payload);
|
|
26
28
|
return false;
|
|
27
29
|
}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"publishConfig": {
|
|
4
4
|
"access": "public"
|
|
5
5
|
},
|
|
6
|
-
"version": "1.7.
|
|
6
|
+
"version": "1.7.9",
|
|
7
7
|
"description": "Library to parse/validate/fix blocklet meta",
|
|
8
8
|
"main": "lib/index.js",
|
|
9
9
|
"files": [
|
|
@@ -18,17 +18,17 @@
|
|
|
18
18
|
"author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
|
|
19
19
|
"license": "MIT",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@abtnode/constant": "1.7.
|
|
22
|
-
"@abtnode/util": "1.7.
|
|
23
|
-
"@arcblock/did": "^1.16.
|
|
24
|
-
"@arcblock/did-ext": "^1.16.
|
|
25
|
-
"@arcblock/did-util": "^1.16.
|
|
26
|
-
"@arcblock/jwt": "^1.16.
|
|
27
|
-
"@arcblock/nft": "^1.16.
|
|
28
|
-
"@ocap/asset": "^1.16.
|
|
29
|
-
"@ocap/mcrypto": "^1.16.
|
|
30
|
-
"@ocap/util": "^1.16.
|
|
31
|
-
"@ocap/wallet": "^1.16.
|
|
21
|
+
"@abtnode/constant": "1.7.9",
|
|
22
|
+
"@abtnode/util": "1.7.9",
|
|
23
|
+
"@arcblock/did": "^1.16.4",
|
|
24
|
+
"@arcblock/did-ext": "^1.16.4",
|
|
25
|
+
"@arcblock/did-util": "^1.16.4",
|
|
26
|
+
"@arcblock/jwt": "^1.16.4",
|
|
27
|
+
"@arcblock/nft": "^1.16.4",
|
|
28
|
+
"@ocap/asset": "^1.16.4",
|
|
29
|
+
"@ocap/mcrypto": "^1.16.4",
|
|
30
|
+
"@ocap/util": "^1.16.4",
|
|
31
|
+
"@ocap/wallet": "^1.16.4",
|
|
32
32
|
"ajv": "^7.0.3",
|
|
33
33
|
"cjk-length": "^1.0.0",
|
|
34
34
|
"debug": "^4.3.3",
|
|
@@ -46,5 +46,5 @@
|
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"jest": "^27.4.5"
|
|
48
48
|
},
|
|
49
|
-
"gitHead": "
|
|
49
|
+
"gitHead": "285f4fedd41fcb8e1814ce5d8250ac10616e67e0"
|
|
50
50
|
}
|