samlify 2.11.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 +52 -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 +119 -155
- 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 +318 -261
- 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 +165 -83
- 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 +17 -7
- 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 +144 -89
- 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/src/api.ts +0 -36
- 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 -777
- 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 -231
- 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,46 +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
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
14
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
15
|
-
};
|
|
16
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
3
|
exports.logoutResponseFields = exports.logoutRequestFields = exports.loginResponseFields = exports.logoutResponseStatusFields = exports.loginResponseStatusFields = exports.loginRequestFields = void 0;
|
|
18
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
|
+
*/
|
|
19
12
|
var xpath_1 = require("xpath");
|
|
20
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
|
+
*/
|
|
21
18
|
function toNodeArray(result) {
|
|
22
19
|
if (Array.isArray(result))
|
|
23
20
|
return result;
|
|
24
|
-
if (result != null && typeof result === 'object' && 'nodeType' in result)
|
|
21
|
+
if (result != null && typeof result === 'object' && 'nodeType' in result) {
|
|
25
22
|
return [result];
|
|
23
|
+
}
|
|
26
24
|
return [];
|
|
27
25
|
}
|
|
28
|
-
|
|
29
|
-
|
|
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
|
+
*/
|
|
30
31
|
function buildAbsoluteXPath(paths) {
|
|
31
32
|
return paths.reduce(function (currentPath, name) {
|
|
32
|
-
var appendedPath = currentPath;
|
|
33
33
|
var isWildcard = name.startsWith('~');
|
|
34
34
|
if (isWildcard) {
|
|
35
35
|
var pathName = name.replace('~', '');
|
|
36
|
-
|
|
36
|
+
return currentPath + "/*[contains(local-name(), ".concat((0, utility_1.escapeXPathValue)(pathName), ")]");
|
|
37
37
|
}
|
|
38
|
-
|
|
39
|
-
appendedPath = currentPath + "/*[local-name(.)='".concat(name, "']");
|
|
40
|
-
}
|
|
41
|
-
return appendedPath;
|
|
38
|
+
return currentPath + "/*[local-name(.)=".concat((0, utility_1.escapeXPathValue)(name), "]");
|
|
42
39
|
}, '');
|
|
43
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
|
+
*/
|
|
44
46
|
function buildAttributeXPath(attributes) {
|
|
45
47
|
if (attributes.length === 0) {
|
|
46
48
|
return '/text()';
|
|
@@ -48,38 +50,39 @@ function buildAttributeXPath(attributes) {
|
|
|
48
50
|
if (attributes.length === 1) {
|
|
49
51
|
return "/@".concat(attributes[0]);
|
|
50
52
|
}
|
|
51
|
-
var filters = attributes.map(function (attribute) { return "name()=
|
|
53
|
+
var filters = attributes.map(function (attribute) { return "name()=".concat((0, utility_1.escapeXPathValue)(attribute)); }).join(' or ');
|
|
52
54
|
return "/@*[".concat(filters, "]");
|
|
53
55
|
}
|
|
56
|
+
/** Default extractor fields for an inbound `AuthnRequest` (login request). */
|
|
54
57
|
exports.loginRequestFields = [
|
|
55
58
|
{
|
|
56
59
|
key: 'request',
|
|
57
60
|
localPath: ['AuthnRequest'],
|
|
58
|
-
attributes: ['ID', 'IssueInstant', 'Destination', 'AssertionConsumerServiceURL']
|
|
61
|
+
attributes: ['ID', 'IssueInstant', 'Destination', 'AssertionConsumerServiceURL'],
|
|
59
62
|
},
|
|
60
63
|
{
|
|
61
64
|
key: 'issuer',
|
|
62
65
|
localPath: ['AuthnRequest', 'Issuer'],
|
|
63
|
-
attributes: []
|
|
66
|
+
attributes: [],
|
|
64
67
|
},
|
|
65
68
|
{
|
|
66
69
|
key: 'nameIDPolicy',
|
|
67
70
|
localPath: ['AuthnRequest', 'NameIDPolicy'],
|
|
68
|
-
attributes: ['Format', 'AllowCreate']
|
|
71
|
+
attributes: ['Format', 'AllowCreate'],
|
|
69
72
|
},
|
|
70
73
|
{
|
|
71
74
|
key: 'authnContextClassRef',
|
|
72
75
|
localPath: ['AuthnRequest', 'AuthnContextClassRef'],
|
|
73
|
-
attributes: []
|
|
76
|
+
attributes: [],
|
|
74
77
|
},
|
|
75
78
|
{
|
|
76
79
|
key: 'signature',
|
|
77
80
|
localPath: ['AuthnRequest', 'Signature'],
|
|
78
81
|
attributes: [],
|
|
79
|
-
context: true
|
|
80
|
-
}
|
|
82
|
+
context: true,
|
|
83
|
+
},
|
|
81
84
|
];
|
|
82
|
-
|
|
85
|
+
/** Two-tier status code extractor for login responses. */
|
|
83
86
|
exports.loginResponseStatusFields = [
|
|
84
87
|
{
|
|
85
88
|
key: 'top',
|
|
@@ -90,27 +93,35 @@ exports.loginResponseStatusFields = [
|
|
|
90
93
|
key: 'second',
|
|
91
94
|
localPath: ['Response', 'Status', 'StatusCode', 'StatusCode'],
|
|
92
95
|
attributes: ['Value'],
|
|
93
|
-
}
|
|
96
|
+
},
|
|
94
97
|
];
|
|
95
|
-
|
|
98
|
+
/** Two-tier status code extractor for logout responses. */
|
|
96
99
|
exports.logoutResponseStatusFields = [
|
|
97
100
|
{
|
|
98
101
|
key: 'top',
|
|
99
102
|
localPath: ['LogoutResponse', 'Status', 'StatusCode'],
|
|
100
|
-
attributes: ['Value']
|
|
103
|
+
attributes: ['Value'],
|
|
101
104
|
},
|
|
102
105
|
{
|
|
103
106
|
key: 'second',
|
|
104
107
|
localPath: ['LogoutResponse', 'Status', 'StatusCode', 'StatusCode'],
|
|
105
108
|
attributes: ['Value'],
|
|
106
|
-
}
|
|
109
|
+
},
|
|
107
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
|
+
*/
|
|
108
119
|
var loginResponseFields = function (assertion) { return [
|
|
109
120
|
{
|
|
110
121
|
key: 'conditions',
|
|
111
122
|
localPath: ['Assertion', 'Conditions'],
|
|
112
123
|
attributes: ['NotBefore', 'NotOnOrAfter'],
|
|
113
|
-
shortcut: assertion
|
|
124
|
+
shortcut: assertion,
|
|
114
125
|
},
|
|
115
126
|
{
|
|
116
127
|
key: 'response',
|
|
@@ -121,30 +132,25 @@ var loginResponseFields = function (assertion) { return [
|
|
|
121
132
|
key: 'audience',
|
|
122
133
|
localPath: ['Assertion', 'Conditions', 'AudienceRestriction', 'Audience'],
|
|
123
134
|
attributes: [],
|
|
124
|
-
shortcut: assertion
|
|
135
|
+
shortcut: assertion,
|
|
125
136
|
},
|
|
126
|
-
// {
|
|
127
|
-
// key: 'issuer',
|
|
128
|
-
// localPath: ['Response', 'Issuer'],
|
|
129
|
-
// attributes: []
|
|
130
|
-
// },
|
|
131
137
|
{
|
|
132
138
|
key: 'issuer',
|
|
133
139
|
localPath: ['Assertion', 'Issuer'],
|
|
134
140
|
attributes: [],
|
|
135
|
-
shortcut: assertion
|
|
141
|
+
shortcut: assertion,
|
|
136
142
|
},
|
|
137
143
|
{
|
|
138
144
|
key: 'nameID',
|
|
139
145
|
localPath: ['Assertion', 'Subject', 'NameID'],
|
|
140
146
|
attributes: [],
|
|
141
|
-
shortcut: assertion
|
|
147
|
+
shortcut: assertion,
|
|
142
148
|
},
|
|
143
149
|
{
|
|
144
150
|
key: 'sessionIndex',
|
|
145
151
|
localPath: ['Assertion', 'AuthnStatement'],
|
|
146
152
|
attributes: ['AuthnInstant', 'SessionNotOnOrAfter', 'SessionIndex'],
|
|
147
|
-
shortcut: assertion
|
|
153
|
+
shortcut: assertion,
|
|
148
154
|
},
|
|
149
155
|
{
|
|
150
156
|
key: 'attributes',
|
|
@@ -152,220 +158,178 @@ var loginResponseFields = function (assertion) { return [
|
|
|
152
158
|
index: ['Name'],
|
|
153
159
|
attributePath: ['AttributeValue'],
|
|
154
160
|
attributes: [],
|
|
155
|
-
shortcut: assertion
|
|
156
|
-
}
|
|
161
|
+
shortcut: assertion,
|
|
162
|
+
},
|
|
157
163
|
]; };
|
|
158
164
|
exports.loginResponseFields = loginResponseFields;
|
|
165
|
+
/** Default extractor fields for an inbound `LogoutRequest`. */
|
|
159
166
|
exports.logoutRequestFields = [
|
|
160
167
|
{
|
|
161
168
|
key: 'request',
|
|
162
169
|
localPath: ['LogoutRequest'],
|
|
163
|
-
attributes: ['ID', 'IssueInstant', 'Destination']
|
|
170
|
+
attributes: ['ID', 'IssueInstant', 'Destination'],
|
|
164
171
|
},
|
|
165
172
|
{
|
|
166
173
|
key: 'issuer',
|
|
167
174
|
localPath: ['LogoutRequest', 'Issuer'],
|
|
168
|
-
attributes: []
|
|
175
|
+
attributes: [],
|
|
169
176
|
},
|
|
170
177
|
{
|
|
171
178
|
key: 'nameID',
|
|
172
179
|
localPath: ['LogoutRequest', 'NameID'],
|
|
173
|
-
attributes: []
|
|
180
|
+
attributes: [],
|
|
174
181
|
},
|
|
175
182
|
{
|
|
176
183
|
key: 'sessionIndex',
|
|
177
184
|
localPath: ['LogoutRequest', 'SessionIndex'],
|
|
178
|
-
attributes: []
|
|
185
|
+
attributes: [],
|
|
179
186
|
},
|
|
180
187
|
{
|
|
181
188
|
key: 'signature',
|
|
182
189
|
localPath: ['LogoutRequest', 'Signature'],
|
|
183
190
|
attributes: [],
|
|
184
|
-
context: true
|
|
185
|
-
}
|
|
191
|
+
context: true,
|
|
192
|
+
},
|
|
186
193
|
];
|
|
194
|
+
/** Default extractor fields for an inbound `LogoutResponse`. */
|
|
187
195
|
exports.logoutResponseFields = [
|
|
188
196
|
{
|
|
189
197
|
key: 'response',
|
|
190
198
|
localPath: ['LogoutResponse'],
|
|
191
|
-
attributes: ['ID', 'Destination', 'InResponseTo']
|
|
199
|
+
attributes: ['ID', 'Destination', 'InResponseTo'],
|
|
192
200
|
},
|
|
193
201
|
{
|
|
194
202
|
key: 'issuer',
|
|
195
203
|
localPath: ['LogoutResponse', 'Issuer'],
|
|
196
|
-
attributes: []
|
|
204
|
+
attributes: [],
|
|
197
205
|
},
|
|
198
206
|
{
|
|
199
207
|
key: 'signature',
|
|
200
208
|
localPath: ['LogoutResponse', 'Signature'],
|
|
201
209
|
attributes: [],
|
|
202
|
-
context: true
|
|
203
|
-
}
|
|
210
|
+
context: true,
|
|
211
|
+
},
|
|
204
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
|
+
*/
|
|
205
225
|
function extract(context, fields) {
|
|
206
226
|
var dom = (0, api_1.getContext)().dom;
|
|
207
227
|
var rootDoc = dom.parseFromString(context);
|
|
208
228
|
return fields.reduce(function (result, field) {
|
|
209
|
-
var
|
|
210
|
-
// get essential fields
|
|
211
|
-
var key = field.key;
|
|
212
|
-
var localPath = field.localPath;
|
|
213
|
-
var attributes = field.attributes;
|
|
214
|
-
var isEntire = field.context;
|
|
215
|
-
var shortcut = field.shortcut;
|
|
216
|
-
// get optional fields
|
|
217
|
-
var index = field.index;
|
|
218
|
-
var attributePath = field.attributePath;
|
|
219
|
-
// 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;
|
|
220
230
|
var targetDoc = rootDoc;
|
|
221
|
-
// if shortcut is used, then replace the doc
|
|
222
|
-
// it's a design for overriding the doc used during runtime
|
|
223
231
|
if (shortcut) {
|
|
224
232
|
targetDoc = dom.parseFromString(shortcut);
|
|
225
233
|
}
|
|
226
|
-
//
|
|
227
|
-
|
|
228
|
-
{
|
|
229
|
-
key: 'issuer',
|
|
230
|
-
localPath: [
|
|
231
|
-
['Response', 'Issuer'],
|
|
232
|
-
['Response', 'Assertion', 'Issuer']
|
|
233
|
-
],
|
|
234
|
-
attributes: []
|
|
235
|
-
}
|
|
236
|
-
*/
|
|
234
|
+
// Multi-path union: each entry is a separate localPath whose text()
|
|
235
|
+
// values are merged.
|
|
237
236
|
if (localPath.every(function (path) { return Array.isArray(path); })) {
|
|
238
237
|
var multiXPaths = localPath
|
|
239
|
-
.map(function (path) {
|
|
240
|
-
// not support attribute yet, so ignore it
|
|
241
|
-
return "".concat(buildAbsoluteXPath(path), "/text()");
|
|
242
|
-
})
|
|
238
|
+
.map(function (path) { return "".concat(buildAbsoluteXPath(path), "/text()"); })
|
|
243
239
|
.join(' | ');
|
|
244
|
-
|
|
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;
|
|
245
244
|
}
|
|
246
|
-
// eo special case: multiple path
|
|
247
245
|
var baseXPath = buildAbsoluteXPath(localPath);
|
|
248
246
|
var attributeXPath = buildAttributeXPath(attributes);
|
|
249
|
-
//
|
|
250
|
-
/*
|
|
251
|
-
{
|
|
252
|
-
key: 'attributes',
|
|
253
|
-
localPath: ['Response', 'Assertion', 'AttributeStatement', 'Attribute'],
|
|
254
|
-
index: ['Name'],
|
|
255
|
-
attributePath: ['AttributeValue'],
|
|
256
|
-
attributes: []
|
|
257
|
-
}
|
|
258
|
-
*/
|
|
247
|
+
// Parent/child aggregation (e.g. SAML Attribute → AttributeValue).
|
|
259
248
|
if (index && attributePath) {
|
|
260
|
-
// find the index in localpath
|
|
261
249
|
var indexPath = buildAttributeXPath(index);
|
|
262
250
|
var fullLocalXPath = "".concat(baseXPath).concat(indexPath);
|
|
263
251
|
var parentNodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
264
|
-
// [uid, mail, edupersonaffiliation], ready for aggregate
|
|
265
252
|
var parentAttributes = toNodeArray((0, xpath_1.select)(fullLocalXPath, targetDoc)).map(function (n) { return n.value; });
|
|
266
|
-
// [attribute, attributevalue]
|
|
267
253
|
var childXPath = buildAbsoluteXPath([(0, utility_1.last)(localPath)].concat(attributePath));
|
|
268
254
|
var childAttributeXPath = buildAttributeXPath(attributes);
|
|
269
255
|
var fullChildXPath_1 = "".concat(childXPath).concat(childAttributeXPath);
|
|
270
|
-
// [ 'test', 'test@example.com', [ 'users', 'examplerole1' ] ]
|
|
271
256
|
var childAttributes = parentNodes.map(function (node) {
|
|
272
257
|
var nodeDoc = dom.parseFromString(node.toString());
|
|
273
258
|
if (attributes.length === 0) {
|
|
274
259
|
var childValues = toNodeArray((0, xpath_1.select)(fullChildXPath_1, nodeDoc)).map(function (n) { return n.nodeValue; });
|
|
275
|
-
|
|
276
|
-
return childValues[0];
|
|
277
|
-
}
|
|
278
|
-
return childValues;
|
|
260
|
+
return childValues.length === 1 ? childValues[0] : childValues;
|
|
279
261
|
}
|
|
280
262
|
if (attributes.length > 0) {
|
|
281
263
|
var childValues = toNodeArray((0, xpath_1.select)(fullChildXPath_1, nodeDoc)).map(function (n) { return n.value; });
|
|
282
|
-
|
|
283
|
-
return childValues[0];
|
|
284
|
-
}
|
|
285
|
-
return childValues;
|
|
264
|
+
return childValues.length === 1 ? childValues[0] : childValues;
|
|
286
265
|
}
|
|
287
266
|
return null;
|
|
288
267
|
});
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
return __assign(__assign({}, result), (_b = {}, _b[key] = obj, _b));
|
|
268
|
+
result[key] = (0, utility_1.zipObject)(parentAttributes, childAttributes, false);
|
|
269
|
+
return result;
|
|
292
270
|
}
|
|
293
|
-
//
|
|
294
|
-
/*
|
|
295
|
-
{
|
|
296
|
-
key: 'signature',
|
|
297
|
-
localPath: ['AuthnRequest', 'Signature'],
|
|
298
|
-
attributes: [],
|
|
299
|
-
context: true
|
|
300
|
-
}
|
|
301
|
-
*/
|
|
271
|
+
// Whole-subtree capture.
|
|
302
272
|
if (isEntire) {
|
|
303
273
|
var nodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
304
274
|
var value = null;
|
|
305
275
|
if (nodes.length === 1) {
|
|
306
276
|
value = nodes[0].toString();
|
|
307
277
|
}
|
|
308
|
-
if (nodes.length > 1) {
|
|
278
|
+
else if (nodes.length > 1) {
|
|
309
279
|
value = nodes.map(function (n) { return n.toString(); });
|
|
310
280
|
}
|
|
311
|
-
|
|
281
|
+
result[key] = value;
|
|
282
|
+
return result;
|
|
312
283
|
}
|
|
313
|
-
//
|
|
314
|
-
/*
|
|
315
|
-
{
|
|
316
|
-
key: 'nameIDPolicy',
|
|
317
|
-
localPath: ['AuthnRequest', 'NameIDPolicy'],
|
|
318
|
-
attributes: ['Format', 'AllowCreate']
|
|
319
|
-
}
|
|
320
|
-
*/
|
|
284
|
+
// Multi-attribute capture: produce one record per parent node.
|
|
321
285
|
if (attributes.length > 1) {
|
|
322
286
|
var baseNode = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc)).map(function (n) { return n.toString(); });
|
|
323
287
|
var childXPath_1 = "".concat(buildAbsoluteXPath([(0, utility_1.last)(localPath)])).concat(attributeXPath);
|
|
324
288
|
var attributeValues = baseNode.map(function (node) {
|
|
325
289
|
var nodeDoc = dom.parseFromString(node);
|
|
326
|
-
|
|
327
|
-
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;
|
|
328
292
|
return r;
|
|
329
293
|
}, {});
|
|
330
|
-
return values;
|
|
331
294
|
});
|
|
332
|
-
|
|
295
|
+
result[key] = (attributeValues.length === 1 ? attributeValues[0] : attributeValues);
|
|
296
|
+
return result;
|
|
333
297
|
}
|
|
334
|
-
//
|
|
335
|
-
/*
|
|
336
|
-
{
|
|
337
|
-
key: 'statusCode',
|
|
338
|
-
localPath: ['Response', 'Status', 'StatusCode'],
|
|
339
|
-
attributes: ['Value'],
|
|
340
|
-
}
|
|
341
|
-
*/
|
|
298
|
+
// Single-attribute capture.
|
|
342
299
|
if (attributes.length === 1) {
|
|
343
300
|
var fullPath = "".concat(baseXPath).concat(attributeXPath);
|
|
344
301
|
var attributeValues = toNodeArray((0, xpath_1.select)(fullPath, targetDoc)).map(function (n) { return n.value; });
|
|
345
|
-
|
|
302
|
+
result[key] = attributeValues[0];
|
|
303
|
+
return result;
|
|
346
304
|
}
|
|
347
|
-
//
|
|
348
|
-
/*
|
|
349
|
-
{
|
|
350
|
-
key: 'issuer',
|
|
351
|
-
localPath: ['AuthnRequest', 'Issuer'],
|
|
352
|
-
attributes: []
|
|
353
|
-
}
|
|
354
|
-
*/
|
|
305
|
+
// Zero-attribute capture: element text content.
|
|
355
306
|
if (attributes.length === 0) {
|
|
356
307
|
var attributeValue = null;
|
|
357
308
|
var nodes = toNodeArray((0, xpath_1.select)(baseXPath, targetDoc));
|
|
358
309
|
if (nodes.length === 1) {
|
|
359
310
|
var fullPath = "string(".concat(baseXPath).concat(attributeXPath, ")");
|
|
360
311
|
var strResult = (0, xpath_1.select)(fullPath, targetDoc);
|
|
361
|
-
|
|
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;
|
|
362
323
|
}
|
|
363
324
|
if (nodes.length > 1) {
|
|
364
|
-
attributeValue = nodes
|
|
325
|
+
attributeValue = nodes
|
|
326
|
+
.filter(function (n) { return n.firstChild; })
|
|
365
327
|
.map(function (n) { return n.firstChild.nodeValue; });
|
|
366
328
|
}
|
|
367
|
-
|
|
329
|
+
result[key] = attributeValue;
|
|
330
|
+
return result;
|
|
368
331
|
}
|
|
332
|
+
/* v8 ignore next */
|
|
369
333
|
return result;
|
|
370
334
|
}, {});
|
|
371
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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