samlesa 4.3.1 → 4.3.3
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/build/src/binding-redirect.js +4 -1
- package/build/src/binding-simplesign.js +4 -1
- package/build/src/entity-sp.js +2 -1
- package/build/src/entity.js +6 -0
- package/build/src/flow.js +8 -2
- package/build/src/libsaml.js +71 -12
- package/build/src/metadata-idp.js +4 -1
- package/build/src/metadata-sp.js +138 -167
- package/build/src/schemaValidator.js +64 -125
- package/package.json +87 -87
- package/types/src/binding-redirect.d.ts.map +1 -1
- package/types/src/binding-simplesign.d.ts.map +1 -1
- package/types/src/entity-sp.d.ts.map +1 -1
- package/types/src/entity.d.ts.map +1 -1
- package/types/src/flow.d.ts.map +1 -1
- package/types/src/libsaml.d.ts +10 -4
- package/types/src/libsaml.d.ts.map +1 -1
- package/types/src/metadata-idp.d.ts.map +1 -1
- package/types/src/metadata-sp.d.ts +8 -1
- package/types/src/metadata-sp.d.ts.map +1 -1
- package/types/src/schemaValidator.d.ts +1 -15
- package/types/src/schemaValidator.d.ts.map +1 -1
- package/types/src/types.d.ts +8 -0
- package/types/src/types.d.ts.map +1 -1
|
@@ -5,7 +5,6 @@ import { fileURLToPath } from 'node:url';
|
|
|
5
5
|
import { DOMParser } from '@xmldom/xmldom';
|
|
6
6
|
const __filename = fileURLToPath(import.meta.url);
|
|
7
7
|
const __dirname = path.dirname(__filename);
|
|
8
|
-
// 定义各个场景所需的 schema 文件列表(保持不变)
|
|
9
8
|
const normalSchemas = [
|
|
10
9
|
'saml-schema-protocol-2.0.xsd',
|
|
11
10
|
'saml-schema-assertion-2.0.xsd',
|
|
@@ -14,7 +13,7 @@ const normalSchemas = [
|
|
|
14
13
|
'xenc-schema-11.xsd',
|
|
15
14
|
'saml-schema-metadata-2.0.xsd',
|
|
16
15
|
'saml-schema-ecp-2.0.xsd',
|
|
17
|
-
'saml-schema-dce-2.0.xsd'
|
|
16
|
+
'saml-schema-dce-2.0.xsd',
|
|
18
17
|
];
|
|
19
18
|
const soapSchemas = [
|
|
20
19
|
'soap-envelope.xsd',
|
|
@@ -26,7 +25,7 @@ const soapSchemas = [
|
|
|
26
25
|
'saml-schema-protocol-2.0.xsd',
|
|
27
26
|
'saml-schema-metadata-2.0.xsd',
|
|
28
27
|
'saml-schema-ecp-2.0.xsd',
|
|
29
|
-
'saml-schema-dce-2.0.xsd'
|
|
28
|
+
'saml-schema-dce-2.0.xsd',
|
|
30
29
|
];
|
|
31
30
|
const metadataSchemas = [
|
|
32
31
|
'saml-schema-metadata-2.0.xsd',
|
|
@@ -34,169 +33,109 @@ const metadataSchemas = [
|
|
|
34
33
|
'saml-schema-assertion-2.0.xsd',
|
|
35
34
|
'xmldsig-core-schema.xsd',
|
|
36
35
|
'xenc-schema.xsd',
|
|
37
|
-
'xenc-schema-11.xsd'
|
|
36
|
+
'xenc-schema-11.xsd',
|
|
38
37
|
];
|
|
39
|
-
/**
|
|
40
|
-
* 检测 XML 字符串中是否存在 XXE 攻击指示器
|
|
41
|
-
* @param samlString 待检测的 XML 字符串
|
|
42
|
-
* @returns 如果存在可疑模式则返回匹配详情,否则返回 null
|
|
43
|
-
*/
|
|
44
|
-
/**
|
|
45
|
-
* 检测SAML字符串中可能的XXE攻击模式
|
|
46
|
-
* @param samlString - 要检查的SAML字符串
|
|
47
|
-
* @returns 包含发现的潜在XXE模式的对象,如果没有发现则返回null
|
|
48
|
-
*/
|
|
49
38
|
function detectXXEIndicators(samlString) {
|
|
50
|
-
// 更全面的XXE模式检测
|
|
51
39
|
const xxePatterns = [
|
|
52
|
-
|
|
53
|
-
/<!
|
|
54
|
-
|
|
55
|
-
/<!ENTITY\s+([a-zA-Z_][a-zA-Z0-9]*)\s+(SYSTEM|PUBLIC)\s+["'][^"']*["']\s*>/gi,
|
|
56
|
-
// file://协议引用
|
|
57
|
-
/SYSTEM\s+["']file:\/\/\/?([^"']+)["']/gi,
|
|
58
|
-
// HTTP/HTTPS外部实体
|
|
59
|
-
/SYSTEM\s+["'](https?:\/\/[^"']+)["']/gi,
|
|
60
|
-
// 本地文件引用
|
|
61
|
-
/SYSTEM\s+["'](\.\.\/|\/)[^"']*\.dtd["']/gi,
|
|
62
|
-
// 内部实体引用(可能用于Billion Laughs攻击)
|
|
63
|
-
/<!ENTITY\s+([a-zA-Z_][a-zA-Z0-9]*)\s+"?\1"?/gi,
|
|
64
|
-
// CDATA节中的恶意内容
|
|
65
|
-
/<!\[CDATA\[(.*?)\]\]>/gi,
|
|
66
|
-
// 注释中的潜在恶意内容
|
|
67
|
-
/<!--(.*?)-->/gi
|
|
40
|
+
/<!DOCTYPE\b[^>]*>/gi,
|
|
41
|
+
/<!ENTITY\b[^>]*>/gi,
|
|
42
|
+
/\b(SYSTEM|PUBLIC)\b\s+["'][^"']+["']/gi,
|
|
68
43
|
];
|
|
69
44
|
const patternNames = [
|
|
70
45
|
'DOCTYPE Declaration',
|
|
71
|
-
'
|
|
72
|
-
'
|
|
73
|
-
'HTTP External Entity',
|
|
74
|
-
'Local File Reference',
|
|
75
|
-
'Recursive Entity Reference',
|
|
76
|
-
'CDATA Section',
|
|
77
|
-
'Comment Section'
|
|
46
|
+
'Entity Declaration',
|
|
47
|
+
'External Entity Reference',
|
|
78
48
|
];
|
|
79
49
|
const matches = {};
|
|
80
50
|
xxePatterns.forEach((pattern, index) => {
|
|
81
|
-
// 重置正则表达式的lastIndex以便多次使用
|
|
82
51
|
pattern.lastIndex = 0;
|
|
83
52
|
const found = samlString.match(pattern);
|
|
84
53
|
if (found) {
|
|
85
54
|
matches[patternNames[index]] = {
|
|
86
55
|
pattern: pattern.toString(),
|
|
87
56
|
matches: found,
|
|
88
|
-
description: patternNames[index]
|
|
57
|
+
description: patternNames[index],
|
|
89
58
|
};
|
|
90
59
|
}
|
|
91
60
|
});
|
|
92
61
|
return Object.keys(matches).length > 0 ? matches : null;
|
|
93
62
|
}
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
63
|
+
function assertSafeXmlParse(xml) {
|
|
64
|
+
const parser = new DOMParser();
|
|
65
|
+
const xmlDoc = parser.parseFromString(xml, 'text/xml');
|
|
66
|
+
const parserError = xmlDoc.getElementsByTagName('parsererror');
|
|
67
|
+
if (parserError.length > 0 || xmlDoc.doctype) {
|
|
68
|
+
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
99
71
|
async function loadSchemas(schemaNames) {
|
|
100
72
|
const schemaPath = path.resolve(__dirname, 'schema');
|
|
101
73
|
return Promise.all(schemaNames.map(async (file) => ({
|
|
102
74
|
fileName: file,
|
|
103
|
-
contents: await fs.promises.readFile(`${schemaPath}/${file}`, 'utf-8')
|
|
75
|
+
contents: await fs.promises.readFile(`${schemaPath}/${file}`, 'utf-8'),
|
|
104
76
|
})));
|
|
105
77
|
}
|
|
106
|
-
/**
|
|
107
|
-
* 验证 SAML 消息(普通或 SOAP)
|
|
108
|
-
* @param xml XML 字符串
|
|
109
|
-
* @param isSoap 是否为 SOAP 消息,默认 false
|
|
110
|
-
* @returns true 表示验证通过,否则抛出错误
|
|
111
|
-
* @throws 当检测到 XXE 或验证失败时抛出错误
|
|
112
|
-
*/
|
|
113
78
|
export const validate = async (xml, isSoap = false) => {
|
|
114
|
-
// 检测 XXE 攻击
|
|
115
79
|
const indicators = detectXXEIndicators(xml);
|
|
116
80
|
if (indicators) {
|
|
117
81
|
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
118
82
|
}
|
|
119
|
-
|
|
83
|
+
assertSafeXmlParse(xml);
|
|
120
84
|
const schemaList = isSoap ? soapSchemas : normalSchemas;
|
|
121
85
|
const schemas = await loadSchemas(schemaList);
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
return true;
|
|
131
|
-
}
|
|
132
|
-
// 验证失败,抛出错误对象
|
|
133
|
-
throw validationResult.errors;
|
|
134
|
-
}
|
|
135
|
-
catch (error) {
|
|
136
|
-
// 保留原始错误信息
|
|
137
|
-
throw error;
|
|
86
|
+
const validationResult = await validateXML({
|
|
87
|
+
xml: [{ fileName: 'content.xml', contents: xml }],
|
|
88
|
+
extension: 'schema',
|
|
89
|
+
schema: [schemas[0]],
|
|
90
|
+
preload: [schemas[0], ...schemas.slice(1)],
|
|
91
|
+
});
|
|
92
|
+
if (validationResult.valid) {
|
|
93
|
+
return true;
|
|
138
94
|
}
|
|
95
|
+
throw validationResult.errors;
|
|
139
96
|
};
|
|
140
|
-
/**
|
|
141
|
-
* 验证 SAML 元数据,并可选择解析元数据类型
|
|
142
|
-
* @param xml XML 字符串
|
|
143
|
-
* @param isParse 是否解析并返回元数据类型,默认 false
|
|
144
|
-
* @returns 验证通过时:若 isParse 为 true 返回 { isValid: true, metadataType: string },否则返回 true;
|
|
145
|
-
* 验证失败时返回 Error 对象(保持原行为)
|
|
146
|
-
*/
|
|
147
97
|
export const validateMetadata = async (xml, isParse = false) => {
|
|
148
|
-
// 检测 XXE 攻击
|
|
149
98
|
const indicators = detectXXEIndicators(xml);
|
|
150
99
|
if (indicators) {
|
|
151
100
|
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
152
101
|
}
|
|
102
|
+
assertSafeXmlParse(xml);
|
|
153
103
|
const schemas = await loadSchemas(metadataSchemas);
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
metadataType = 'SP';
|
|
184
|
-
}
|
|
185
|
-
else {
|
|
186
|
-
metadataType = 'unknown';
|
|
187
|
-
}
|
|
188
|
-
return {
|
|
189
|
-
isValid: true,
|
|
190
|
-
metadataType
|
|
191
|
-
};
|
|
192
|
-
}
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
// 验证失败,返回错误对象(保持原行为)
|
|
196
|
-
return validationResult.errors;
|
|
104
|
+
const validationResult = await validateXML({
|
|
105
|
+
xml: [{ fileName: 'content.xml', contents: xml }],
|
|
106
|
+
extension: 'schema',
|
|
107
|
+
schema: [schemas[0]],
|
|
108
|
+
preload: [schemas[0], ...schemas.slice(1)],
|
|
109
|
+
});
|
|
110
|
+
if (!validationResult.valid) {
|
|
111
|
+
throw validationResult.errors;
|
|
112
|
+
}
|
|
113
|
+
if (!isParse) {
|
|
114
|
+
return true;
|
|
115
|
+
}
|
|
116
|
+
const parser = new DOMParser();
|
|
117
|
+
const xmlDoc = parser.parseFromString(xml, 'text/xml');
|
|
118
|
+
const parserError = xmlDoc.getElementsByTagName('parsererror');
|
|
119
|
+
if (parserError.length > 0 || xmlDoc.doctype) {
|
|
120
|
+
throw new Error('ERR_EXCEPTION_VALIDATE_XML');
|
|
121
|
+
}
|
|
122
|
+
const idpDescriptor = xmlDoc.getElementsByTagNameNS('urn:oasis:names:tc:SAML:2.0:metadata', 'IDPSSODescriptor');
|
|
123
|
+
const spDescriptor = xmlDoc.getElementsByTagNameNS('urn:oasis:names:tc:SAML:2.0:metadata', 'SPSSODescriptor');
|
|
124
|
+
let metadataType;
|
|
125
|
+
if (idpDescriptor.length > 0 && spDescriptor.length > 0) {
|
|
126
|
+
metadataType = 'both';
|
|
127
|
+
}
|
|
128
|
+
else if (idpDescriptor.length > 0) {
|
|
129
|
+
metadataType = 'IdP';
|
|
130
|
+
}
|
|
131
|
+
else if (spDescriptor.length > 0) {
|
|
132
|
+
metadataType = 'SP';
|
|
197
133
|
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
return error instanceof Error ? error : new Error(String(error));
|
|
134
|
+
else {
|
|
135
|
+
metadataType = 'unknown';
|
|
201
136
|
}
|
|
137
|
+
return {
|
|
138
|
+
isValid: true,
|
|
139
|
+
metadataType,
|
|
140
|
+
};
|
|
202
141
|
};
|
package/package.json
CHANGED
|
@@ -1,87 +1,87 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "samlesa",
|
|
3
|
-
"version": "4.3.
|
|
4
|
-
"description": "High-level API for Single Sign On (SAML 2.0) baseed on samlify ",
|
|
5
|
-
"main": "build/index.js",
|
|
6
|
-
"keywords": [
|
|
7
|
-
"nodejs",
|
|
8
|
-
"saml2",
|
|
9
|
-
"sso",
|
|
10
|
-
"slo",
|
|
11
|
-
"metadata"
|
|
12
|
-
],
|
|
13
|
-
"type": "module",
|
|
14
|
-
"typings": "types/index.d.ts",
|
|
15
|
-
"homepage": "https://saml.veclea.com",
|
|
16
|
-
"
|
|
17
|
-
"
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
"
|
|
24
|
-
"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
"
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
},
|
|
34
|
-
"
|
|
35
|
-
"
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
"
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
"
|
|
50
|
-
"
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
"
|
|
54
|
-
},
|
|
55
|
-
"
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
"@
|
|
59
|
-
"
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
"
|
|
75
|
-
"
|
|
76
|
-
"
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
"
|
|
80
|
-
"
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"
|
|
84
|
-
"
|
|
85
|
-
"
|
|
86
|
-
}
|
|
87
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "samlesa",
|
|
3
|
+
"version": "4.3.3",
|
|
4
|
+
"description": "High-level API for Single Sign On (SAML 2.0) baseed on samlify ",
|
|
5
|
+
"main": "build/index.js",
|
|
6
|
+
"keywords": [
|
|
7
|
+
"nodejs",
|
|
8
|
+
"saml2",
|
|
9
|
+
"sso",
|
|
10
|
+
"slo",
|
|
11
|
+
"metadata"
|
|
12
|
+
],
|
|
13
|
+
"type": "module",
|
|
14
|
+
"typings": "types/index.d.ts",
|
|
15
|
+
"homepage": "https://saml.veclea.com",
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc && copyfiles -u 1 src/schema/**/* build/src",
|
|
18
|
+
"build:fast": "tsc",
|
|
19
|
+
"build:clean": "tsc --build --clean && pnpm run build",
|
|
20
|
+
"docs:dev": "cd docs && npm run docs:dev",
|
|
21
|
+
"docs:build": "cd docs && npm run docs:build",
|
|
22
|
+
"docs:preview": "cd docs && npm run docs:preview",
|
|
23
|
+
"docs:deploy": "vercel --prod",
|
|
24
|
+
"lint": "tslint -p .",
|
|
25
|
+
"lint:fix": "tslint -p . --fix",
|
|
26
|
+
"test": "vitest run",
|
|
27
|
+
"test:watch": "vitest",
|
|
28
|
+
"test:coverage": "vitest run --coverage",
|
|
29
|
+
"test:fast": "vitest run --pool=forks",
|
|
30
|
+
"test:artifact": "vitest run test/artifact.test.ts",
|
|
31
|
+
"generate-certs": "node scripts/generate-certs.js",
|
|
32
|
+
"hooks:postinstall": "mklink /J .git\\hooks\\pre-commit .pre-commit.sh || copy .pre-commit.sh .git\\hooks\\pre-commit"
|
|
33
|
+
},
|
|
34
|
+
"exports": {
|
|
35
|
+
".": {
|
|
36
|
+
"types": "./types/index.d.ts",
|
|
37
|
+
"import": "./build/index.js"
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"files": [
|
|
41
|
+
"build",
|
|
42
|
+
"types"
|
|
43
|
+
],
|
|
44
|
+
"contributors": [
|
|
45
|
+
"Veclea <vemocle@gmail.com>"
|
|
46
|
+
],
|
|
47
|
+
"author": "Veclea",
|
|
48
|
+
"repository": {
|
|
49
|
+
"url": "https://github.com/Veclea/samlify.git",
|
|
50
|
+
"type": "git"
|
|
51
|
+
},
|
|
52
|
+
"bugs": {
|
|
53
|
+
"url": "https://github.com/Veclea/samlify/issues"
|
|
54
|
+
},
|
|
55
|
+
"docs": "https://saml.veclea.com",
|
|
56
|
+
"license": "MIT",
|
|
57
|
+
"dependencies": {
|
|
58
|
+
"@xmldom/xmldom": "^0.9.8",
|
|
59
|
+
"axios": "^1.13.6",
|
|
60
|
+
"camelcase": "^9.0.0",
|
|
61
|
+
"cross-env": "^10.1.0",
|
|
62
|
+
"iconv-lite": "^0.7.2",
|
|
63
|
+
"ts-node": "^10.9.2",
|
|
64
|
+
"vite-tsconfig-paths": "^6.1.1",
|
|
65
|
+
"xml": "^1.0.1",
|
|
66
|
+
"xml-crypto-next": "^8.0.0",
|
|
67
|
+
"xml-encryption-next": "^5.0.0",
|
|
68
|
+
"xml-escape": "^1.1.0",
|
|
69
|
+
"xml2js": "^0.6.2",
|
|
70
|
+
"xmllint-wasm": "^5.2.0",
|
|
71
|
+
"xpath": "^0.0.34"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/node": "^25.5.0",
|
|
75
|
+
"@types/pako": "2.0.4",
|
|
76
|
+
"@types/uuid": "11.0.0",
|
|
77
|
+
"@vitest/coverage-istanbul": "^4.1.2",
|
|
78
|
+
"@vitest/coverage-v8": "4.1.2",
|
|
79
|
+
"copyfiles": "^2.4.1",
|
|
80
|
+
"coveralls": "^3.1.1",
|
|
81
|
+
"esbuild": "^0.27.4",
|
|
82
|
+
"jsdom": "^29.0.1",
|
|
83
|
+
"timekeeper": "^2.3.1",
|
|
84
|
+
"typescript": "6.0.2",
|
|
85
|
+
"vitest": "^4.1.2"
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -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,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,eAAe,IAAI,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAQrD,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,GAAG,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACvB;
|
|
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,EAAC,MAAM,iBAAiB,CAAC;AACxD,OAAO,EAAC,eAAe,IAAI,EAAE,EAAC,MAAM,gBAAgB,CAAC;AAQrD,MAAM,WAAW,mBAAmB;IAChC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,GAA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;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding-simplesign.d.ts","sourceRoot":"","sources":["../../src/binding-simplesign.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AAGF,OAAQ,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAO9E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,GAAG,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;
|
|
1
|
+
{"version":3,"file":"binding-simplesign.d.ts","sourceRoot":"","sources":["../../src/binding-simplesign.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AAGF,OAAQ,KAAK,EAAE,cAAc,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAC;AAO9E,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,aAAa,EAAE,GAAG,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,EAAE,MAAM,CAAC;IAChB,SAAS,EAAE,GAAG,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAChB;AAiDD;;;;;EAKE;AACF,iBAAS,kBAAkB,CAAC,MAAM,EAAE,GAAG,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,yBAAyB,CAkD/H;AACD;;;;;;;;GAQG;AACH,iBAAe,mBAAmB,CAAC,WAAW,EAAE,GAAG,YAAK,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,EAAE,kBAAkB,GAAC,EAAO,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAkGtO;AAED,QAAA,MAAM,iBAAiB;;;CAGpB,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"entity-sp.d.ts","sourceRoot":"","sources":["../../src/entity-sp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AACrB,OAAO,EACL,2BAA2B,IAAI,gBAAgB,EAC/C,uBAAuB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAO,KAAK,UAAU,EAAC,MAAM,WAAW,CAAC;AAKhD,MAAM,CAAC,OAAO,WAAW,KAAK,EAAE,uBAAuB,mBAEtD;AAED;;;GAGG;AACH,qBAAa,eAAgB,SAAQ,MAAM;IACjC,UAAU,EAAE,uBAAuB,CAAC;IAE5C;;;OAGG;gBACS,SAAS,EAAE,uBAAuB;IAS9C;;;;;OAKG;IACI,kBAAkB,CACrB,GAAG,EAAE,gBAAgB,EACrB,OAAO,SAAa,EACpB,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAC5D,cAAc,GAAG,kBAAkB,GAAG,wBAAwB;
|
|
1
|
+
{"version":3,"file":"entity-sp.d.ts","sourceRoot":"","sources":["../../src/entity-sp.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,MAAM,MAAM,aAAa,CAAC;AAEjC,OAAO,KAAK,EACV,cAAc,EACd,kBAAkB,EA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pB,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,kBAAkB,CAAC;KACpF,GAAG,OAAO,CAAC,cAAc,GAAG,kBAAkB,CAAC;IAyBlD;;;;;;MAME;IACF,kBAAkB,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,EAAE,OAAO,EAAE,gBAAgB;IAY3D;;;;;;MAME;IACF,mBAAmB,CAAC,IAAI,KAAA,EAAE,OAAO,KAAA,EAAE,OAAO,EAAE,gBAAgB;CAY7D"}
|
package/types/src/flow.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/flow.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,UAAU;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/flow.ts"],"names":[],"mappings":"AAuBA,MAAM,WAAW,UAAU;IACvB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAosBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CA8BhG;AAED,wBAAgB,IAAI,CAAC,OAAO,KAAA,GAAG,OAAO,CAAC,UAAU,CAAC,CA0BjD"}
|
package/types/src/libsaml.d.ts
CHANGED
|
@@ -21,6 +21,12 @@ export interface SignatureVerifierOptions {
|
|
|
21
21
|
metadata?: MetadataInterface;
|
|
22
22
|
keyFile?: string;
|
|
23
23
|
signatureAlgorithm?: string;
|
|
24
|
+
strictSecurity?: boolean;
|
|
25
|
+
allowLegacySha1?: boolean;
|
|
26
|
+
}
|
|
27
|
+
export interface SignatureSecurityOptions {
|
|
28
|
+
strictSecurity?: boolean;
|
|
29
|
+
allowLegacySha1?: boolean;
|
|
24
30
|
}
|
|
25
31
|
export interface ExtractorResult {
|
|
26
32
|
[key: string]: any;
|
|
@@ -71,8 +77,8 @@ export interface LibSamlInterface {
|
|
|
71
77
|
constructSAMLSignature: (opts: SignatureConstructor) => string;
|
|
72
78
|
verifySignature: (xml: string, opts: SignatureVerifierOptions) => [boolean, any];
|
|
73
79
|
createKeySection: (use: KeyUse, cert: string | Buffer) => {};
|
|
74
|
-
constructMessageSignature: (octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string) => string;
|
|
75
|
-
verifyMessageSignature: (metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string) => boolean;
|
|
80
|
+
constructMessageSignature: (octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string, securityOptions?: SignatureSecurityOptions) => string;
|
|
81
|
+
verifyMessageSignature: (metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string, securityOptions?: SignatureSecurityOptions) => boolean;
|
|
76
82
|
getKeyInfo: (x509Certificate: string, signatureConfig?: any) => void;
|
|
77
83
|
encryptAssertion: (sourceEntity: any, targetEntity: any, entireXML: string) => Promise<string>;
|
|
78
84
|
decryptAssertion: (here: any, entireXML: string) => Promise<[string, any]>;
|
|
@@ -217,7 +223,7 @@ declare const _default: {
|
|
|
217
223
|
* @param signingAlgorithm - 签名算法 (默认 'rsa-sha256')
|
|
218
224
|
* @returns 消息签名
|
|
219
225
|
*/
|
|
220
|
-
constructMessageSignature(octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string): string | Buffer;
|
|
226
|
+
constructMessageSignature(octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string, securityOptions?: SignatureSecurityOptions): string | Buffer;
|
|
221
227
|
/**
|
|
222
228
|
* @desc Verifies message signature
|
|
223
229
|
* @param {Metadata} metadata metadata object of identity provider or service provider
|
|
@@ -226,7 +232,7 @@ declare const _default: {
|
|
|
226
232
|
* @param {string} verifyAlgorithm algorithm used to verify
|
|
227
233
|
* @return {boolean} verification result
|
|
228
234
|
*/
|
|
229
|
-
verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string): boolean;
|
|
235
|
+
verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string, securityOptions?: SignatureSecurityOptions): boolean;
|
|
230
236
|
/**
|
|
231
237
|
* @desc Get the public key in string format
|
|
232
238
|
* @param {string} x509Certificate certificate
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"libsaml.d.ts","sourceRoot":"","sources":["../../src/libsaml.ts"],"names":[],"mappings":"AAQA,OAAQ,KAAK,MAAM,MAAM,aAAa,CAAA;AAItC,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAoBrD;;;;GAIG;AAGH,MAAM,WAAW,oBAAoB;IACnC,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,GAAG,MAAM,CAAC;IAC7B,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,eAAe,CAAC,EAAE,GAAG,CAAC;IACtB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAC;CACrC;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,CAAC,EAAE,iBAAiB,CAAC;IAC7B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"libsaml.d.ts","sourceRoot":"","sources":["../../src/libsaml.ts"],"names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MAAM,eACE,MAAM,aACR,OAAO,qBACC,MAAM,oBACP,wBAAwB,GAC3C,MAAM,GAAG,MAAM;IAyBd;;;;;;;OAOG;qCAES,GAAG,eACF,MAAM,aACR,MAAM,GAAG,MAAM,oBACR,MAAM,oBACN,wBAAwB;IAmB5C;;;;SAIK;gCACyB,MAAM,oBAAmB,GAAG;;;;IAWxD;;;;;;OAMG;iEAEgD,MAAM;IA2DzD;;OAEG;IACH;;OAEG;gDAC0C,MAAM,SAAS,wBAAwB;;;;;;IAiHpF;;;;;OAKG;+BAC8B,GAAG,aAAa,MAAM,GAAG,OAAO,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IA8EnF;;OAEG;sBACqB,MAAM,SAAQ,OAAO;;AA8BjD,wBAAyB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-idp.d.ts","sourceRoot":"","sources":["../../src/metadata-idp.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,QAAQ,EAAE,EAAE,KAAM,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAQ,KAAK,EAAsB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAM9E,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;CAE9D;AAKD,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,sBAAsB,eAEnD;AAED,qBAAa,WAAY,SAAQ,QAAQ;
|
|
1
|
+
{"version":3,"file":"metadata-idp.d.ts","sourceRoot":"","sources":["../../src/metadata-idp.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,QAAQ,EAAE,EAAE,KAAM,iBAAiB,EAAE,MAAM,eAAe,CAAC;AAClE,OAAQ,KAAK,EAAsB,sBAAsB,EAAE,MAAM,YAAY,CAAC;AAM9E,MAAM,WAAW,oBAAqB,SAAQ,iBAAiB;CAE9D;AAKD,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,sBAAsB,eAEnD;AAED,qBAAa,WAAY,SAAQ,QAAQ;gBAC3B,IAAI,EAAE,sBAAsB;IAuHxC;;;MAGE;IACF,yBAAyB,IAAI,OAAO;IAQpC;;;;MAIE;IACF,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;IAUxD;;;;OAIG;IACH,4BAA4B,CAAE,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;CAUhE"}
|
|
@@ -7,6 +7,11 @@ import Metadata, { type MetadataInterface } from './metadata.js';
|
|
|
7
7
|
import type { MetadataSpConstructor } from './types.js';
|
|
8
8
|
export interface SpMetadataInterface extends MetadataInterface {
|
|
9
9
|
}
|
|
10
|
+
type AcsSelectionMode = 'strict' | 'lenient';
|
|
11
|
+
interface AcsSelectionOptions {
|
|
12
|
+
mode?: AcsSelectionMode;
|
|
13
|
+
assertionConsumerServiceIndex?: string | number | null;
|
|
14
|
+
}
|
|
10
15
|
export default function (meta: MetadataSpConstructor): SpMetadata;
|
|
11
16
|
/**
|
|
12
17
|
* @desc SP Metadata is for creating Service Provider, provides a set of API to manage the actions in SP.
|
|
@@ -32,6 +37,8 @@ export declare class SpMetadata extends Metadata {
|
|
|
32
37
|
* @param {string} binding protocol binding (e.g. redirect, post)
|
|
33
38
|
* @return {string/[string]} URL of endpoint(s)
|
|
34
39
|
*/
|
|
35
|
-
getAssertionConsumerService(binding
|
|
40
|
+
getAssertionConsumerService(binding?: string): string;
|
|
41
|
+
getAssertionConsumerService(binding: string | undefined, options: AcsSelectionOptions): string;
|
|
36
42
|
}
|
|
43
|
+
export {};
|
|
37
44
|
//# sourceMappingURL=metadata-sp.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"metadata-sp.d.ts","sourceRoot":"","sources":["../../src/metadata-sp.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,QAAQ,EAAE,EAAC,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAMxD,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;CAE7D;
|
|
1
|
+
{"version":3,"file":"metadata-sp.d.ts","sourceRoot":"","sources":["../../src/metadata-sp.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,QAAQ,EAAE,EAAC,KAAK,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAE/D,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAMxD,MAAM,WAAW,mBAAoB,SAAQ,iBAAiB;CAE7D;AAYD,KAAK,gBAAgB,GAAG,QAAQ,GAAG,SAAS,CAAC;AAC7C,UAAU,mBAAmB;IAC3B,IAAI,CAAC,EAAE,gBAAgB,CAAC;IACxB,6BAA6B,CAAC,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAAC;CACxD;AAKD,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,qBAAqB,cAElD;AAED;;EAEE;AACF,qBAAa,UAAW,SAAQ,QAAQ;IAEtC;;;MAGE;gBACU,IAAI,EAAE,qBAAqB;IA+NvC;;;MAGE;IACK,sBAAsB,IAAI,OAAO;IAOxC;;;MAGE;IACK,oBAAoB,IAAI,OAAO;IAOtC;;;;MAIE;IACK,2BAA2B,CAAC,OAAO,CAAC,EAAE,MAAM,GAAG,MAAM;IACrD,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,EAAE,OAAO,EAAE,mBAAmB,GAAG,MAAM;CAmItG"}
|
|
@@ -1,19 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 验证 SAML 消息(普通或 SOAP)
|
|
3
|
-
* @param xml XML 字符串
|
|
4
|
-
* @param isSoap 是否为 SOAP 消息,默认 false
|
|
5
|
-
* @returns true 表示验证通过,否则抛出错误
|
|
6
|
-
* @throws 当检测到 XXE 或验证失败时抛出错误
|
|
7
|
-
*/
|
|
8
1
|
export declare const validate: (xml: string, isSoap?: boolean) => Promise<boolean>;
|
|
9
|
-
|
|
10
|
-
* 验证 SAML 元数据,并可选择解析元数据类型
|
|
11
|
-
* @param xml XML 字符串
|
|
12
|
-
* @param isParse 是否解析并返回元数据类型,默认 false
|
|
13
|
-
* @returns 验证通过时:若 isParse 为 true 返回 { isValid: true, metadataType: string },否则返回 true;
|
|
14
|
-
* 验证失败时返回 Error 对象(保持原行为)
|
|
15
|
-
*/
|
|
16
|
-
export declare const validateMetadata: (xml: string, isParse?: boolean) => Promise<true | Error | readonly import("xmllint-wasm").XMLValidationError[] | {
|
|
2
|
+
export declare const validateMetadata: (xml: string, isParse?: boolean) => Promise<true | {
|
|
17
3
|
isValid: boolean;
|
|
18
4
|
metadataType: string;
|
|
19
5
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemaValidator.d.ts","sourceRoot":"","sources":["../../src/schemaValidator.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schemaValidator.d.ts","sourceRoot":"","sources":["../../src/schemaValidator.ts"],"names":[],"mappings":"AA2FA,eAAO,MAAM,QAAQ,GAAU,KAAK,MAAM,EAAE,SAAQ,OAAe,qBAoBlE,CAAC;AAEF,eAAO,MAAM,gBAAgB,GAAU,KAAK,MAAM,EAAE,UAAS,OAAe;;;EAsD3E,CAAC"}
|