@blocklet/meta 1.7.10 → 1.7.11

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.
@@ -0,0 +1,66 @@
1
+ {
2
+ "name": "auth",
3
+ "description": "Neat and easy to use user authentication and authorization service for blocklets",
4
+ "version": "1.0.0",
5
+ "schema": {
6
+ "JSONSchema": {
7
+ "title": "Config Auth Service",
8
+ "description": "Customize how Auth Service works",
9
+ "type": "object",
10
+ "required": ["profileFields", "webWalletUrl"],
11
+ "properties": {
12
+ "whoCanAccess": {
13
+ "type": "string",
14
+ "title": "Who can access the blocklet?",
15
+ "enum": ["owner", "invited", "all"],
16
+ "default": "all"
17
+ },
18
+ "profileFields": {
19
+ "type": "array",
20
+ "title": "What info do you want user to provide when login?",
21
+ "items": {
22
+ "type": "string",
23
+ "enum": ["fullName", "email", "avatar", "phone"]
24
+ },
25
+ "default": ["fullName", "email", "avatar"],
26
+ "uniqueItems": true
27
+ },
28
+ "allowSwitchProfile": {
29
+ "type": "boolean",
30
+ "title": "Does you app allow user to switch profile?",
31
+ "default": true
32
+ },
33
+ "webWalletUrl": {
34
+ "type": "string",
35
+ "title": "The URL of your preferred web wallet instance",
36
+ "pattern": "^https?://",
37
+ "default": "https://web.abtwallet.io"
38
+ },
39
+ "ignoreUrls": {
40
+ "type": "array",
41
+ "title": "Which URLs do not need to be protected. e.g: /public/**",
42
+ "items": {
43
+ "type": "string",
44
+ "minLength": 1
45
+ },
46
+ "default": []
47
+ },
48
+ "blockUnauthenticated": {
49
+ "type": "boolean",
50
+ "title": "Do you want Auth Service block unauthenticated requests for you?",
51
+ "default": false
52
+ },
53
+ "blockUnauthorized": {
54
+ "type": "boolean",
55
+ "title": "Do you want Auth Service block unauthorized requests for you?",
56
+ "default": false
57
+ }
58
+ }
59
+ },
60
+ "UISchema": {
61
+ "profileFields": {
62
+ "ui:widget": "checkboxes"
63
+ }
64
+ }
65
+ }
66
+ }
package/lib/service.js CHANGED
@@ -1,4 +1,3 @@
1
- const fs = require('fs-extra');
2
1
  const cloneDeep = require('lodash/cloneDeep');
3
2
  const Ajv = require('ajv').default;
4
3
 
@@ -25,7 +24,7 @@ const setService = (meta) => {
25
24
  };
26
25
  };
27
26
 
28
- setService(fs.readJSONSync(require.resolve('@abtnode/blocklet-services/configs/auth.json')));
27
+ setService(require('./service-configs/auth.json'));
29
28
 
30
29
  // backward compatible
31
30
  SERVICES[NODE_SERVICES.AUTH_SERVICE] = {
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "1.7.10",
6
+ "version": "1.7.11",
7
7
  "description": "Library to parse/validate/fix blocklet meta",
8
8
  "main": "lib/index.js",
9
9
  "files": [
@@ -18,8 +18,8 @@
18
18
  "author": "wangshijun <wangshijun2020@gmail.com> (http://github.com/wangshijun)",
19
19
  "license": "MIT",
20
20
  "dependencies": {
21
- "@abtnode/constant": "1.7.10",
22
- "@abtnode/util": "1.7.10",
21
+ "@abtnode/constant": "1.7.11",
22
+ "@abtnode/util": "1.7.11",
23
23
  "@arcblock/did": "^1.16.5",
24
24
  "@arcblock/did-ext": "^1.16.5",
25
25
  "@arcblock/did-util": "^1.16.5",
@@ -46,5 +46,5 @@
46
46
  "devDependencies": {
47
47
  "jest": "^27.4.5"
48
48
  },
49
- "gitHead": "8eab10fd39b6183a2fa4d2706f52e8b2ecaa059a"
49
+ "gitHead": "84e741e6b37e47d52bf834ce3ace8ed601d0896c"
50
50
  }