jspurefix 2.0.4 → 2.0.5
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.
|
@@ -31,13 +31,15 @@ class TlsOptionsFactory {
|
|
|
31
31
|
static getTlsConnectionOptions(tcp) {
|
|
32
32
|
let connectionOptions = null;
|
|
33
33
|
const tls = tcp.tls;
|
|
34
|
-
if (tls
|
|
34
|
+
if (tls) {
|
|
35
35
|
connectionOptions = {
|
|
36
36
|
port: tcp.port,
|
|
37
|
-
host: tcp.host
|
|
38
|
-
key: TlsOptionsFactory.read(tcp.tls.key),
|
|
39
|
-
cert: TlsOptionsFactory.read(tcp.tls.cert)
|
|
37
|
+
host: tcp.host
|
|
40
38
|
};
|
|
39
|
+
if (tls.key) {
|
|
40
|
+
connectionOptions.key = TlsOptionsFactory.read(tcp.tls.key);
|
|
41
|
+
connectionOptions.cert = TlsOptionsFactory.read(tcp.tls.cert);
|
|
42
|
+
}
|
|
41
43
|
if (tcp.tls.ca && tcp.tls.ca.length > 0) {
|
|
42
44
|
connectionOptions.ca = tcp.tls.ca.map(i => TlsOptionsFactory.read(i));
|
|
43
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tls-options-factory.js","sourceRoot":"","sources":["../../../src/transport/tcp/tls-options-factory.ts"],"names":[],"mappings":";;;AAGA,MAAM,IAAI,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAC5B,MAAM,EAAE,GAAG,OAAO,CAAC,IAAI,CAAC,CAAA;AAExB,MAAa,iBAAiB;IAC5B,MAAM,CAAC,IAAI,CAAE,QAAgB;QAC3B,MAAM,IAAI,GAAW,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE,WAAW,CAAC,CAAA;QACtD,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;QAC1C,OAAO,EAAE,CAAC,YAAY,CAAC,QAAQ,EAC7B;YACE,QAAQ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AiB,CAAC,GAAG,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;gBAC3D,iBAAiB,CAAC,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAA;aAC9D;YACD,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,MAAM,GAAG,CAAC,EAAE;gBACvC,iBAAiB,CAAC,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAA;aACtE;YACD,IAAI,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE;gBACnB,iBAAiB,CAAC,OAAO,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,CAAA;aAC5C;YACD,IAAI,GAAG,CAAC,GAAG,CAAC,cAAc,EAAE;gBAC1B,iBAAiB,CAAC,cAAc,GAAG,GAAG,CAAC,GAAG,CAAC,cAAc,CAAA;aAC1D;SACF;QACD,OAAO,iBAAiB,CAAA;IAC1B,CAAC;CACF;AAtDD,8CAsDC","sourcesContent":["import { ConnectionOptions, TlsOptions } from 'tls'\r\nimport { ITlsOptions } from './tls-options'\r\nimport { ITcpTransportDescription } from './tcp-transport-description'\r\nconst path = require('path')\r\nconst fs = require('fs')\r\n\r\nexport class TlsOptionsFactory {\r\n static read (filePath: string) {\r\n const root: string = path.join(__dirname, '../../../')\r\n const fullPath = path.join(root, filePath)\r\n return fs.readFileSync(fullPath,\r\n {\r\n encoding: 'utf8', flag: 'r'\r\n })\r\n }\r\n\r\n static getTlsOptions (tls: ITlsOptions): TlsOptions {\r\n let tlsOptions: TlsOptions = null\r\n if (tls) {\r\n tlsOptions = {\r\n requestCert: tls.requestCert,\r\n rejectUnauthorized: tls.rejectUnauthorized\r\n } as TlsOptions\r\n\r\n if (tls.key) {\r\n tlsOptions.key = TlsOptionsFactory.read(tls.key)\r\n tlsOptions.cert = TlsOptionsFactory.read(tls.cert)\r\n }\r\n \r\n if (tls.ca && tls.ca.length > 0) {\r\n tlsOptions.ca = tls.ca.map(i => TlsOptionsFactory.read(i))\r\n }\r\n }\r\n return tlsOptions\r\n }\r\n\r\n static getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions {\r\n let connectionOptions: ConnectionOptions = null\r\n const tls = tcp.tls\r\n if (tls) {\r\n connectionOptions = {\r\n port: tcp.port,\r\n host: tcp.host\r\n } as ConnectionOptions\r\n if (tls.key) {\r\n connectionOptions.key = TlsOptionsFactory.read(tcp.tls.key)\r\n connectionOptions.cert = TlsOptionsFactory.read(tcp.tls.cert)\r\n }\r\n if (tcp.tls.ca && tcp.tls.ca.length > 0) {\r\n connectionOptions.ca = tcp.tls.ca.map(i => TlsOptionsFactory.read(i))\r\n }\r\n if (tcp.tls.timeout) {\r\n connectionOptions.timeout = tcp.tls.timeout\r\n }\r\n if (tcp.tls.sessionTimeout) {\r\n connectionOptions.sessionTimeout = tcp.tls.sessionTimeout\r\n }\r\n }\r\n return connectionOptions\r\n }\r\n}\r\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "jspurefix",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.5",
|
|
4
4
|
"description": "pure node js fix engine",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"typescript",
|
|
@@ -64,9 +64,9 @@
|
|
|
64
64
|
"align-text": "^1.0.2",
|
|
65
65
|
"express": "^4.17.3",
|
|
66
66
|
"lodash": "^4.17.21",
|
|
67
|
-
"log4js": "^6.4.
|
|
68
|
-
"mathjs": "^10.
|
|
69
|
-
"minimist": "^1.2.
|
|
67
|
+
"log4js": "^6.4.4",
|
|
68
|
+
"mathjs": "^10.4.2",
|
|
69
|
+
"minimist": "^1.2.6",
|
|
70
70
|
"moment": "^2.29.1",
|
|
71
71
|
"node-fs-extra": "^0.8.2",
|
|
72
72
|
"reflect-metadata": "^0.1.13",
|
|
@@ -85,10 +85,10 @@
|
|
|
85
85
|
"@types/express": "^4.17.13",
|
|
86
86
|
"@types/express-serve-static-core": "^4.17.28",
|
|
87
87
|
"@types/jest": "^27.4.1",
|
|
88
|
-
"@types/lodash": "^4.14.
|
|
88
|
+
"@types/lodash": "^4.14.181",
|
|
89
89
|
"@types/mathjs": "^9.4.1",
|
|
90
90
|
"@types/minimist": "^1.2.2",
|
|
91
|
-
"@types/node": "^17.0.
|
|
91
|
+
"@types/node": "^17.0.23",
|
|
92
92
|
"@types/request-promise-native": "^1.0.18",
|
|
93
93
|
"@types/sax": "^1.2.4",
|
|
94
94
|
"@types/uuid": "^8.3.4",
|
|
@@ -97,9 +97,9 @@
|
|
|
97
97
|
"jest": "^27.5.1",
|
|
98
98
|
"madge": "^5.0.1",
|
|
99
99
|
"standard": "^16.0.4",
|
|
100
|
-
"ts-jest": "^27.1.
|
|
100
|
+
"ts-jest": "^27.1.4",
|
|
101
101
|
"tslint": "^6.1.3",
|
|
102
102
|
"tslint-config-standard": "^9.0.0",
|
|
103
|
-
"typescript": "^4.6.
|
|
103
|
+
"typescript": "^4.6.3"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
@@ -37,13 +37,15 @@ export class TlsOptionsFactory {
|
|
|
37
37
|
static getTlsConnectionOptions (tcp: ITcpTransportDescription): ConnectionOptions {
|
|
38
38
|
let connectionOptions: ConnectionOptions = null
|
|
39
39
|
const tls = tcp.tls
|
|
40
|
-
if (tls
|
|
40
|
+
if (tls) {
|
|
41
41
|
connectionOptions = {
|
|
42
42
|
port: tcp.port,
|
|
43
|
-
host: tcp.host
|
|
44
|
-
key: TlsOptionsFactory.read(tcp.tls.key),
|
|
45
|
-
cert: TlsOptionsFactory.read(tcp.tls.cert)
|
|
43
|
+
host: tcp.host
|
|
46
44
|
} as ConnectionOptions
|
|
45
|
+
if (tls.key) {
|
|
46
|
+
connectionOptions.key = TlsOptionsFactory.read(tcp.tls.key)
|
|
47
|
+
connectionOptions.cert = TlsOptionsFactory.read(tcp.tls.cert)
|
|
48
|
+
}
|
|
47
49
|
if (tcp.tls.ca && tcp.tls.ca.length > 0) {
|
|
48
50
|
connectionOptions.ca = tcp.tls.ca.map(i => TlsOptionsFactory.read(i))
|
|
49
51
|
}
|