@thzero/library_server_service_grpc 0.19.6 → 0.19.8
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/README.md +141 -121
- package/SECURITY.md +29 -0
- package/client.js +181 -166
- package/eslint.config.mjs +61 -61
- package/license.md +8 -8
- package/package.json +41 -41
- package/server.js +160 -92
- package/test/client.test.js +286 -236
- package/test/server.test.js +141 -85
package/eslint.config.mjs
CHANGED
|
@@ -1,61 +1,61 @@
|
|
|
1
|
-
// Rules earned their place: each one catches a defect found in this codebase.
|
|
2
|
-
// See AUDIT_SERVER.md in the parent workspace for the catalogue.
|
|
3
|
-
export default [
|
|
4
|
-
{
|
|
5
|
-
files: ['**/*.js'],
|
|
6
|
-
ignores: ['node_modules/**', 'dist/**'],
|
|
7
|
-
languageOptions: {
|
|
8
|
-
ecmaVersion: 2022,
|
|
9
|
-
sourceType: 'module',
|
|
10
|
-
globals: {
|
|
11
|
-
// library_common installs these onto the global String
|
|
12
|
-
String: 'writable',
|
|
13
|
-
console: 'readonly',
|
|
14
|
-
process: 'readonly',
|
|
15
|
-
performance: 'readonly',
|
|
16
|
-
navigator: 'readonly',
|
|
17
|
-
setTimeout: 'readonly',
|
|
18
|
-
clearTimeout: 'readonly'
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
rules: {
|
|
22
|
-
// undeclared identifiers - caught MomentUtility in utility/checksum.js
|
|
23
|
-
// and cmd in library_cli_build/boot/cli.js
|
|
24
|
-
'no-undef': 'error',
|
|
25
|
-
// === NaN is always false - caught the --major validation in cli.js
|
|
26
|
-
'use-isnan': 'error',
|
|
27
|
-
// Unused locals. This is what caught the loop variable in
|
|
28
|
-
// `for (const value of values) valid &= values`.
|
|
29
|
-
// args is 'none' deliberately: the codebase is built on abstract base
|
|
30
|
-
// classes whose methods declare a signature for subclasses and use none
|
|
31
|
-
// of it - 58 such parameters in library_common_service alone. Dead
|
|
32
|
-
// trailing parameters (idName, index) need a targeted read, not this rule.
|
|
33
|
-
'no-unused-vars': ['error', { args: 'none', ignoreRestSiblings: true }],
|
|
34
|
-
// the &= boolean accumulator in the _enforce* block
|
|
35
|
-
'no-bitwise': 'error',
|
|
36
|
-
// C17
|
|
37
|
-
'eqeqeq': 'error',
|
|
38
|
-
'no-dupe-class-members': 'error',
|
|
39
|
-
'no-dupe-keys': 'error',
|
|
40
|
-
'no-unreachable': 'error',
|
|
41
|
-
'no-constant-condition': ['error', { checkLoops: false }],
|
|
42
|
-
'no-self-compare': 'error',
|
|
43
|
-
// the comma operator - caught `this._logger.exception(a, b, err), correlationId;`
|
|
44
|
-
// in library_server_messaging_slack, which silently dropped the correlationId
|
|
45
|
-
'no-sequences': 'error',
|
|
46
|
-
// caught `catch (err) { throw err; }` in library_server_repository_redis
|
|
47
|
-
'no-useless-catch': 'error',
|
|
48
|
-
// caught `resource.authentication = resource.authentication;` in
|
|
49
|
-
// library_server_service_rest_axios
|
|
50
|
-
'no-self-assign': 'error',
|
|
51
|
-
// an expression statement that does nothing is almost always a dropped call
|
|
52
|
-
'no-unused-expressions': 'error'
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
files: ['test/**/*.js'],
|
|
57
|
-
languageOptions: {
|
|
58
|
-
globals: { process: 'readonly', console: 'readonly', setTimeout: 'readonly' }
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
];
|
|
1
|
+
// Rules earned their place: each one catches a defect found in this codebase.
|
|
2
|
+
// See AUDIT_SERVER.md in the parent workspace for the catalogue.
|
|
3
|
+
export default [
|
|
4
|
+
{
|
|
5
|
+
files: ['**/*.js'],
|
|
6
|
+
ignores: ['node_modules/**', 'dist/**'],
|
|
7
|
+
languageOptions: {
|
|
8
|
+
ecmaVersion: 2022,
|
|
9
|
+
sourceType: 'module',
|
|
10
|
+
globals: {
|
|
11
|
+
// library_common installs these onto the global String
|
|
12
|
+
String: 'writable',
|
|
13
|
+
console: 'readonly',
|
|
14
|
+
process: 'readonly',
|
|
15
|
+
performance: 'readonly',
|
|
16
|
+
navigator: 'readonly',
|
|
17
|
+
setTimeout: 'readonly',
|
|
18
|
+
clearTimeout: 'readonly'
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
rules: {
|
|
22
|
+
// undeclared identifiers - caught MomentUtility in utility/checksum.js
|
|
23
|
+
// and cmd in library_cli_build/boot/cli.js
|
|
24
|
+
'no-undef': 'error',
|
|
25
|
+
// === NaN is always false - caught the --major validation in cli.js
|
|
26
|
+
'use-isnan': 'error',
|
|
27
|
+
// Unused locals. This is what caught the loop variable in
|
|
28
|
+
// `for (const value of values) valid &= values`.
|
|
29
|
+
// args is 'none' deliberately: the codebase is built on abstract base
|
|
30
|
+
// classes whose methods declare a signature for subclasses and use none
|
|
31
|
+
// of it - 58 such parameters in library_common_service alone. Dead
|
|
32
|
+
// trailing parameters (idName, index) need a targeted read, not this rule.
|
|
33
|
+
'no-unused-vars': ['error', { args: 'none', ignoreRestSiblings: true }],
|
|
34
|
+
// the &= boolean accumulator in the _enforce* block
|
|
35
|
+
'no-bitwise': 'error',
|
|
36
|
+
// C17
|
|
37
|
+
'eqeqeq': 'error',
|
|
38
|
+
'no-dupe-class-members': 'error',
|
|
39
|
+
'no-dupe-keys': 'error',
|
|
40
|
+
'no-unreachable': 'error',
|
|
41
|
+
'no-constant-condition': ['error', { checkLoops: false }],
|
|
42
|
+
'no-self-compare': 'error',
|
|
43
|
+
// the comma operator - caught `this._logger.exception(a, b, err), correlationId;`
|
|
44
|
+
// in library_server_messaging_slack, which silently dropped the correlationId
|
|
45
|
+
'no-sequences': 'error',
|
|
46
|
+
// caught `catch (err) { throw err; }` in library_server_repository_redis
|
|
47
|
+
'no-useless-catch': 'error',
|
|
48
|
+
// caught `resource.authentication = resource.authentication;` in
|
|
49
|
+
// library_server_service_rest_axios
|
|
50
|
+
'no-self-assign': 'error',
|
|
51
|
+
// an expression statement that does nothing is almost always a dropped call
|
|
52
|
+
'no-unused-expressions': 'error'
|
|
53
|
+
}
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
files: ['test/**/*.js'],
|
|
57
|
+
languageOptions: {
|
|
58
|
+
globals: { process: 'readonly', console: 'readonly', setTimeout: 'readonly' }
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
];
|
package/license.md
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2020-2026 thZero.com
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
-
|
|
7
|
-
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
-
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2020-2026 thZero.com
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
6
|
+
|
|
7
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
8
|
+
|
|
9
9
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/package.json
CHANGED
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@thzero/library_server_service_grpc",
|
|
3
|
-
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
5
|
-
"version_major": 0,
|
|
6
|
-
"version_minor": 19,
|
|
7
|
-
"version_patch":
|
|
8
|
-
"version_date": "11/
|
|
9
|
-
"description": "",
|
|
10
|
-
"author": "thZero",
|
|
11
|
-
"author_url": "https://www.thzero.com",
|
|
12
|
-
"copyright": "2020-2026",
|
|
13
|
-
"license": "MIT",
|
|
14
|
-
"repository": {
|
|
15
|
-
"type": "git",
|
|
16
|
-
"url": "git+https://github.com/thzero/library_server_service_grpc.git"
|
|
17
|
-
},
|
|
18
|
-
"bugs": {
|
|
19
|
-
"url": "https://github.com/thzero/library_server_service_grpc/issues"
|
|
20
|
-
},
|
|
21
|
-
"engines": {
|
|
22
|
-
"node": ">=22"
|
|
23
|
-
},
|
|
24
|
-
"main": "index.js",
|
|
25
|
-
"scripts": {
|
|
26
|
-
"cli-update": "library-cli --updateversion --pi",
|
|
27
|
-
"test": "node --test \"test/*.test.js\"",
|
|
28
|
-
"lint": "eslint .",
|
|
29
|
-
"lint:fix": "eslint . --fix"
|
|
30
|
-
},
|
|
31
|
-
"dependencies": {
|
|
32
|
-
"@grpc/grpc-js": "^1.14.7"
|
|
33
|
-
},
|
|
34
|
-
"peerDependencies": {
|
|
35
|
-
"@thzero/library_common": "^0.19",
|
|
36
|
-
"@thzero/library_common_service": "^0.19",
|
|
37
|
-
"@thzero/library_server": "^0.19"
|
|
38
|
-
},
|
|
39
|
-
"devDependencies": {
|
|
40
|
-
"eslint": "^10.
|
|
41
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@thzero/library_server_service_grpc",
|
|
3
|
+
"type": "module",
|
|
4
|
+
"version": "0.19.8",
|
|
5
|
+
"version_major": 0,
|
|
6
|
+
"version_minor": 19,
|
|
7
|
+
"version_patch": 8,
|
|
8
|
+
"version_date": "11/30/2026",
|
|
9
|
+
"description": "",
|
|
10
|
+
"author": "thZero",
|
|
11
|
+
"author_url": "https://www.thzero.com",
|
|
12
|
+
"copyright": "2020-2026",
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "git+https://github.com/thzero/library_server_service_grpc.git"
|
|
17
|
+
},
|
|
18
|
+
"bugs": {
|
|
19
|
+
"url": "https://github.com/thzero/library_server_service_grpc/issues"
|
|
20
|
+
},
|
|
21
|
+
"engines": {
|
|
22
|
+
"node": ">=22"
|
|
23
|
+
},
|
|
24
|
+
"main": "index.js",
|
|
25
|
+
"scripts": {
|
|
26
|
+
"cli-update": "library-cli --updateversion --pi",
|
|
27
|
+
"test": "node --test \"test/*.test.js\"",
|
|
28
|
+
"lint": "eslint .",
|
|
29
|
+
"lint:fix": "eslint . --fix"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@grpc/grpc-js": "^1.14.7"
|
|
33
|
+
},
|
|
34
|
+
"peerDependencies": {
|
|
35
|
+
"@thzero/library_common": "^0.19",
|
|
36
|
+
"@thzero/library_common_service": "^0.19",
|
|
37
|
+
"@thzero/library_server": "^0.19"
|
|
38
|
+
},
|
|
39
|
+
"devDependencies": {
|
|
40
|
+
"eslint": "^10.16.0"
|
|
41
|
+
}
|
|
42
42
|
}
|
package/server.js
CHANGED
|
@@ -1,92 +1,160 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
this.
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
if (
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
1
|
+
import { Buffer } from 'node:buffer';
|
|
2
|
+
import crypto from 'node:crypto';
|
|
3
|
+
import fs from 'node:fs';
|
|
4
|
+
|
|
5
|
+
import * as grpc from '@grpc/grpc-js';
|
|
6
|
+
|
|
7
|
+
import Service from '@thzero/library_server/service/index.js';
|
|
8
|
+
|
|
9
|
+
const bearer = 'bearer ';
|
|
10
|
+
|
|
11
|
+
const hash = (value) => crypto.createHash('sha256').update(value).digest();
|
|
12
|
+
|
|
13
|
+
const pem = (value) => Buffer.from(String(value).trimStart().startsWith('-----BEGIN') ? value : fs.readFileSync(value, 'utf8'));
|
|
14
|
+
|
|
15
|
+
class BaseServerGrpcService extends Service {
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
|
|
19
|
+
this._configGrpc = null;
|
|
20
|
+
this._authKeys = null;
|
|
21
|
+
|
|
22
|
+
this._grpc = null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async init(injector) {
|
|
26
|
+
await super.init(injector);
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
this._configGrpc = this._config.get(`grpc`);
|
|
30
|
+
|
|
31
|
+
this._grpc = new grpc.Server();
|
|
32
|
+
await this._initServices(this._grpc);
|
|
33
|
+
await this._start();
|
|
34
|
+
}
|
|
35
|
+
catch (err) {
|
|
36
|
+
this._logger.error('BaseServerGrpcService', 'init', null, err);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
_authenticate(call) {
|
|
41
|
+
const correlationId = this._correlationId(call);
|
|
42
|
+
|
|
43
|
+
const meta = call.metadata.get('authorization');
|
|
44
|
+
const authorization = (meta && (meta.length > 0)) ? meta[0] : null;
|
|
45
|
+
|
|
46
|
+
if (!this._authenticateValidate(correlationId, authorization, call)) {
|
|
47
|
+
this._logger.warn('BaseServerGrpcService', '_authenticate', 'Unauthenticated.', null, correlationId);
|
|
48
|
+
const err = new Error('Unauthenticated.');
|
|
49
|
+
err.code = grpc.status.UNAUTHENTICATED;
|
|
50
|
+
throw err;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return correlationId;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
_authenticateValidate(correlationId, authorization, call) {
|
|
57
|
+
const auth = this._configGrpc ? this._configGrpc.auth : null;
|
|
58
|
+
if (auth && (auth.required === false))
|
|
59
|
+
return true;
|
|
60
|
+
|
|
61
|
+
const keys = this._authenticateKeys(auth);
|
|
62
|
+
if (keys.length === 0)
|
|
63
|
+
return false;
|
|
64
|
+
|
|
65
|
+
if (!String.isString(authorization))
|
|
66
|
+
return false;
|
|
67
|
+
|
|
68
|
+
let value = authorization.trim();
|
|
69
|
+
if (value.toLowerCase().startsWith(bearer))
|
|
70
|
+
value = value.substring(bearer.length).trim();
|
|
71
|
+
if (String.isNullOrEmpty(value))
|
|
72
|
+
return false;
|
|
73
|
+
|
|
74
|
+
const digest = hash(value);
|
|
75
|
+
let valid = false;
|
|
76
|
+
for (const key of keys)
|
|
77
|
+
valid = crypto.timingSafeEqual(digest, key) || valid;
|
|
78
|
+
return valid;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
_authenticateKeys(auth) {
|
|
82
|
+
if (this._authKeys)
|
|
83
|
+
return this._authKeys;
|
|
84
|
+
|
|
85
|
+
const configured = auth ? auth.apiKey : null;
|
|
86
|
+
const list = Array.isArray(configured) ? configured : [ configured ];
|
|
87
|
+
this._authKeys = list.filter(key => String.isString(key) && !String.isNullOrEmpty(key.trim())).map(key => hash(key.trim()));
|
|
88
|
+
return this._authKeys;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
_correlationId(call) {
|
|
92
|
+
this._enforceNotNull('BaseServerGrpcService', '_correlationId', call, 'call');
|
|
93
|
+
|
|
94
|
+
const meta = call.metadata.get('correlationId');
|
|
95
|
+
return (meta && (meta.length > 0)) ? meta[0] : null;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
_handleError(correlationId, err, callback) {
|
|
99
|
+
this._enforceNotNull('BaseServerGrpcService', '_handleError', callback, 'callback', correlationId);
|
|
100
|
+
|
|
101
|
+
if (!err)
|
|
102
|
+
return;
|
|
103
|
+
|
|
104
|
+
if (!Number.isInteger(err.code)) {
|
|
105
|
+
this._logger.exception('BaseServerGrpcService', '_handleError', err, correlationId);
|
|
106
|
+
callback({ code: grpc.status.INTERNAL, message: 'Internal error.' }, null);
|
|
107
|
+
return;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
let message = '';
|
|
111
|
+
if (err.name)
|
|
112
|
+
message += err.name + ' ';
|
|
113
|
+
if (err.message)
|
|
114
|
+
message += err.message;
|
|
115
|
+
message = message.trim();
|
|
116
|
+
|
|
117
|
+
callback({ code: err.code, message: message }, null);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async _initServices(grpc) {
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async _start(correlationId) {
|
|
124
|
+
this._enforceNotNull('BaseServerGrpcService', '_start', this._configGrpc, 'config.grpc', correlationId);
|
|
125
|
+
this._enforceNotNull('BaseServerGrpcService', '_start', this._configGrpc.port, 'config.grpc.port', correlationId);
|
|
126
|
+
|
|
127
|
+
return await new Promise((resolve, reject) => {
|
|
128
|
+
const address = (this._configGrpc.host ? this._configGrpc.host : '0.0.0.0') + ':' + this._configGrpc.port;
|
|
129
|
+
this._grpc.bindAsync(address, this._serverCredentials(correlationId), (err, port) => {
|
|
130
|
+
if (err) {
|
|
131
|
+
reject(this._error('BaseServerGrpcService', '_start', null, err, null, null, correlationId));
|
|
132
|
+
return;
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
this._logger.info2(`GRPC: starting server on port '${this._configGrpc.port}'...`, null, correlationId);
|
|
136
|
+
this._grpc.start();
|
|
137
|
+
|
|
138
|
+
resolve(this._success(correlationId));
|
|
139
|
+
});
|
|
140
|
+
});
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
_serverCredentials(correlationId) {
|
|
144
|
+
const tls = this._configGrpc.tls;
|
|
145
|
+
if (tls) {
|
|
146
|
+
this._enforceNotEmpty('BaseServerGrpcService', '_serverCredentials', tls.key, 'config.grpc.tls.key', correlationId);
|
|
147
|
+
this._enforceNotEmpty('BaseServerGrpcService', '_serverCredentials', tls.cert, 'config.grpc.tls.cert', correlationId);
|
|
148
|
+
|
|
149
|
+
const ca = tls.ca ? pem(tls.ca) : null;
|
|
150
|
+
return grpc.ServerCredentials.createSsl(ca, [ { private_key: pem(tls.key), cert_chain: pem(tls.cert) } ], ca ? (tls.clientCertificateRequired === true) : false);
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
if (this._configGrpc.insecure === true)
|
|
154
|
+
return grpc.ServerCredentials.createInsecure();
|
|
155
|
+
|
|
156
|
+
throw Error('config.grpc.tls is required; set config.grpc.insecure to true to run without TLS.');
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
export default BaseServerGrpcService;
|