soap 0.44.0 → 1.0.0
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/History.md +12 -0
- package/Readme.md +12 -0
- package/lib/client.d.ts +1 -0
- package/lib/client.js +168 -187
- package/lib/client.js.map +1 -1
- package/lib/http.d.ts +1 -0
- package/lib/http.js +91 -101
- package/lib/http.js.map +1 -1
- package/lib/nscontext.js +38 -40
- package/lib/nscontext.js.map +1 -1
- package/lib/security/BasicAuthSecurity.js +11 -12
- package/lib/security/BasicAuthSecurity.js.map +1 -1
- package/lib/security/BearerSecurity.js +11 -12
- package/lib/security/BearerSecurity.js.map +1 -1
- package/lib/security/ClientSSLSecurity.js +12 -13
- package/lib/security/ClientSSLSecurity.js.map +1 -1
- package/lib/security/ClientSSLSecurityPFX.js +11 -12
- package/lib/security/ClientSSLSecurityPFX.js.map +1 -1
- package/lib/security/NTLMSecurity.js +12 -13
- package/lib/security/NTLMSecurity.js.map +1 -1
- package/lib/security/WSSecurity.js +21 -22
- package/lib/security/WSSecurity.js.map +1 -1
- package/lib/security/WSSecurityCert.d.ts +1 -0
- package/lib/security/WSSecurityCert.js +74 -56
- package/lib/security/WSSecurityCert.js.map +1 -1
- package/lib/security/WSSecurityPlusCert.d.ts +9 -0
- package/lib/security/WSSecurityPlusCert.js +17 -0
- package/lib/security/WSSecurityPlusCert.js.map +1 -0
- package/lib/security/index.d.ts +1 -0
- package/lib/security/index.js +8 -3
- package/lib/security/index.js.map +1 -1
- package/lib/server.d.ts +1 -0
- package/lib/server.js +189 -209
- package/lib/server.js.map +1 -1
- package/lib/soap.d.ts +1 -1
- package/lib/soap.js +45 -40
- package/lib/soap.js.map +1 -1
- package/lib/types.d.ts +1 -0
- package/lib/types.js +1 -1
- package/lib/utils.d.ts +1 -1
- package/lib/utils.js +54 -49
- package/lib/utils.js.map +1 -1
- package/lib/wsdl/elements.js +393 -515
- package/lib/wsdl/elements.js.map +1 -1
- package/lib/wsdl/index.js +322 -322
- package/lib/wsdl/index.js.map +1 -1
- package/package.json +9 -7
- package/tsconfig.json +2 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
exports
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.WSSecurityCert = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
4
|
+
const uuid_1 = require("uuid");
|
|
5
|
+
const xml_crypto_1 = require("xml-crypto");
|
|
6
6
|
function addMinutes(date, minutes) {
|
|
7
7
|
return new Date(date.getTime() + minutes * 60000);
|
|
8
8
|
}
|
|
@@ -21,29 +21,26 @@ function insertStr(src, dst, pos) {
|
|
|
21
21
|
return [dst.slice(0, pos), src, dst.slice(pos)].join('');
|
|
22
22
|
}
|
|
23
23
|
function generateId() {
|
|
24
|
-
return uuid_1.v4().replace(/-/gm, '');
|
|
24
|
+
return (0, uuid_1.v4)().replace(/-/gm, '');
|
|
25
25
|
}
|
|
26
26
|
function resolvePlaceholderInReferences(references, bodyXpath) {
|
|
27
|
-
for (
|
|
28
|
-
var ref = references_1[_i];
|
|
27
|
+
for (const ref of references) {
|
|
29
28
|
if (ref.xpath === bodyXpathPlaceholder) {
|
|
30
29
|
ref.xpath = bodyXpath;
|
|
31
30
|
}
|
|
32
31
|
}
|
|
33
32
|
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
var _this = this;
|
|
39
|
-
if (options === void 0) { options = {}; }
|
|
33
|
+
const oasisBaseUri = 'http://docs.oasis-open.org/wss/2004/01';
|
|
34
|
+
const bodyXpathPlaceholder = '[[bodyXpath]]';
|
|
35
|
+
class WSSecurityCert {
|
|
36
|
+
constructor(privatePEM, publicP12PEM, password, options = {}) {
|
|
40
37
|
this.signerOptions = {};
|
|
41
38
|
this.additionalReferences = [];
|
|
42
39
|
this.publicP12PEM = publicP12PEM.toString()
|
|
43
40
|
.replace('-----BEGIN CERTIFICATE-----', '')
|
|
44
41
|
.replace('-----END CERTIFICATE-----', '')
|
|
45
42
|
.replace(/(\r\n|\n|\r)/gm, '');
|
|
46
|
-
this.signer = new xml_crypto_1.SignedXml();
|
|
43
|
+
this.signer = new xml_crypto_1.SignedXml(options?.signerOptions?.idMode);
|
|
47
44
|
if (options.signatureAlgorithm === 'http://www.w3.org/2001/04/xmldsig-more#rsa-sha256') {
|
|
48
45
|
this.signer.signatureAlgorithm = options.signatureAlgorithm;
|
|
49
46
|
this.signer.addReference(bodyXpathPlaceholder, ['http://www.w3.org/2001/10/xml-exc-c14n#'], 'http://www.w3.org/2001/04/xmlenc#sha256');
|
|
@@ -52,79 +49,100 @@ var WSSecurityCert = /** @class */ (function () {
|
|
|
52
49
|
this.additionalReferences = options.additionalReferences;
|
|
53
50
|
}
|
|
54
51
|
if (options.signerOptions) {
|
|
55
|
-
|
|
52
|
+
const { signerOptions } = options;
|
|
56
53
|
this.signerOptions = signerOptions;
|
|
57
54
|
if (!this.signerOptions.existingPrefixes) {
|
|
58
55
|
this.signerOptions.existingPrefixes = {};
|
|
59
56
|
}
|
|
60
57
|
if (this.signerOptions.existingPrefixes && !this.signerOptions.existingPrefixes.wsse) {
|
|
61
|
-
this.signerOptions.existingPrefixes.wsse = oasisBaseUri
|
|
58
|
+
this.signerOptions.existingPrefixes.wsse = `${oasisBaseUri}/oasis-200401-wss-wssecurity-secext-1.0.xsd`;
|
|
62
59
|
}
|
|
63
60
|
}
|
|
64
61
|
else {
|
|
65
|
-
this.signerOptions = { existingPrefixes: { wsse: oasisBaseUri
|
|
62
|
+
this.signerOptions = { existingPrefixes: { wsse: `${oasisBaseUri}/oasis-200401-wss-wssecurity-secext-1.0.xsd` } };
|
|
66
63
|
}
|
|
67
64
|
this.signer.signingKey = {
|
|
68
65
|
key: privatePEM,
|
|
69
|
-
passphrase: password
|
|
66
|
+
passphrase: password,
|
|
70
67
|
};
|
|
71
|
-
this.x509Id =
|
|
68
|
+
this.x509Id = `x509-${generateId()}`;
|
|
72
69
|
this.hasTimeStamp = typeof options.hasTimeStamp === 'undefined' ? true : !!options.hasTimeStamp;
|
|
73
70
|
this.signatureTransformations = Array.isArray(options.signatureTransformations) ? options.signatureTransformations
|
|
74
71
|
: ['http://www.w3.org/2000/09/xmldsig#enveloped-signature', 'http://www.w3.org/2001/10/xml-exc-c14n#'];
|
|
75
72
|
this.signer.keyInfoProvider = {};
|
|
76
|
-
this.signer.keyInfoProvider.getKeyInfo =
|
|
77
|
-
return
|
|
78
|
-
|
|
79
|
-
|
|
73
|
+
this.signer.keyInfoProvider.getKeyInfo = (key) => {
|
|
74
|
+
return `<wsse:SecurityTokenReference>` +
|
|
75
|
+
`<wsse:Reference URI="#${this.x509Id}" ValueType="${oasisBaseUri}/oasis-200401-wss-x509-token-profile-1.0#X509v3"/>` +
|
|
76
|
+
`</wsse:SecurityTokenReference>`;
|
|
80
77
|
};
|
|
81
78
|
}
|
|
82
|
-
|
|
79
|
+
postProcess(xml, envelopeKey) {
|
|
83
80
|
this.created = generateCreated();
|
|
84
81
|
this.expires = generateExpires();
|
|
85
|
-
|
|
82
|
+
let timestampStr = '';
|
|
86
83
|
if (this.hasTimeStamp) {
|
|
87
84
|
timestampStr =
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
`<Timestamp xmlns="${oasisBaseUri}/oasis-200401-wss-wssecurity-utility-1.0.xsd" Id="_1">` +
|
|
86
|
+
`<Created>${this.created}</Created>` +
|
|
87
|
+
`<Expires>${this.expires}</Expires>` +
|
|
88
|
+
`</Timestamp>`;
|
|
92
89
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
"
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
90
|
+
const binarySecurityToken = `<wsse:BinarySecurityToken ` +
|
|
91
|
+
`EncodingType="${oasisBaseUri}/oasis-200401-wss-soap-message-security-1.0#Base64Binary" ` +
|
|
92
|
+
`ValueType="${oasisBaseUri}/oasis-200401-wss-x509-token-profile-1.0#X509v3" ` +
|
|
93
|
+
`wsu:Id="${this.x509Id}">${this.publicP12PEM}</wsse:BinarySecurityToken>` +
|
|
94
|
+
timestampStr;
|
|
95
|
+
let xmlWithSec;
|
|
96
|
+
const secExt = `xmlns:wsse="${oasisBaseUri}/oasis-200401-wss-wssecurity-secext-1.0.xsd"`;
|
|
97
|
+
const secUtility = `xmlns:wsu="${oasisBaseUri}/oasis-200401-wss-wssecurity-utility-1.0.xsd"`;
|
|
98
|
+
const endOfSecurityHeader = xml.indexOf('</wsse:Security>');
|
|
99
|
+
if (endOfSecurityHeader > -1) {
|
|
100
|
+
const securityHeaderRegexp = /<wsse:Security( [^>]*)?>/;
|
|
101
|
+
const match = xml.match(securityHeaderRegexp);
|
|
102
|
+
let insertHeaderAttributes = '';
|
|
103
|
+
if (!match[0].includes(` ${envelopeKey}:mustUnderstand="`)) {
|
|
104
|
+
insertHeaderAttributes += `${envelopeKey}:mustUnderstand="1" `;
|
|
105
|
+
}
|
|
106
|
+
if (!match[0].includes(secExt.substring(0, secExt.indexOf('=')))) {
|
|
107
|
+
insertHeaderAttributes += `${secExt} `;
|
|
108
|
+
}
|
|
109
|
+
if (!match[0].includes(secUtility.substring(0, secExt.indexOf('=')))) {
|
|
110
|
+
insertHeaderAttributes += `${secUtility} `;
|
|
111
|
+
}
|
|
112
|
+
const headerMarker = '<wsse:Security ';
|
|
113
|
+
const startOfSecurityHeader = xml.indexOf(headerMarker);
|
|
114
|
+
xml = insertStr(binarySecurityToken, xml, endOfSecurityHeader);
|
|
115
|
+
xmlWithSec = insertStr(insertHeaderAttributes, xml, startOfSecurityHeader + headerMarker.length);
|
|
116
|
+
}
|
|
117
|
+
else {
|
|
118
|
+
const secHeader = `<wsse:Security ${secExt} ` +
|
|
119
|
+
secUtility +
|
|
120
|
+
`${envelopeKey}:mustUnderstand="1">` +
|
|
121
|
+
binarySecurityToken +
|
|
122
|
+
`</wsse:Security>`;
|
|
123
|
+
xmlWithSec = insertStr(secHeader, xml, xml.indexOf(`</${envelopeKey}:Header>`));
|
|
124
|
+
}
|
|
125
|
+
const references = this.signatureTransformations;
|
|
126
|
+
const bodyXpath = `//*[name(.)='${envelopeKey}:Body']`;
|
|
105
127
|
resolvePlaceholderInReferences(this.signer.references, bodyXpath);
|
|
106
|
-
if (!(this.signer.references.filter(
|
|
128
|
+
if (!(this.signer.references.filter((ref) => (ref.xpath === bodyXpath)).length > 0)) {
|
|
107
129
|
this.signer.addReference(bodyXpath, references);
|
|
108
130
|
}
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
if (!(
|
|
112
|
-
|
|
131
|
+
for (const name of this.additionalReferences) {
|
|
132
|
+
const xpath = `//*[name(.)='${name}']`;
|
|
133
|
+
if (!(this.signer.references.filter((ref) => (ref.xpath === xpath)).length > 0)) {
|
|
134
|
+
this.signer.addReference(xpath, references);
|
|
113
135
|
}
|
|
114
|
-
};
|
|
115
|
-
var this_1 = this;
|
|
116
|
-
for (var _i = 0, _a = this.additionalReferences; _i < _a.length; _i++) {
|
|
117
|
-
var name_1 = _a[_i];
|
|
118
|
-
_loop_1(name_1);
|
|
119
136
|
}
|
|
120
|
-
|
|
121
|
-
if (this.hasTimeStamp && !(this.signer.references.filter(
|
|
137
|
+
const timestampXpath = `//*[name(.)='wsse:Security']/*[local-name(.)='Timestamp']`;
|
|
138
|
+
if (this.hasTimeStamp && !(this.signer.references.filter((ref) => (ref.xpath === timestampXpath)).length > 0)) {
|
|
122
139
|
this.signer.addReference(timestampXpath, references);
|
|
123
140
|
}
|
|
124
141
|
this.signer.computeSignature(xmlWithSec, this.signerOptions);
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
142
|
+
const originalXmlWithIds = this.signer.getOriginalXmlWithIds();
|
|
143
|
+
const signatureXml = this.signer.getSignatureXml();
|
|
144
|
+
return insertStr(signatureXml, originalXmlWithIds, originalXmlWithIds.indexOf('</wsse:Security>'));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
129
147
|
exports.WSSecurityCert = WSSecurityCert;
|
|
130
148
|
//# sourceMappingURL=WSSecurityCert.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WSSecurityCert.js","sourceRoot":"","sources":["../../src/security/WSSecurityCert.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"WSSecurityCert.js","sourceRoot":"","sources":["../../src/security/WSSecurityCert.ts"],"names":[],"mappings":";;;AAAA,+BAAoC;AACpC,2CAAuC;AAGvC,SAAS,UAAU,CAAC,IAAU,EAAE,OAAe;IAC7C,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,OAAO,GAAG,KAAK,CAAC,CAAC;AACpD,CAAC;AAED,SAAS,iBAAiB,CAAC,IAAU;IACnC,OAAO,IAAI,CAAC,cAAc,EAAE,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,CAAC,IAAI,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACnF,CAAC,GAAG,GAAG,IAAI,CAAC,UAAU,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG;QACtF,CAAC,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,GAAG,CAAC,GAAG,GAAG,IAAI,CAAC,aAAa,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;AAChG,CAAC;AAED,SAAS,eAAe;IACtB,OAAO,iBAAiB,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AAC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CAAC,MAAM,CAAC,qBAAqB,EAAE,CAAC;QAC/D,MAAM,YAAY,GAAG,IAAI,CAAC,MAAM,CAAC,eAAe,EAAE,CAAC;QACnD,OAAO,SAAS,CAAC,YAAY,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACrG,CAAC;CACF;AA3ID,wCA2IC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { ISecurity } from '../types';
|
|
2
|
+
import { WSSecurity } from './WSSecurity';
|
|
3
|
+
import { WSSecurityCert } from './WSSecurityCert';
|
|
4
|
+
export declare class WSSecurityPlusCert implements ISecurity {
|
|
5
|
+
private readonly wsSecurity;
|
|
6
|
+
private readonly wsSecurityCert;
|
|
7
|
+
constructor(wsSecurity: WSSecurity, wsSecurityCert: WSSecurityCert);
|
|
8
|
+
postProcess(xml: string, envelopeKey: string): string;
|
|
9
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.WSSecurityPlusCert = void 0;
|
|
4
|
+
class WSSecurityPlusCert {
|
|
5
|
+
constructor(wsSecurity, wsSecurityCert) {
|
|
6
|
+
this.wsSecurity = wsSecurity;
|
|
7
|
+
this.wsSecurityCert = wsSecurityCert;
|
|
8
|
+
}
|
|
9
|
+
postProcess(xml, envelopeKey) {
|
|
10
|
+
const securityXml = this.wsSecurity.toXML();
|
|
11
|
+
const endOfHeader = xml.indexOf(`</${envelopeKey}:Header>`);
|
|
12
|
+
xml = [xml.slice(0, endOfHeader), securityXml, xml.slice(endOfHeader)].join('');
|
|
13
|
+
return this.wsSecurityCert.postProcess(xml, envelopeKey);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.WSSecurityPlusCert = WSSecurityPlusCert;
|
|
17
|
+
//# sourceMappingURL=WSSecurityPlusCert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WSSecurityPlusCert.js","sourceRoot":"","sources":["../../src/security/WSSecurityPlusCert.ts"],"names":[],"mappings":";;;AAIA,MAAa,kBAAkB;IAC7B,YAA6B,UAAsB,EAAmB,cAA8B;QAAvE,eAAU,GAAV,UAAU,CAAY;QAAmB,mBAAc,GAAd,cAAc,CAAgB;IAAG,CAAC;IAEjG,WAAW,CAAC,GAAW,EAAE,WAAmB;QACjD,MAAM,WAAW,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,EAAE,CAAC;QAC5C,MAAM,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,KAAK,WAAW,UAAU,CAAC,CAAC;QAC5D,GAAG,GAAG,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,WAAW,CAAC,EAAE,WAAW,EAAE,GAAG,CAAC,KAAK,CAAC,WAAW,CAAC,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAEhF,OAAO,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;IAC3D,CAAC;CACF;AAVD,gDAUC"}
|
package/lib/security/index.d.ts
CHANGED
package/lib/security/index.js
CHANGED
|
@@ -1,15 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
8
12
|
}));
|
|
9
13
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
10
|
-
for (var p in m) if (p !== "default" && !
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
|
-
exports
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
17
|
__exportStar(require("./BasicAuthSecurity"), exports);
|
|
14
18
|
__exportStar(require("./BearerSecurity"), exports);
|
|
15
19
|
__exportStar(require("./ClientSSLSecurity"), exports);
|
|
@@ -17,4 +21,5 @@ __exportStar(require("./ClientSSLSecurityPFX"), exports);
|
|
|
17
21
|
__exportStar(require("./NTLMSecurity"), exports);
|
|
18
22
|
__exportStar(require("./WSSecurity"), exports);
|
|
19
23
|
__exportStar(require("./WSSecurityCert"), exports);
|
|
24
|
+
__exportStar(require("./WSSecurityPlusCert"), exports);
|
|
20
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/security/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AACA,sDAAoC;AACpC,mDAAiC;AACjC,sDAAoC;AACpC,yDAAuC;AACvC,iDAA+B;AAC/B,+CAA6B;AAC7B,mDAAiC;AACjC,uDAAqC"}
|