samlesa 2.16.5 → 2.17.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.
Potentially problematic release.
This version of samlesa might be problematic. Click here for more details.
- package/README.md +30 -50
- package/build/src/binding-post.js +45 -31
- package/build/src/binding-redirect.js +88 -3
- package/build/src/binding-simplesign.js +0 -1
- package/build/src/entity-idp.js +1 -5
- package/build/src/entity-sp.js +115 -23
- package/build/src/extractor.js +29 -4
- package/build/src/flow.js +36 -103
- package/build/src/libsaml.js +172 -162
- package/build/src/metadata-sp.js +2 -0
- package/build/src/metadata.js +0 -2
- package/build/src/schema/saml-schema-ecp-2.0.xsd +1 -1
- package/build/src/schema/saml-schema-metadata-2.0.xsd +3 -3
- package/build/src/schema/saml-schema-protocol-2.0.xsd +1 -1
- package/build/src/schema/{env.xsd → soap-envelope.xsd} +1 -33
- package/build/src/schema/xml.xsd +88 -0
- package/build/src/schemaValidator.js +29 -12
- package/build/src/utility.js +12 -7
- package/package.json +14 -20
- package/types/src/api.d.ts +3 -3
- package/types/src/api.d.ts.map +1 -1
- package/types/src/binding-post.d.ts +22 -22
- package/types/src/binding-post.d.ts.map +1 -1
- package/types/src/binding-redirect.d.ts +14 -1
- package/types/src/binding-redirect.d.ts.map +1 -1
- package/types/src/binding-simplesign.d.ts.map +1 -1
- package/types/src/entity-idp.d.ts +3 -4
- package/types/src/entity-idp.d.ts.map +1 -1
- package/types/src/entity-sp.d.ts +44 -21
- package/types/src/entity-sp.d.ts.map +1 -1
- package/types/src/entity.d.ts.map +1 -1
- package/types/src/extractor.d.ts +5 -0
- package/types/src/extractor.d.ts.map +1 -1
- package/types/src/flow.d.ts.map +1 -1
- package/types/src/libsaml.d.ts +15 -4
- package/types/src/libsaml.d.ts.map +1 -1
- package/types/src/metadata-sp.d.ts.map +1 -1
- package/types/src/metadata.d.ts.map +1 -1
- package/types/src/schemaValidator.d.ts +1 -1
- package/types/src/schemaValidator.d.ts.map +1 -1
- package/types/src/utility.d.ts.map +1 -1
- package/build/index.js.map +0 -1
- package/build/src/api.js.map +0 -1
- package/build/src/binding-post.js.map +0 -1
- package/build/src/binding-redirect.js.map +0 -1
- package/build/src/binding-simplesign.js.map +0 -1
- package/build/src/entity-idp.js.map +0 -1
- package/build/src/entity-sp.js.map +0 -1
- package/build/src/entity.js.map +0 -1
- package/build/src/extractor.js.map +0 -1
- package/build/src/flow.js.map +0 -1
- package/build/src/libsaml.js.map +0 -1
- package/build/src/metadata-idp.js.map +0 -1
- package/build/src/metadata-sp.js.map +0 -1
- package/build/src/metadata.js.map +0 -1
- package/build/src/types.js.map +0 -1
- package/build/src/urn.js.map +0 -1
- package/build/src/utility.js.map +0 -1
- package/build/src/validator.js.map +0 -1
package/build/src/metadata.js
CHANGED
|
@@ -128,8 +128,6 @@ export default class Metadata {
|
|
|
128
128
|
getArtifactResolutionService(binding) {
|
|
129
129
|
if (binding && isString(binding)) {
|
|
130
130
|
const bindType = namespace.binding[binding];
|
|
131
|
-
console.log(this.meta);
|
|
132
|
-
console.log("看一下---------------------");
|
|
133
131
|
let artifactResolutionService = this.meta.artifactResolutionService;
|
|
134
132
|
if (!(artifactResolutionService instanceof Array)) {
|
|
135
133
|
artifactResolutionService = [artifactResolutionService];
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<import namespace="urn:oasis:names:tc:SAML:2.0:assertion"
|
|
16
16
|
schemaLocation="saml-schema-assertion-2.0.xsd"/>
|
|
17
17
|
<import namespace="http://schemas.xmlsoap.org/soap/envelope/"
|
|
18
|
-
schemaLocation="
|
|
18
|
+
schemaLocation="soap-envelope.xsd"/>
|
|
19
19
|
<annotation>
|
|
20
20
|
<documentation>
|
|
21
21
|
Document identifier: saml-schema-ecp-2.0
|
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
blockDefault="substitution"
|
|
12
12
|
version="2.0">
|
|
13
13
|
<import namespace="http://www.w3.org/2000/09/xmldsig#"
|
|
14
|
-
schemaLocation="
|
|
14
|
+
schemaLocation="xmldsig-core-schema.xsd"/>
|
|
15
15
|
<import namespace="http://www.w3.org/2001/04/xmlenc#"
|
|
16
|
-
schemaLocation="
|
|
16
|
+
schemaLocation="xenc-schema.xsd"/>
|
|
17
17
|
<import namespace="urn:oasis:names:tc:SAML:2.0:assertion"
|
|
18
18
|
schemaLocation="saml-schema-assertion-2.0.xsd"/>
|
|
19
19
|
<import namespace="http://www.w3.org/XML/1998/namespace"
|
|
20
|
-
schemaLocation="
|
|
20
|
+
schemaLocation="xml.xsd"/>
|
|
21
21
|
<annotation>
|
|
22
22
|
<documentation>
|
|
23
23
|
Document identifier: saml-schema-metadata-2.0
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
<import namespace="urn:oasis:names:tc:SAML:2.0:assertion"
|
|
13
13
|
schemaLocation="saml-schema-assertion-2.0.xsd"/>
|
|
14
14
|
<import namespace="http://www.w3.org/2000/09/xmldsig#"
|
|
15
|
-
schemaLocation="
|
|
15
|
+
schemaLocation="xmldsig-core-schema.xsd"/>
|
|
16
16
|
<annotation>
|
|
17
17
|
<documentation>
|
|
18
18
|
Document identifier: saml-schema-protocol-2.0
|
|
@@ -1,36 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
<!-- Schema for the SOAP/1.1 envelope
|
|
3
|
-
|
|
4
|
-
Portions © 2001 DevelopMentor.
|
|
5
|
-
© 2001 W3C (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved.
|
|
6
|
-
|
|
7
|
-
This document is governed by the W3C Software License [1] as described in the FAQ [2].
|
|
8
|
-
[1] http://www.w3.org/Consortium/Legal/copyright-software-19980720
|
|
9
|
-
[2] http://www.w3.org/Consortium/Legal/IPR-FAQ-20000620.html#DTD
|
|
10
|
-
By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions:
|
|
11
|
-
|
|
12
|
-
Permission to use, copy, modify, and distribute this software and its documentation, with or without modification, for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make:
|
|
13
|
-
|
|
14
|
-
1. The full text of this NOTICE in a location viewable to users of the redistributed or derivative work.
|
|
15
|
-
|
|
16
|
-
2. Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © 2001 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/"
|
|
17
|
-
|
|
18
|
-
3. Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.)
|
|
19
|
-
|
|
20
|
-
Original W3C files; http://www.w3.org/2001/06/soap-envelope
|
|
21
|
-
Changes made:
|
|
22
|
-
- reverted namespace to http://schemas.xmlsoap.org/soap/envelope/
|
|
23
|
-
- reverted mustUnderstand to only allow 0 and 1 as lexical values
|
|
24
|
-
- made encodingStyle a global attribute 20020825
|
|
25
|
-
- removed default value from mustUnderstand attribute declaration
|
|
26
|
-
|
|
27
|
-
THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
|
|
28
|
-
|
|
29
|
-
COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
|
|
30
|
-
|
|
31
|
-
The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders.
|
|
32
|
-
|
|
33
|
-
-->
|
|
1
|
+
<?xml version="1.0" encoding="utf-8"?>
|
|
34
2
|
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" targetNamespace="http://schemas.xmlsoap.org/soap/envelope/">
|
|
35
3
|
<!-- Envelope, header and body -->
|
|
36
4
|
<xs:element name="Envelope" type="tns:Envelope"/>
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
<?xml version="1.0"?>
|
|
2
|
+
<!-- DOCTYPE xs:schema PUBLIC "-//W3C//DTD XMLSCHEMA 200102//EN" "XMLSchema.dtd" -->
|
|
3
|
+
<xs:schema targetNamespace="http://www.w3.org/XML/1998/namespace"
|
|
4
|
+
xmlns:xs="http://www.w3.org/2001/XMLSchema"
|
|
5
|
+
xml:lang="en">
|
|
6
|
+
|
|
7
|
+
<xs:annotation>
|
|
8
|
+
<xs:documentation>
|
|
9
|
+
See http://www.w3.org/XML/1998/namespace.html and
|
|
10
|
+
http://www.w3.org/TR/REC-xml for information about this namespace.
|
|
11
|
+
</xs:documentation>
|
|
12
|
+
</xs:annotation>
|
|
13
|
+
|
|
14
|
+
<xs:annotation>
|
|
15
|
+
<xs:documentation>
|
|
16
|
+
This schema defines attributes and an attribute group
|
|
17
|
+
suitable for use by schemas wishing to allow xml:base,
|
|
18
|
+
xml:lang or xml:space attributes on elements they define.
|
|
19
|
+
To enable this, such a schema must import this schema
|
|
20
|
+
for the XML namespace, e.g. as follows:
|
|
21
|
+
<schema . . .>
|
|
22
|
+
. . .
|
|
23
|
+
<import namespace="http://www.w3.org/XML/1998/namespace"
|
|
24
|
+
schemaLocation="http://www.w3.org/2001/03/xml.xsd"/>
|
|
25
|
+
|
|
26
|
+
Subsequently, qualified reference to any of the attributes
|
|
27
|
+
or the group defined below will have the desired effect, e.g.
|
|
28
|
+
|
|
29
|
+
<type . . .>
|
|
30
|
+
. . .
|
|
31
|
+
<attributeGroup ref="xml:specialAttrs"/>
|
|
32
|
+
|
|
33
|
+
will define a type which will schema-validate an instance
|
|
34
|
+
element with any of those attributes
|
|
35
|
+
</xs:documentation>
|
|
36
|
+
</xs:annotation>
|
|
37
|
+
|
|
38
|
+
<xs:annotation>
|
|
39
|
+
<xs:documentation>
|
|
40
|
+
In keeping with the XML Schema WG's standard versioning
|
|
41
|
+
policy, this schema document will persist at
|
|
42
|
+
http://www.w3.org/2001/03/xml.xsd.
|
|
43
|
+
At the date of issue it can also be found at
|
|
44
|
+
http://www.w3.org/2001/xml.xsd.
|
|
45
|
+
The schema document at that URI may however change in the future,
|
|
46
|
+
in order to remain compatible with the latest version of XML Schema
|
|
47
|
+
itself. In other words, if the XML Schema namespace changes, the version
|
|
48
|
+
of this document at
|
|
49
|
+
http://www.w3.org/2001/xml.xsd will change
|
|
50
|
+
accordingly; the version at
|
|
51
|
+
http://www.w3.org/2001/03/xml.xsd will not change.
|
|
52
|
+
</xs:documentation>
|
|
53
|
+
</xs:annotation>
|
|
54
|
+
|
|
55
|
+
<xs:attribute name="lang" type="xs:language">
|
|
56
|
+
<xs:annotation>
|
|
57
|
+
<xs:documentation>
|
|
58
|
+
In due course, we should install the relevant ISO 2- and 3-letter
|
|
59
|
+
codes as the enumerated possible values . . .
|
|
60
|
+
</xs:documentation>
|
|
61
|
+
</xs:annotation>
|
|
62
|
+
</xs:attribute>
|
|
63
|
+
|
|
64
|
+
<xs:attribute name="space" default="preserve">
|
|
65
|
+
<xs:simpleType>
|
|
66
|
+
<xs:restriction base="xs:NCName">
|
|
67
|
+
<xs:enumeration value="default"/>
|
|
68
|
+
<xs:enumeration value="preserve"/>
|
|
69
|
+
</xs:restriction>
|
|
70
|
+
</xs:simpleType>
|
|
71
|
+
</xs:attribute>
|
|
72
|
+
|
|
73
|
+
<xs:attribute name="base" type="xs:anyURI">
|
|
74
|
+
<xs:annotation>
|
|
75
|
+
<xs:documentation>
|
|
76
|
+
See http://www.w3.org/TR/xmlbase/ for
|
|
77
|
+
information about this attribute.
|
|
78
|
+
</xs:documentation>
|
|
79
|
+
</xs:annotation>
|
|
80
|
+
</xs:attribute>
|
|
81
|
+
|
|
82
|
+
<xs:attributeGroup name="specialAttrs">
|
|
83
|
+
<xs:attribute ref="xml:base"/>
|
|
84
|
+
<xs:attribute ref="xml:lang"/>
|
|
85
|
+
<xs:attribute ref="xml:space"/>
|
|
86
|
+
</xs:attributeGroup>
|
|
87
|
+
|
|
88
|
+
</xs:schema>
|
|
@@ -4,18 +4,33 @@ import * as path from 'node:path';
|
|
|
4
4
|
import { fileURLToPath } from 'node:url';
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = path.dirname(__filename);
|
|
7
|
-
|
|
7
|
+
let normal = [
|
|
8
8
|
'saml-schema-protocol-2.0.xsd',
|
|
9
|
-
'datatypes.dtd',
|
|
10
9
|
'saml-schema-assertion-2.0.xsd',
|
|
11
10
|
'xmldsig-core-schema.xsd',
|
|
12
|
-
'XMLSchema.dtd',
|
|
13
11
|
'xenc-schema.xsd',
|
|
14
12
|
'saml-schema-metadata-2.0.xsd',
|
|
15
13
|
'saml-schema-ecp-2.0.xsd',
|
|
16
|
-
'saml-schema-dce-2.0.xsd'
|
|
17
|
-
'env.xsd'
|
|
14
|
+
'saml-schema-dce-2.0.xsd'
|
|
18
15
|
];
|
|
16
|
+
let soapSchema = [
|
|
17
|
+
'soap-envelope.xsd',
|
|
18
|
+
'xml.xsd',
|
|
19
|
+
// 2. SOAP核心模式(所有SOAP消息的基础)
|
|
20
|
+
// 3. XML签名模式(SAML签名的前置依赖)
|
|
21
|
+
'xmldsig-core-schema.xsd',
|
|
22
|
+
// 4. XML加密模式(SAML断言加密的前置依赖)
|
|
23
|
+
'xenc-schema.xsd',
|
|
24
|
+
// 5. SAML核心模式(最基础的SAML组件)
|
|
25
|
+
'saml-schema-assertion-2.0.xsd', // 断言定义
|
|
26
|
+
// 6. SAML协议模式(依赖断言模式)
|
|
27
|
+
'saml-schema-protocol-2.0.xsd',
|
|
28
|
+
// 7. SAML扩展模式(依赖核心模式)
|
|
29
|
+
'saml-schema-metadata-2.0.xsd', // 元数据
|
|
30
|
+
'saml-schema-ecp-2.0.xsd', // ECP扩展
|
|
31
|
+
'saml-schema-dce-2.0.xsd' // DCE扩展
|
|
32
|
+
];
|
|
33
|
+
let schemas = normal;
|
|
19
34
|
function detectXXEIndicators(samlString) {
|
|
20
35
|
const xxePatterns = [
|
|
21
36
|
/<!DOCTYPE\s[^>]*>/i,
|
|
@@ -38,14 +53,15 @@ function detectXXEIndicators(samlString) {
|
|
|
38
53
|
});
|
|
39
54
|
return Object.keys(matches).length > 0 ? matches : null;
|
|
40
55
|
}
|
|
41
|
-
export const validate = async (xml) => {
|
|
56
|
+
export const validate = async (xml, isSoap = false) => {
|
|
42
57
|
const indicators = detectXXEIndicators(xml);
|
|
43
58
|
if (indicators) {
|
|
44
|
-
console.
|
|
59
|
+
console.log("----------------------绝对不会是这里---------------------");
|
|
45
60
|
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
46
61
|
}
|
|
62
|
+
schemas = normal;
|
|
47
63
|
const schemaPath = path.resolve(__dirname, 'schema');
|
|
48
|
-
const [
|
|
64
|
+
const [xmlParse, ...preload] = await Promise.all(schemas.map(async (file) => ({
|
|
49
65
|
fileName: file,
|
|
50
66
|
contents: await fs.promises.readFile(`${schemaPath}/${file}`, 'utf-8')
|
|
51
67
|
})));
|
|
@@ -58,17 +74,18 @@ export const validate = async (xml) => {
|
|
|
58
74
|
},
|
|
59
75
|
],
|
|
60
76
|
extension: 'schema',
|
|
61
|
-
schema: [
|
|
62
|
-
preload: preload
|
|
77
|
+
schema: [xmlParse],
|
|
78
|
+
preload: [xmlParse, ...preload],
|
|
63
79
|
});
|
|
64
80
|
if (validationResult.valid) {
|
|
81
|
+
console.log("验证通过-------------------------");
|
|
65
82
|
return true;
|
|
66
83
|
}
|
|
67
|
-
console.debug(validationResult);
|
|
68
84
|
throw validationResult.errors;
|
|
69
85
|
}
|
|
70
86
|
catch (error) {
|
|
71
|
-
console.
|
|
87
|
+
console.log(error);
|
|
88
|
+
console.log("----------------------绝333333333333333333333333对不会是这里---------------------");
|
|
72
89
|
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
73
90
|
}
|
|
74
91
|
};
|
package/build/src/utility.js
CHANGED
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
* @author tngan
|
|
4
4
|
* @desc Library for some common functions (e.g. de/inflation, en/decoding)
|
|
5
5
|
*/
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
6
|
+
import { createPrivateKey, X509Certificate } from 'node:crypto';
|
|
7
|
+
import { deflateRaw, inflateRaw } from 'pako';
|
|
8
8
|
const BASE64_STR = 'base64';
|
|
9
9
|
/**
|
|
10
10
|
* @desc Mimic lodash.zipObject
|
|
@@ -107,11 +107,16 @@ function deflateString(message) {
|
|
|
107
107
|
* @return {string} decompressed string
|
|
108
108
|
*/
|
|
109
109
|
export function inflateString(compressedString) {
|
|
110
|
-
const
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
110
|
+
const base64Encoded = decodeURIComponent(compressedString);
|
|
111
|
+
// 2. Base64解码为Uint8Array
|
|
112
|
+
const binaryStr = atob(base64Encoded) ?? base64Encoded;
|
|
113
|
+
const data = Uint8Array.from(binaryStr, (c) => c.charCodeAt(0));
|
|
114
|
+
try {
|
|
115
|
+
return inflateRaw(data, { to: 'string' });
|
|
116
|
+
}
|
|
117
|
+
catch (e) {
|
|
118
|
+
return e.message;
|
|
119
|
+
}
|
|
115
120
|
}
|
|
116
121
|
/**
|
|
117
122
|
* @desc Abstract the normalizeCerString and normalizePemString
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "samlesa",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "High-level API for Single Sign On (SAML 2.0) baseed on samlify ",
|
|
5
5
|
"main": "build/index.js",
|
|
6
6
|
"keywords": [
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
"docs": "docsify serve -o docs",
|
|
18
18
|
"lint": "tslint -p .",
|
|
19
19
|
"lint:fix": "tslint -p . --fix",
|
|
20
|
-
"
|
|
21
|
-
"test": "
|
|
22
|
-
"coverage": "
|
|
23
|
-
"hooks:postinstall": "
|
|
20
|
+
"test": "vitest",
|
|
21
|
+
"test:watch": "vitest",
|
|
22
|
+
"test:coverage": "vitest run --coverage",
|
|
23
|
+
"hooks:postinstall": "mklink /J .git\\hooks\\pre-commit .pre-commit.sh || copy .pre-commit.sh .git\\hooks\\pre-commit"
|
|
24
24
|
},
|
|
25
25
|
"exports": {
|
|
26
26
|
".": {
|
|
@@ -42,11 +42,15 @@
|
|
|
42
42
|
},
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"dependencies": {
|
|
45
|
-
"@xmldom/xmldom": "^0.8
|
|
45
|
+
"@xmldom/xmldom": "^0.9.8",
|
|
46
46
|
"axios": "^1.10.0",
|
|
47
47
|
"camelcase": "^8.0.0",
|
|
48
|
+
"cross-env": "^7.0.3",
|
|
49
|
+
"node-rsa": "^1.1.1",
|
|
48
50
|
"pako": "^2.1.0",
|
|
51
|
+
"ts-node": "^10.9.2",
|
|
49
52
|
"uuid": "^11.1.0",
|
|
53
|
+
"vite-tsconfig-paths": "^5.1.4",
|
|
50
54
|
"xml": "^1.0.1",
|
|
51
55
|
"xml-crypto": "^6.1.2",
|
|
52
56
|
"xml-encryption": "^3.1.0",
|
|
@@ -59,23 +63,13 @@
|
|
|
59
63
|
"@types/node": "^24.0.10",
|
|
60
64
|
"@types/pako": "2.0.3",
|
|
61
65
|
"@types/uuid": "10.0.0",
|
|
62
|
-
"
|
|
66
|
+
"@vitest/coverage-istanbul": "^3.2.4",
|
|
63
67
|
"copyfiles": "^2.4.1",
|
|
64
68
|
"coveralls": "^3.1.1",
|
|
65
69
|
"esbuild": "^0.25.5",
|
|
66
|
-
"
|
|
70
|
+
"jsdom": "^26.1.0",
|
|
67
71
|
"timekeeper": "^2.3.1",
|
|
68
|
-
"typescript": "5.8.3"
|
|
69
|
-
|
|
70
|
-
"ava": {
|
|
71
|
-
"extensions": [
|
|
72
|
-
"ts"
|
|
73
|
-
],
|
|
74
|
-
"require": [
|
|
75
|
-
"ts-node/register"
|
|
76
|
-
],
|
|
77
|
-
"files": [
|
|
78
|
-
"!**/*.d.ts"
|
|
79
|
-
]
|
|
72
|
+
"typescript": "5.8.3",
|
|
73
|
+
"vitest": "^3.2.4"
|
|
80
74
|
}
|
|
81
75
|
}
|
package/types/src/api.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { DOMParser as dom } from '@xmldom/xmldom';
|
|
2
|
-
import type { Options as DOMParserOptions } from '@xmldom/xmldom';
|
|
3
2
|
interface Context extends ValidatorContext, DOMParserContext {
|
|
4
3
|
}
|
|
4
|
+
type ValidateFunction = (xml: string, isSoap?: boolean) => Promise<any>;
|
|
5
5
|
interface ValidatorContext {
|
|
6
|
-
validate
|
|
6
|
+
validate: ValidateFunction;
|
|
7
7
|
}
|
|
8
8
|
interface DOMParserContext {
|
|
9
9
|
dom: dom;
|
|
10
10
|
}
|
|
11
11
|
export declare function getContext(): Context;
|
|
12
12
|
export declare function setSchemaValidator(params: ValidatorContext): void;
|
|
13
|
-
export declare function setDOMParserOptions(options?:
|
|
13
|
+
export declare function setDOMParserOptions(options?: {}): void;
|
|
14
14
|
export {};
|
|
15
15
|
//# sourceMappingURL=api.d.ts.map
|
package/types/src/api.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../src/api.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,IAAI,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAKlD,UAAU,OAAQ,SAAQ,gBAAgB,EAAE,gBAAgB;CAAG;AAG/D,KAAK,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;AAGxE,UAAU,gBAAgB;IACxB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAED,UAAU,gBAAgB;IACxB,GAAG,EAAE,GAAG,CAAC;CACV;AAOD,wBAAgB,UAAU,IAAG,OAAO,CAEnC;AAED,wBAAgB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,GAAE,IAAI,CAShE;AAED,wBAAgB,mBAAmB,CAAC,OAAO,KAAK,GAAE,IAAI,CAErD"}
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file binding-post.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Binding-level API, declare the functions using POST binding
|
|
5
|
-
*/
|
|
2
|
+
* @file binding-post.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Binding-level API, declare the functions using POST binding
|
|
5
|
+
*/
|
|
6
6
|
import type { BindingContext } from './entity.js';
|
|
7
7
|
/**
|
|
8
|
-
* @desc Generate a base64 encoded login request
|
|
9
|
-
* @param {string} referenceTagXPath reference uri
|
|
10
|
-
* @param {object} entity object includes both idp and sp
|
|
11
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
12
|
-
*/
|
|
8
|
+
* @desc Generate a base64 encoded login request
|
|
9
|
+
* @param {string} referenceTagXPath reference uri
|
|
10
|
+
* @param {object} entity object includes both idp and sp
|
|
11
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
12
|
+
*/
|
|
13
13
|
declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
14
14
|
/**
|
|
15
15
|
* @desc Generate a base64 encoded login response
|
|
@@ -22,21 +22,21 @@ declare function base64LoginRequest(referenceTagXPath: string, entity: any, cust
|
|
|
22
22
|
*/
|
|
23
23
|
declare function base64LoginResponse(requestInfo: any | undefined, entity: any, user?: any, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean, AttributeStatement?: never[]): Promise<BindingContext>;
|
|
24
24
|
/**
|
|
25
|
-
* @desc Generate a base64 encoded logout request
|
|
26
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
27
|
-
* @param {string} referenceTagXPath reference uri
|
|
28
|
-
* @param {object} entity object includes both idp and sp
|
|
29
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
30
|
-
* @return {string} base64 encoded request
|
|
31
|
-
*/
|
|
25
|
+
* @desc Generate a base64 encoded logout request
|
|
26
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
27
|
+
* @param {string} referenceTagXPath reference uri
|
|
28
|
+
* @param {object} entity object includes both idp and sp
|
|
29
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
30
|
+
* @return {string} base64 encoded request
|
|
31
|
+
*/
|
|
32
32
|
declare function base64LogoutRequest(user: Record<string, unknown>, referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
33
33
|
/**
|
|
34
|
-
* @desc Generate a base64 encoded logout response
|
|
35
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
36
|
-
* @param {string} referenceTagXPath reference uri
|
|
37
|
-
* @param {object} entity object includes both idp and sp
|
|
38
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
39
|
-
*/
|
|
34
|
+
* @desc Generate a base64 encoded logout response
|
|
35
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
36
|
+
* @param {string} referenceTagXPath reference uri
|
|
37
|
+
* @param {object} entity object includes both idp and sp
|
|
38
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
39
|
+
*/
|
|
40
40
|
declare function base64LogoutResponse(requestInfo: any, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext;
|
|
41
41
|
declare const postBinding: {
|
|
42
42
|
base64LoginRequest: typeof base64LoginRequest;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-post.d.ts","sourceRoot":"","sources":["../../src/binding-post.ts"],"names":[],"mappings":"AAAA;;;;
|
|
1
|
+
{"version":3,"file":"binding-post.d.ts","sourceRoot":"","sources":["../../src/binding-post.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAMhD;;;;;GAKG;AACH,iBAAS,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CA4D/I;AAED;;;;;;;;GAQG;AACH,iBAAe,mBAAmB,CAAC,WAAW,EAAE,GAAG,YAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,EAAE,eAAe,GAAE,OAAe,EAAE,kBAAkB,UAAK,GAAG,OAAO,CAAC,cAAc,CAAC,CAkJtO;AAED;;;;;;;GAOG;AACH,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAE,MAAM,EAAE,MAAM,KAAA,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CAwD1K;AAED;;;;;;GAMG;AACH,iBAAS,oBAAoB,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CA2DvI;AAED,QAAA,MAAM,WAAW;;;;;CAKhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -18,7 +18,19 @@ export interface BuildRedirectConfig {
|
|
|
18
18
|
declare function loginRequestRedirectURL(entity: {
|
|
19
19
|
idp: Idp;
|
|
20
20
|
sp: Sp;
|
|
21
|
-
|
|
21
|
+
soap?: Boolean;
|
|
22
|
+
}, customTagReplacement?: (template: string) => BindingContext): any;
|
|
23
|
+
/**
|
|
24
|
+
* @desc Redirect URL for login request
|
|
25
|
+
* @param {object} entity object includes both idp and sp
|
|
26
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
27
|
+
* @return {string} redirect URL
|
|
28
|
+
*/
|
|
29
|
+
declare function loginRequestRedirectURLArt(entity: {
|
|
30
|
+
idp: Idp;
|
|
31
|
+
sp: Sp;
|
|
32
|
+
inResponse?: string;
|
|
33
|
+
}, customTagReplacement?: (template: string) => BindingContext): any;
|
|
22
34
|
/**
|
|
23
35
|
* @desc Redirect URL for login response
|
|
24
36
|
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
@@ -45,6 +57,7 @@ declare function logoutRequestRedirectURL(user: any, entity: any, relayState?: s
|
|
|
45
57
|
*/
|
|
46
58
|
declare function logoutResponseRedirectURL(requestInfo: any, entity: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
|
|
47
59
|
declare const redirectBinding: {
|
|
60
|
+
loginRequestRedirectURLArt: typeof loginRequestRedirectURLArt;
|
|
48
61
|
loginRequestRedirectURL: typeof loginRequestRedirectURL;
|
|
49
62
|
loginResponseRedirectURL: typeof loginResponseRedirectURL;
|
|
50
63
|
logoutRequestRedirectURL: typeof logoutRequestRedirectURL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-redirect.d.ts","sourceRoot":"","sources":["../../src/binding-redirect.ts"],"names":[],"mappings":"AAOA,OAAO,KAAK,EAAC,cAAc,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EAAC,gBAAgB,IAAI,GAAG,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,eAAe,iBAAiB,CAAC"}
|
|
@@ -18,14 +18,13 @@ export declare class IdentityProvider extends Entity {
|
|
|
18
18
|
*/
|
|
19
19
|
createLoginResponse(params: {
|
|
20
20
|
sp: ServiceProvider;
|
|
21
|
-
requestInfo
|
|
21
|
+
requestInfo?: Record<string, any>;
|
|
22
22
|
binding?: string;
|
|
23
|
-
user
|
|
23
|
+
user?: Record<string, any>;
|
|
24
24
|
customTagReplacement?: (template: string) => BindingContext;
|
|
25
25
|
encryptThenSign?: boolean;
|
|
26
26
|
relayState?: string;
|
|
27
|
-
|
|
28
|
-
AttributeStatement: [];
|
|
27
|
+
AttributeStatement?: [];
|
|
29
28
|
}): Promise<any>;
|
|
30
29
|
/**
|
|
31
30
|
* Validation of the parsed URL parameters
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-idp.d.ts","sourceRoot":"","sources":["../../src/entity-idp.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,EAAE,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,0BAA0B,IAAI,eAAe,EAE7C,wBAAwB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAQ,KAAK,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"entity-idp.d.ts","sourceRoot":"","sources":["../../src/entity-idp.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,EAAE,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,0BAA0B,IAAI,eAAe,EAE7C,wBAAwB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAM,WAAW,CAAC;AAElD,OAAO,KAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,wBAAwB,oBAEtD;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,MAAM;IAElC,UAAU,EAAE,wBAAwB,CAAC;gBAEjC,UAAU,EAAE,wBAAwB;IAWhD;;;OAGG;IACU,mBAAmB,CAAC,MAAM,EAAC;QACtC,EAAE,EAAE,eAAe,CAAC;QACpB,WAAW,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAClC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC3B,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,CAAC;QAC5D,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,kBAAkB,CAAC,EAAC,EAAE,CAAA;KACvB;IAsCD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB;CAY9E"}
|
package/types/src/entity-sp.d.ts
CHANGED
|
@@ -1,38 +1,45 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @file entity-sp.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Declares the actions taken by service provider
|
|
5
|
-
*/
|
|
2
|
+
* @file entity-sp.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Declares the actions taken by service provider
|
|
5
|
+
*/
|
|
6
6
|
import Entity from './entity.js';
|
|
7
7
|
import type { BindingContext, PostBindingContext, ESamlHttpRequest, SimpleSignBindingContext } from './entity.js';
|
|
8
8
|
import { IdentityProviderConstructor as IdentityProvider, ServiceProviderMetadata, type ServiceProviderSettings } from './types.js';
|
|
9
9
|
import { type FlowResult } from './flow.js';
|
|
10
10
|
export default function (props: ServiceProviderSettings): ServiceProvider;
|
|
11
11
|
/**
|
|
12
|
-
* @desc Service provider can be configured using either metadata importing or spSetting
|
|
13
|
-
* @param {object} spSettingimport { FlowResult } from '../types/src/flow.d';
|
|
12
|
+
* @desc Service provider can be configured using either metadata importing or spSetting
|
|
13
|
+
* @param {object} spSettingimport { FlowResult } from '../types/src/flow.d';
|
|
14
14
|
|
|
15
|
-
*/
|
|
15
|
+
*/
|
|
16
16
|
export declare class ServiceProvider extends Entity {
|
|
17
17
|
entityMeta: ServiceProviderMetadata;
|
|
18
18
|
/**
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
* @desc Inherited from Entity
|
|
20
|
+
* @param {object} spSetting setting of service provider
|
|
21
|
+
*/
|
|
22
22
|
constructor(spSetting: ServiceProviderSettings);
|
|
23
23
|
/**
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
24
|
+
* @desc Generates the login request for developers to design their own method
|
|
25
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
26
|
+
* @param {string} binding protocol binding
|
|
27
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
28
|
+
*/
|
|
29
29
|
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext | SimpleSignBindingContext;
|
|
30
30
|
/**
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
31
|
+
* @desc Generates the Art login request for developers to design their own method
|
|
32
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
33
|
+
* @param {string} binding protocol binding
|
|
34
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
35
|
+
*/
|
|
36
|
+
createLoginRequestArt(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext | SimpleSignBindingContext;
|
|
37
|
+
/**
|
|
38
|
+
* @desc Validation of the parsed the URL parameters
|
|
39
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
40
|
+
* @param {string} binding protocol binding
|
|
41
|
+
* @param {request} req request
|
|
42
|
+
*/
|
|
36
43
|
parseLoginResponse(idp: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
37
44
|
/**
|
|
38
45
|
* @desc request SamlResponse by Arc id
|
|
@@ -40,6 +47,22 @@ export declare class ServiceProvider extends Entity {
|
|
|
40
47
|
* @param {string} binding protocol binding
|
|
41
48
|
* @param {request} req request
|
|
42
49
|
*/
|
|
43
|
-
|
|
50
|
+
parseLoginResponseArt(idp: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
51
|
+
/**
|
|
52
|
+
* @desc generate Art id
|
|
53
|
+
*
|
|
54
|
+
* @param entityIDString
|
|
55
|
+
*/
|
|
56
|
+
createArt(entityIDString: string, endpointIndex?: number): string;
|
|
57
|
+
/**
|
|
58
|
+
* @desc generate Art id
|
|
59
|
+
* @param artifact
|
|
60
|
+
*/
|
|
61
|
+
parseArt(artifact: string): {
|
|
62
|
+
typeCode: number;
|
|
63
|
+
endpointIndex: number;
|
|
64
|
+
sourceId: string;
|
|
65
|
+
messageHandle: string;
|
|
66
|
+
};
|
|
44
67
|
}
|
|
45
68
|
//# sourceMappingURL=entity-sp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-sp.d.ts","sourceRoot":"","sources":["../../src/entity-sp.ts"],"names":[],"mappings":"AAAA;;;;
|
|
1
|
+
{"version":3,"file":"entity-sp.d.ts","sourceRoot":"","sources":["../../src/entity-sp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAU,MAAM,aAAa,CAAC;AAErC,OAAO,KAAK,EACR,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EAC3B,MAAM,aAAa,CAAC;AACrB,OAAO,EACH,2BAA2B,IAAI,gBAAgB,EAC/C,uBAAuB,EACvB,KAAK,uBAAuB,EAC/B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAO,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAKhD,MAAM,CAAC,OAAO,WA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