samlify 2.12.0 → 2.13.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/README.md +1 -1
- package/build/src/api.js +41 -3
- package/build/src/api.js.map +1 -1
- package/build/src/binding-post.js +236 -182
- package/build/src/binding-post.js.map +1 -1
- package/build/src/binding-redirect.js +303 -215
- package/build/src/binding-redirect.js.map +1 -1
- package/build/src/binding-simplesign.js +285 -137
- package/build/src/binding-simplesign.js.map +1 -1
- package/build/src/entity-idp.js +130 -47
- package/build/src/entity-idp.js.map +1 -1
- package/build/src/entity-sp.js +81 -39
- package/build/src/entity-sp.js.map +1 -1
- package/build/src/entity.js +100 -62
- package/build/src/entity.js.map +1 -1
- package/build/src/extractor.js +118 -151
- package/build/src/extractor.js.map +1 -1
- package/build/src/flow.js +100 -96
- package/build/src/flow.js.map +1 -1
- package/build/src/libsaml.js +315 -259
- package/build/src/libsaml.js.map +1 -1
- package/build/src/metadata-idp.js +60 -30
- package/build/src/metadata-idp.js.map +1 -1
- package/build/src/metadata-sp.js +51 -41
- package/build/src/metadata-sp.js.map +1 -1
- package/build/src/metadata.js +47 -43
- package/build/src/metadata.js.map +1 -1
- package/build/src/options.js +73 -0
- package/build/src/options.js.map +1 -0
- package/build/src/urn.js +28 -1
- package/build/src/urn.js.map +1 -1
- package/build/src/utility.js +140 -85
- package/build/src/utility.js.map +1 -1
- package/build/src/validator.js +27 -10
- package/build/src/validator.js.map +1 -1
- package/package.json +16 -5
- package/types/src/api.d.ts +33 -3
- package/types/src/binding-post.d.ts +67 -34
- package/types/src/binding-redirect.d.ts +58 -31
- package/types/src/binding-simplesign.d.ts +77 -21
- package/types/src/entity-idp.d.ts +40 -31
- package/types/src/entity-sp.d.ts +37 -27
- package/types/src/entity.d.ts +71 -77
- package/types/src/extractor.d.ts +31 -22
- package/types/src/flow.d.ts +24 -2
- package/types/src/libsaml.d.ts +172 -118
- package/types/src/metadata-idp.d.ts +27 -11
- package/types/src/metadata-sp.d.ts +29 -19
- package/types/src/metadata.d.ts +59 -34
- package/types/src/options.d.ts +37 -0
- package/types/src/types.d.ts +250 -24
- package/types/src/urn.d.ts +7 -0
- package/types/src/utility.d.ts +139 -90
- package/types/src/validator.d.ts +21 -0
- package/.circleci/config.yml +0 -98
- package/.editorconfig +0 -19
- package/.github/FUNDING.yml +0 -1
- package/.github/workflows/deploy-docs.yml +0 -56
- package/.pre-commit.sh +0 -15
- package/.snyk +0 -4
- package/Makefile +0 -25
- package/index.ts +0 -28
- package/samlify-2.11.0.tgz +0 -0
- package/src/api.ts +0 -48
- package/src/binding-post.ts +0 -336
- package/src/binding-redirect.ts +0 -335
- package/src/binding-simplesign.ts +0 -231
- package/src/entity-idp.ts +0 -145
- package/src/entity-sp.ts +0 -114
- package/src/entity.ts +0 -243
- package/src/extractor.ts +0 -399
- package/src/flow.ts +0 -469
- package/src/libsaml.ts +0 -779
- package/src/metadata-idp.ts +0 -146
- package/src/metadata-sp.ts +0 -203
- package/src/metadata.ts +0 -166
- package/src/types.ts +0 -127
- package/src/urn.ts +0 -210
- package/src/utility.ts +0 -259
- package/src/validator.ts +0 -44
- package/tsconfig.json +0 -41
- package/tslint.json +0 -35
- package/types.d.ts +0 -2
- package/vitest.config.ts +0 -12
package/build/src/extractor.js
CHANGED
|
@@ -1,43 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __assign = (this && this.__assign) || function () {
|
|
3
|
-
__assign = Object.assign || function(t) {
|
|
4
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
-
s = arguments[i];
|
|
6
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
-
t[p] = s[p];
|
|
8
|
-
}
|
|
9
|
-
return t;
|
|
10
|
-
};
|
|
11
|
-
return __assign.apply(this, arguments);
|
|
12
|
-
};
|
|
13
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
3
|
exports.logoutResponseFields = exports.logoutRequestFields = exports.loginResponseFields = exports.logoutResponseStatusFields = exports.loginResponseStatusFields = exports.loginRequestFields = void 0;
|
|
15
4
|
exports.extract = extract;
|
|
5
|
+
/**
|
|
6
|
+
* @file extractor.ts
|
|
7
|
+
* @author tngan
|
|
8
|
+
* @desc Declarative XPath extractor for SAML messages. Defines the field
|
|
9
|
+
* catalogs (login/logout request & response) and a generic `extract` that
|
|
10
|
+
* evaluates them against an XML document.
|
|
11
|
+
*/
|
|
16
12
|
var xpath_1 = require("xpath");
|
|
17
13
|
var utility_1 = require("./utility");
|
|
14
|
+
var api_1 = require("./api");
|
|
15
|
+
/**
|
|
16
|
+
* Coerce the heterogeneous return type of `xpath.select` into a Node array.
|
|
17
|
+
*/
|
|
18
18
|
function toNodeArray(result) {
|
|
19
19
|
if (Array.isArray(result))
|
|
20
20
|
return result;
|
|
21
|
-
if (result != null && typeof result === 'object' && 'nodeType' in result)
|
|
21
|
+
if (result != null && typeof result === 'object' && 'nodeType' in result) {
|
|
22
22
|
return [result];
|
|
23
|
+
}
|
|
23
24
|
return [];
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Build an absolute XPath expression from a list of local-name segments.
|
|
28
|
+
* A segment prefixed with `~` matches any element whose local-name contains
|
|
29
|
+
* the remaining text (case-sensitive substring).
|
|
30
|
+
*/
|
|
27
31
|
function buildAbsoluteXPath(paths) {
|
|
28
32
|
return paths.reduce(function (currentPath, name) {
|
|
29
|
-
var appendedPath = currentPath;
|
|
30
33
|
var isWildcard = name.startsWith('~');
|
|
31
34
|
if (isWildcard) {
|
|
32
35
|
var pathName = name.replace('~', '');
|
|
33
|
-
|
|
36
|
+
return currentPath + "/*[contains(local-name(), ".concat((0, utility_1.escapeXPathValue)(pathName), ")]");
|
|
34
37
|
}
|
|
35
|
-
|
|
36
|
-
appendedPath = currentPath + "/*[local-name(.)=".concat((0, utility_1.escapeXPathValue)(name), "]");
|
|
37
|
-
}
|
|
38
|
-
return appendedPath;
|
|
38
|
+
return currentPath + "/*[local-name(.)=".concat((0, utility_1.escapeXPathValue)(name), "]");
|
|
39
39
|
}, '');
|
|
40
40
|
}
|
|
41
|
+
/**
|
|
42
|
+
* Append an attribute selector to an XPath. Zero attributes select text
|
|
43
|
+
* content; one attribute selects that attribute; multiple attributes use an
|
|
44
|
+
* `or` filter.
|
|
45
|
+
*/
|
|
41
46
|
function buildAttributeXPath(attributes) {
|
|
42
47
|
if (attributes.length === 0) {
|
|
43
48
|
return '/text()';
|
|
@@ -48,35 +53,36 @@ function buildAttributeXPath(attributes) {
|
|
|
48
53
|
var filters = attributes.map(function (attribute) { return "name()=".concat((0, utility_1.escapeXPathValue)(attribute)); }).join(' or ');
|
|
49
54
|
return "/@*[".concat(filters, "]");
|
|
50
55
|
}
|
|
56
|
+
/** Default extractor fields for an inbound `AuthnRequest` (login request). */
|
|
51
57
|
exports.loginRequestFields = [
|
|
52
58
|
{
|
|
53
59
|
key: 'request',
|
|
54
60
|
localPath: ['AuthnRequest'],
|
|
55
|
-
attributes: ['ID', 'IssueInstant', 'Destination', 'AssertionConsumerServiceURL']
|
|
61
|
+
attributes: ['ID', 'IssueInstant', 'Destination', 'AssertionConsumerServiceURL'],
|
|
56
62
|
},
|
|
57
63
|
{
|
|
58
64
|
key: 'issuer',
|
|
59
65
|
localPath: ['AuthnRequest', 'Issuer'],
|
|
60
|
-
attributes: []
|
|
66
|
+
attributes: [],
|
|
61
67
|
},
|
|
62
68
|
{
|
|
63
69
|
key: 'nameIDPolicy',
|
|
64
70
|
localPath: ['AuthnRequest', 'NameIDPolicy'],
|
|
65
|
-
attributes: ['Format', 'AllowCreate']
|
|
71
|
+
attributes: ['Format', 'AllowCreate'],
|
|
66
72
|
},
|
|
67
73
|
{
|
|
68
74
|
key: 'authnContextClassRef',
|
|
69
75
|
localPath: ['AuthnRequest', 'AuthnContextClassRef'],
|
|
70
|
-
attributes: []
|
|
76
|
+
attributes: [],
|
|
71
77
|
},
|
|
72
78
|
{
|
|
73
79
|
key: 'signature',
|
|
74
80
|
localPath: ['AuthnRequest', 'Signature'],
|
|
75
81
|
attributes: [],
|
|
76
|
-
context: true
|
|
77
|
-
}
|
|
82
|
+
context: true,
|
|
83
|
+
},
|
|
78
84
|
];
|
|
79
|
-
|
|
85
|
+
/** Two-tier status code extractor for login responses. */
|
|
80
86
|
exports.loginResponseStatusFields = [
|
|
81
87
|
{
|
|
82
88
|
key: 'top',
|
|
@@ -87,27 +93,35 @@ exports.loginResponseStatusFields = [
|
|
|
87
93
|
key: 'second',
|
|
88
94
|
localPath: ['Response', 'Status', 'StatusCode', 'StatusCode'],
|
|
89
95
|
attributes: ['Value'],
|
|
90
|
-
}
|
|
96
|
+
},
|
|
91
97
|
];
|
|
92
|
-
|
|
98
|
+
/** Two-tier status code extractor for logout responses. */
|
|
93
99
|
exports.logoutResponseStatusFields = [
|
|
94
100
|
{
|
|
95
101
|
key: 'top',
|
|
96
102
|
localPath: ['LogoutResponse', 'Status', 'StatusCode'],
|
|
97
|
-
attributes: ['Value']
|
|
103
|
+
attributes: ['Value'],
|
|
98
104
|
},
|
|
99
105
|
{
|
|
100
106
|
key: 'second',
|
|
101
107
|
localPath: ['LogoutResponse', 'Status', 'StatusCode', 'StatusCode'],
|
|
102
108
|
attributes: ['Value'],
|
|
103
|
-
}
|
|
109
|
+
},
|
|
104
110
|
];
|
|
111
|
+
/**
|
|
112
|
+
* Build the login-response extractor bound to a particular assertion XML.
|
|
113
|
+
* Assertion-scoped fields are re-rooted at the assertion fragment via the
|
|
114
|
+
* `shortcut` mechanism so that wrapping attacks can't redirect extraction.
|
|
115
|
+
*
|
|
116
|
+
* @param assertion XML string of the (verified) assertion node
|
|
117
|
+
* @returns extractor fields ready for `extract`
|
|
118
|
+
*/
|
|
105
119
|
var loginResponseFields = function (assertion) { return [
|
|
106
120
|
{
|
|
107
121
|
key: 'conditions',
|
|
108
122
|
localPath: ['Assertion', 'Conditions'],
|
|
109
123
|
attributes: ['NotBefore', 'NotOnOrAfter'],
|
|
110
|
-
shortcut: assertion
|
|
124
|
+
shortcut: assertion,
|
|
111
125
|
},
|
|
112
126
|
{
|
|
113
127
|
key: 'response',
|
|
@@ -118,30 +132,25 @@ var loginResponseFields = function (assertion) { return [
|
|
|
118
132
|
key: 'audience',
|
|
119
133
|
localPath: ['Assertion', 'Conditions', 'AudienceRestriction', 'Audience'],
|
|
120
134
|
attributes: [],
|
|
121
|
-
shortcut: assertion
|
|
135
|
+
shortcut: assertion,
|
|
122
136
|
},
|
|
123
|
-
// {
|
|
124
|
-
// key: 'issuer',
|
|
125
|
-
// localPath: ['Response', 'Issuer'],
|
|
126
|
-
// attributes: []
|
|
127
|
-
// },
|
|
128
137
|
{
|
|
129
138
|
key: 'issuer',
|
|
130
139
|
localPath: ['Assertion', 'Issuer'],
|
|
131
140
|
attributes: [],
|
|
132
|
-
shortcut: assertion
|
|
141
|
+
shortcut: assertion,
|
|
133
142
|
},
|
|
134
143
|
{
|
|
135
144
|
key: 'nameID',
|
|
136
145
|
localPath: ['Assertion', 'Subject', 'NameID'],
|
|
137
146
|
attributes: [],
|
|
138
|
-
shortcut: assertion
|
|
147
|
+
shortcut: assertion,
|
|
139
148
|
},
|
|
140
149
|
{
|
|
141
150
|
key: 'sessionIndex',
|
|
142
151
|
localPath: ['Assertion', 'AuthnStatement'],
|
|
143
152
|
attributes: ['AuthnInstant', 'SessionNotOnOrAfter', 'SessionIndex'],
|
|
144
|
-
shortcut: assertion
|
|
153
|
+
shortcut: assertion,
|
|
145
154
|
},
|
|
146
155
|
{
|
|
147
156
|
key: 'attributes',
|
|
@@ -149,220 +158,178 @@ var loginResponseFields = function (assertion) { return [
|
|
|
149
158
|
index: ['Name'],
|
|
150
159
|
attributePath: ['AttributeValue'],
|
|
151
160
|
attributes: [],
|
|
152
|
-
shortcut: assertion
|
|
153
|
-
}
|
|
161
|
+
shortcut: assertion,
|
|
162
|
+
},
|
|
154
163
|
]; };
|
|
155
164
|
exports.loginResponseFields = loginResponseFields;
|
|
165
|
+
/** Default extractor fields for an inbound `LogoutRequest`. */
|
|
156
166
|
exports.logoutRequestFields = [
|
|
157
167
|
{
|
|
158
168
|
key: 'request',
|
|
159
169
|
localPath: ['LogoutRequest'],
|
|
160
|
-
attributes: ['ID', 'IssueInstant', 'Destination']
|
|
170
|
+
attributes: ['ID', 'IssueInstant', 'Destination'],
|
|
161
171
|
},
|
|
162
172
|
{
|
|
163
173
|
key: 'issuer',
|
|
164
174
|
localPath: ['LogoutRequest', 'Issuer'],
|
|
165
|
-
attributes: []
|
|
175
|
+
attributes: [],
|
|
166
176
|
},
|
|
167
177
|
{
|
|
168
178
|
key: 'nameID',
|
|
169
179
|
localPath: ['LogoutRequest', 'NameID'],
|
|
170
|
-
attributes: []
|
|
180
|
+
attributes: [],
|
|
171
181
|
},
|
|
172
182
|
{
|
|
173
183
|
key: 'sessionIndex',
|
|
174
184
|
localPath: ['LogoutRequest', 'SessionIndex'],
|
|
175
|
-
attributes: []
|
|
185
|
+
attributes: [],
|
|
176
186
|
},
|
|
177
187
|
{
|
|
178
188
|
key: 'signature',
|
|
179
189
|
localPath: ['LogoutRequest', 'Signature'],
|
|
180
190
|
attributes: [],
|
|
181
|
-
context: true
|
|
182
|
-
}
|
|
191
|
+
context: true,
|
|
192
|
+
},
|
|
183
193
|
];
|
|
194
|
+
/** Default extractor fields for an inbound `LogoutResponse`. */
|
|
184
195
|
exports.logoutResponseFields = [
|
|
185
196
|
{
|
|
186
197
|
key: 'response',
|
|
187
198
|
localPath: ['LogoutResponse'],
|
|
188
|
-
attributes: ['ID', 'Destination', 'InResponseTo']
|
|
199
|
+
attributes: ['ID', 'Destination', 'InResponseTo'],
|
|
189
200
|
},
|
|
190
201
|
{
|
|
191
202
|
key: 'issuer',
|
|
192
203
|
localPath: ['LogoutResponse', 'Issuer'],
|
|
193
|
-
attributes: []
|
|
204
|
+
attributes: [],
|
|
194
205
|
},
|
|
195
206
|
{
|
|
196
207
|
key: 'signature',
|
|
197
208
|
localPath: ['LogoutResponse', 'Signature'],
|
|
198
209
|
attributes: [],
|
|
199
|
-
context: true
|
|
200
|
-
}
|
|
210
|
+
context: true,
|
|
211
|
+
},
|
|
201
212
|
];
|
|
213
|
+
/**
|
|
214
|
+
* Evaluate the given extractor fields against an XML document and return
|
|
215
|
+
* a flat object keyed by `field.key`. Handles:
|
|
216
|
+
* - multi-path localPaths (`string[][]`) collected with `|`
|
|
217
|
+
* - parent/child attribute aggregation (`index` + `attributePath`)
|
|
218
|
+
* - whole-subtree extraction (`context: true`)
|
|
219
|
+
* - single/multiple/zero-attribute text extraction
|
|
220
|
+
*
|
|
221
|
+
* @param context XML string to parse
|
|
222
|
+
* @param fields extractor field definitions
|
|
223
|
+
* @returns extracted SAML values keyed by field name
|
|
224
|
+
*/
|
|
202
225
|
function extract(context, fields) {
|
|
203
226
|
var dom = (0, api_1.getContext)().dom;
|
|
204
227
|
var rootDoc = dom.parseFromString(context);
|
|
205
228
|
return fields.reduce(function (result, field) {
|
|
206
|
-
var
|
|
207
|
-
// get essential fields
|
|
208
|
-
var key = field.key;
|
|
209
|
-
var localPath = field.localPath;
|
|
210
|
-
var attributes = field.attributes;
|
|
211
|
-
var isEntire = field.context;
|
|
212
|
-
var shortcut = field.shortcut;
|
|
213
|
-
// get optional fields
|
|
214
|
-
var index = field.index;
|
|
215
|
-
var attributePath = field.attributePath;
|
|
216
|
-
// set allowing overriding if there is a shortcut injected
|
|
229
|
+
var key = field.key, localPath = field.localPath, attributes = field.attributes, isEntire = field.context, shortcut = field.shortcut, index = field.index, attributePath = field.attributePath;
|
|
217
230
|
var targetDoc = rootDoc;
|
|
218
|
-
// if shortcut is used, then replace the doc
|
|
219
|
-
// it's a design for overriding the doc used during runtime
|
|
220
231
|
if (shortcut) {
|
|
221
232
|
targetDoc = dom.parseFromString(shortcut);
|
|
222
233
|
}
|
|
223
|
-
//
|
|
224
|
-
|
|
225
|
-
{
|
|
226
|
-
key: 'issuer',
|
|
227
|
-
localPath: [
|
|
228
|
-
['Response', 'Issuer'],
|
|
229
|
-
['Response', 'Assertion', 'Issuer']
|
|
230
|
-
],
|
|
231
|
-
attributes: []
|
|
232
|
-
}
|
|
233
|
-
*/
|
|
234
|
+
// Multi-path union: each entry is a separate localPath whose text()
|
|
235
|
+
// values are merged.
|
|
234
236
|
if (localPath.every(function (path) { return Array.isArray(path); })) {
|
|
235
237
|
var multiXPaths = localPath
|
|
236
|
-
.map(function (path) {
|
|
237
|
-
// not support attribute yet, so ignore it
|
|
238
|
-
return "".concat(buildAbsoluteXPath(path), "/text()");
|
|
239
|
-
})
|
|
238
|
+
.map(function (path) { return "".concat(buildAbsoluteXPath(path), "/text()"); })
|
|
240
239
|
.join(' | ');
|
|
241
|
-
|
|
240
|
+
result[key] = (0, utility_1.uniq)(toNodeArray((0, xpath_1.select)(multiXPaths, targetDoc))
|
|
241
|
+
.map(function (n) { return n.nodeValue; })
|
|
242
|
+
.filter(utility_1.notEmpty));
|
|
243
|
+
return result;
|
|
242
244
|
}
|
|
243
|
-
// eo special case: multiple path
|
|
244
245
|
var baseXPath = buildAbsoluteXPath(localPath);
|
|
245
246
|
var attributeXPath = buildAttributeXPath(attributes);
|
|
246
|
-
//
|
|
247
|
-
/*
|
|
248
|
-
{
|
|
249
|
-
key: 'attributes',
|
|
250
|
-
localPath: ['Response', 'Assertion', 'AttributeStatement', 'Attribute'],
|
|
251
|
-
index: ['Name'],
|
|
252
|
-
attributePath: ['AttributeValue'],
|
|
253
|
-
attributes: []
|
|
254
|
-
}
|
|
255
|
-
*/
|
|
247
|
+
// Parent/child aggregation (e.g. SAML Attribute → AttributeValue).
|
|
256
248
|
if (index && attributePath) {
|
|
257
|
-
// find the index in localpath
|
|
258
249
|
var indexPath = buildAttributeXPath(index);
|
|
259
250
|
var fullLocalXPath = "".concat(baseXPath).concat(indexPath);
|
|
260
251
|
var parentNodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
261
|
-
// [uid, mail, edupersonaffiliation], ready for aggregate
|
|
262
252
|
var parentAttributes = toNodeArray((0, xpath_1.select)(fullLocalXPath, targetDoc)).map(function (n) { return n.value; });
|
|
263
|
-
// [attribute, attributevalue]
|
|
264
253
|
var childXPath = buildAbsoluteXPath([(0, utility_1.last)(localPath)].concat(attributePath));
|
|
265
254
|
var childAttributeXPath = buildAttributeXPath(attributes);
|
|
266
255
|
var fullChildXPath_1 = "".concat(childXPath).concat(childAttributeXPath);
|
|
267
|
-
// [ 'test', 'test@example.com', [ 'users', 'examplerole1' ] ]
|
|
268
256
|
var childAttributes = parentNodes.map(function (node) {
|
|
269
257
|
var nodeDoc = dom.parseFromString(node.toString());
|
|
270
258
|
if (attributes.length === 0) {
|
|
271
259
|
var childValues = toNodeArray((0, xpath_1.select)(fullChildXPath_1, nodeDoc)).map(function (n) { return n.nodeValue; });
|
|
272
|
-
|
|
273
|
-
return childValues[0];
|
|
274
|
-
}
|
|
275
|
-
return childValues;
|
|
260
|
+
return childValues.length === 1 ? childValues[0] : childValues;
|
|
276
261
|
}
|
|
277
262
|
if (attributes.length > 0) {
|
|
278
263
|
var childValues = toNodeArray((0, xpath_1.select)(fullChildXPath_1, nodeDoc)).map(function (n) { return n.value; });
|
|
279
|
-
|
|
280
|
-
return childValues[0];
|
|
281
|
-
}
|
|
282
|
-
return childValues;
|
|
264
|
+
return childValues.length === 1 ? childValues[0] : childValues;
|
|
283
265
|
}
|
|
284
266
|
return null;
|
|
285
267
|
});
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
return __assign(__assign({}, result), (_b = {}, _b[key] = obj, _b));
|
|
268
|
+
result[key] = (0, utility_1.zipObject)(parentAttributes, childAttributes, false);
|
|
269
|
+
return result;
|
|
289
270
|
}
|
|
290
|
-
//
|
|
291
|
-
/*
|
|
292
|
-
{
|
|
293
|
-
key: 'signature',
|
|
294
|
-
localPath: ['AuthnRequest', 'Signature'],
|
|
295
|
-
attributes: [],
|
|
296
|
-
context: true
|
|
297
|
-
}
|
|
298
|
-
*/
|
|
271
|
+
// Whole-subtree capture.
|
|
299
272
|
if (isEntire) {
|
|
300
273
|
var nodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
301
274
|
var value = null;
|
|
302
275
|
if (nodes.length === 1) {
|
|
303
276
|
value = nodes[0].toString();
|
|
304
277
|
}
|
|
305
|
-
if (nodes.length > 1) {
|
|
278
|
+
else if (nodes.length > 1) {
|
|
306
279
|
value = nodes.map(function (n) { return n.toString(); });
|
|
307
280
|
}
|
|
308
|
-
|
|
281
|
+
result[key] = value;
|
|
282
|
+
return result;
|
|
309
283
|
}
|
|
310
|
-
//
|
|
311
|
-
/*
|
|
312
|
-
{
|
|
313
|
-
key: 'nameIDPolicy',
|
|
314
|
-
localPath: ['AuthnRequest', 'NameIDPolicy'],
|
|
315
|
-
attributes: ['Format', 'AllowCreate']
|
|
316
|
-
}
|
|
317
|
-
*/
|
|
284
|
+
// Multi-attribute capture: produce one record per parent node.
|
|
318
285
|
if (attributes.length > 1) {
|
|
319
286
|
var baseNode = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc)).map(function (n) { return n.toString(); });
|
|
320
287
|
var childXPath_1 = "".concat(buildAbsoluteXPath([(0, utility_1.last)(localPath)])).concat(attributeXPath);
|
|
321
288
|
var attributeValues = baseNode.map(function (node) {
|
|
322
289
|
var nodeDoc = dom.parseFromString(node);
|
|
323
|
-
|
|
324
|
-
r[(0,
|
|
290
|
+
return toNodeArray((0, xpath_1.select)(childXPath_1, nodeDoc)).reduce(function (r, n) {
|
|
291
|
+
r[(0, utility_1.camelCase)(n.name)] = n.value;
|
|
325
292
|
return r;
|
|
326
293
|
}, {});
|
|
327
|
-
return values;
|
|
328
294
|
});
|
|
329
|
-
|
|
295
|
+
result[key] = (attributeValues.length === 1 ? attributeValues[0] : attributeValues);
|
|
296
|
+
return result;
|
|
330
297
|
}
|
|
331
|
-
//
|
|
332
|
-
/*
|
|
333
|
-
{
|
|
334
|
-
key: 'statusCode',
|
|
335
|
-
localPath: ['Response', 'Status', 'StatusCode'],
|
|
336
|
-
attributes: ['Value'],
|
|
337
|
-
}
|
|
338
|
-
*/
|
|
298
|
+
// Single-attribute capture.
|
|
339
299
|
if (attributes.length === 1) {
|
|
340
300
|
var fullPath = "".concat(baseXPath).concat(attributeXPath);
|
|
341
301
|
var attributeValues = toNodeArray((0, xpath_1.select)(fullPath, targetDoc)).map(function (n) { return n.value; });
|
|
342
|
-
|
|
302
|
+
result[key] = attributeValues[0];
|
|
303
|
+
return result;
|
|
343
304
|
}
|
|
344
|
-
//
|
|
345
|
-
/*
|
|
346
|
-
{
|
|
347
|
-
key: 'issuer',
|
|
348
|
-
localPath: ['AuthnRequest', 'Issuer'],
|
|
349
|
-
attributes: []
|
|
350
|
-
}
|
|
351
|
-
*/
|
|
305
|
+
// Zero-attribute capture: element text content.
|
|
352
306
|
if (attributes.length === 0) {
|
|
353
307
|
var attributeValue = null;
|
|
354
308
|
var nodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
355
309
|
if (nodes.length === 1) {
|
|
356
310
|
var fullPath = "string(".concat(baseXPath).concat(attributeXPath, ")");
|
|
357
311
|
var strResult = (0, xpath_1.select)(fullPath, targetDoc);
|
|
358
|
-
|
|
312
|
+
// `string(...)` always evaluates to a string in XPath 1.0, but the
|
|
313
|
+
// type signature is wider — the alternative branches are defensive.
|
|
314
|
+
/* v8 ignore next 7 */
|
|
315
|
+
attributeValue =
|
|
316
|
+
typeof strResult === 'string'
|
|
317
|
+
? strResult
|
|
318
|
+
: strResult === null
|
|
319
|
+
? null
|
|
320
|
+
: Array.isArray(strResult)
|
|
321
|
+
? strResult
|
|
322
|
+
: null;
|
|
359
323
|
}
|
|
360
324
|
if (nodes.length > 1) {
|
|
361
|
-
attributeValue = nodes
|
|
325
|
+
attributeValue = nodes
|
|
326
|
+
.filter(function (n) { return n.firstChild; })
|
|
362
327
|
.map(function (n) { return n.firstChild.nodeValue; });
|
|
363
328
|
}
|
|
364
|
-
|
|
329
|
+
result[key] = attributeValue;
|
|
330
|
+
return result;
|
|
365
331
|
}
|
|
332
|
+
/* v8 ignore next */
|
|
366
333
|
return result;
|
|
367
334
|
}, {});
|
|
368
335
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../src/extractor.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"extractor.js","sourceRoot":"","sources":["../../src/extractor.ts"],"names":[],"mappings":";;;AAuOA,0BA4HC;AAnWD;;;;;;GAMG;AACH,+BAAgE;AAChE,qCAAyF;AACzF,6BAAmC;AAKnC;;GAEG;AACH,SAAS,WAAW,CAAC,MAAwB;IAC3C,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC;QAAE,OAAO,MAAM,CAAC;IACzC,IAAI,MAAM,IAAI,IAAI,IAAI,OAAO,MAAM,KAAK,QAAQ,IAAI,UAAU,IAAK,MAAiB,EAAE,CAAC;QACrF,OAAO,CAAC,MAAc,CAAC,CAAC;IAC1B,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED;;;;GAIG;AACH,SAAS,kBAAkB,CAAC,KAAe;IACzC,OAAO,KAAK,CAAC,MAAM,CAAS,UAAC,WAAW,EAAE,IAAI;QAC5C,IAAM,UAAU,GAAG,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QACxC,IAAI,UAAU,EAAE,CAAC;YACf,IAAM,QAAQ,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;YACvC,OAAO,WAAW,GAAG,oCAA6B,IAAA,0BAAgB,EAAC,QAAQ,CAAC,OAAI,CAAC;QACnF,CAAC;QACD,OAAO,WAAW,GAAG,2BAAoB,IAAA,0BAAgB,EAAC,IAAI,CAAC,MAAG,CAAC;IACrE,CAAC,EAAE,EAAE,CAAC,CAAC;AACT,CAAC;AAED;;;;GAIG;AACH,SAAS,mBAAmB,CAAC,UAAoB;IAC/C,IAAI,UAAU,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