samlesa 2.13.0 → 2.14.1

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.

Files changed (149) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +36 -65
  3. package/build/.idea/deployment.xml +14 -0
  4. package/{src → build}/.idea/modules.xml +1 -1
  5. package/build/.idea/workspace.xml +57 -0
  6. package/build/index.js +18 -54
  7. package/build/index.js.map +1 -1
  8. package/build/src/api.js +18 -24
  9. package/build/src/api.js.map +1 -1
  10. package/build/src/binding-post.js +337 -365
  11. package/build/src/binding-post.js.map +1 -1
  12. package/build/src/binding-redirect.js +312 -340
  13. package/build/src/binding-redirect.js.map +1 -1
  14. package/build/src/binding-simplesign.js +201 -229
  15. package/build/src/binding-simplesign.js.map +1 -1
  16. package/build/src/entity-idp.js +119 -127
  17. package/build/src/entity-idp.js.map +1 -1
  18. package/build/src/entity-sp.js +88 -96
  19. package/build/src/entity-sp.js.map +1 -1
  20. package/build/src/entity.js +193 -225
  21. package/build/src/entity.js.map +1 -1
  22. package/build/src/extractor.js +361 -369
  23. package/build/src/extractor.js.map +1 -1
  24. package/build/src/flow.js +313 -320
  25. package/build/src/flow.js.map +1 -1
  26. package/build/src/libsaml.js +693 -721
  27. package/build/src/libsaml.js.map +1 -1
  28. package/build/src/metadata-idp.js +119 -127
  29. package/build/src/metadata-idp.js.map +1 -1
  30. package/build/src/metadata-sp.js +223 -231
  31. package/build/src/metadata-sp.js.map +1 -1
  32. package/build/src/metadata.js +138 -166
  33. package/build/src/metadata.js.map +1 -1
  34. package/build/src/types.js +4 -11
  35. package/build/src/types.js.map +1 -1
  36. package/build/src/urn.js +204 -212
  37. package/build/src/urn.js.map +1 -1
  38. package/build/src/utility.js +277 -292
  39. package/build/src/utility.js.map +1 -1
  40. package/build/src/validator.js +24 -27
  41. package/build/src/validator.js.map +1 -1
  42. package/package.json +19 -14
  43. package/types/api.d.ts +15 -0
  44. package/types/api.d.ts.map +1 -0
  45. package/types/binding-post.d.ts +48 -0
  46. package/types/binding-post.d.ts.map +1 -0
  47. package/types/binding-redirect.d.ts +54 -0
  48. package/types/binding-redirect.d.ts.map +1 -0
  49. package/types/binding-simplesign.d.ts +41 -0
  50. package/types/binding-simplesign.d.ts.map +1 -0
  51. package/types/entity-idp.d.ts +38 -0
  52. package/types/entity-idp.d.ts.map +1 -0
  53. package/types/entity-sp.d.ts +38 -0
  54. package/types/entity-sp.d.ts.map +1 -0
  55. package/types/entity.d.ts +100 -0
  56. package/types/entity.d.ts.map +1 -0
  57. package/types/extractor.d.ts +26 -0
  58. package/types/extractor.d.ts.map +1 -0
  59. package/types/flow.d.ts +7 -0
  60. package/types/flow.d.ts.map +1 -0
  61. package/types/index.d.ts +11 -10
  62. package/types/index.d.ts.map +1 -0
  63. package/types/libsaml.d.ts +208 -0
  64. package/types/libsaml.d.ts.map +1 -0
  65. package/types/metadata-idp.d.ts +25 -0
  66. package/types/metadata-idp.d.ts.map +1 -0
  67. package/types/metadata-sp.d.ts +37 -0
  68. package/types/metadata-sp.d.ts.map +1 -0
  69. package/types/metadata.d.ts +58 -0
  70. package/types/metadata.d.ts.map +1 -0
  71. package/types/src/api.d.ts +15 -13
  72. package/types/src/api.d.ts.map +1 -0
  73. package/types/src/binding-post.d.ts +48 -47
  74. package/types/src/binding-post.d.ts.map +1 -0
  75. package/types/src/binding-redirect.d.ts +54 -53
  76. package/types/src/binding-redirect.d.ts.map +1 -0
  77. package/types/src/binding-simplesign.d.ts +41 -40
  78. package/types/src/binding-simplesign.d.ts.map +1 -0
  79. package/types/src/entity-idp.d.ts +38 -37
  80. package/types/src/entity-idp.d.ts.map +1 -0
  81. package/types/src/entity-sp.d.ts +38 -36
  82. package/types/src/entity-sp.d.ts.map +1 -0
  83. package/types/src/entity.d.ts +100 -101
  84. package/types/src/entity.d.ts.map +1 -0
  85. package/types/src/extractor.d.ts +26 -25
  86. package/types/src/extractor.d.ts.map +1 -0
  87. package/types/src/flow.d.ts +7 -6
  88. package/types/src/flow.d.ts.map +1 -0
  89. package/types/src/libsaml.d.ts +208 -209
  90. package/types/src/libsaml.d.ts.map +1 -0
  91. package/types/src/metadata-idp.d.ts +25 -24
  92. package/types/src/metadata-idp.d.ts.map +1 -0
  93. package/types/src/metadata-sp.d.ts +37 -36
  94. package/types/src/metadata-sp.d.ts.map +1 -0
  95. package/types/src/metadata.d.ts +58 -59
  96. package/types/src/metadata.d.ts.map +1 -0
  97. package/types/src/types.d.ts +128 -129
  98. package/types/src/types.d.ts.map +1 -0
  99. package/types/src/urn.d.ts +195 -194
  100. package/types/src/urn.d.ts.map +1 -0
  101. package/types/src/utility.d.ts +133 -134
  102. package/types/src/utility.d.ts.map +1 -0
  103. package/types/src/validator.d.ts +4 -3
  104. package/types/src/validator.d.ts.map +1 -0
  105. package/types/types.d.ts +128 -0
  106. package/types/types.d.ts.map +1 -0
  107. package/types/urn.d.ts +195 -0
  108. package/types/urn.d.ts.map +1 -0
  109. package/types/utility.d.ts +133 -0
  110. package/types/utility.d.ts.map +1 -0
  111. package/types/validator.d.ts +4 -0
  112. package/types/validator.d.ts.map +1 -0
  113. package/.editorconfig +0 -19
  114. package/.github/FUNDING.yml +0 -1
  115. package/.idea/inspectionProfiles/Project_Default.xml +0 -6
  116. package/.idea/modules.xml +0 -8
  117. package/.idea/vcs.xml +0 -6
  118. package/.pre-commit.sh +0 -15
  119. package/.snyk +0 -8
  120. package/.travis.yml +0 -29
  121. package/Makefile +0 -25
  122. package/index.d.ts +0 -10
  123. package/index.js +0 -19
  124. package/index.js.map +0 -1
  125. package/index.ts +0 -28
  126. package/qodana.yaml +0 -29
  127. package/src/.idea/src.iml +0 -12
  128. package/src/.idea/vcs.xml +0 -6
  129. package/src/api.ts +0 -36
  130. package/src/binding-post.ts +0 -348
  131. package/src/binding-redirect.ts +0 -356
  132. package/src/binding-simplesign.ts +0 -238
  133. package/src/entity-idp.ts +0 -153
  134. package/src/entity-sp.ts +0 -114
  135. package/src/entity.ts +0 -243
  136. package/src/extractor.ts +0 -392
  137. package/src/flow.ts +0 -467
  138. package/src/libsaml.ts +0 -895
  139. package/src/metadata-idp.ts +0 -146
  140. package/src/metadata-sp.ts +0 -268
  141. package/src/metadata.ts +0 -166
  142. package/src/types.ts +0 -153
  143. package/src/urn.ts +0 -211
  144. package/src/utility.ts +0 -319
  145. package/src/validator.ts +0 -39
  146. package/tsconfig.json +0 -38
  147. package/tslint.json +0 -35
  148. package/types.d.ts +0 -2
  149. /package/{.idea/samlify.iml → build/.idea/build.iml} +0 -0
@@ -0,0 +1,208 @@
1
+ import type { MetadataInterface } from './metadata.js';
2
+ /**
3
+ * 生成 SAML Attribute 元素(不带 XML 声明头)
4
+ * @param {Array} attributeData - 属性配置数据
5
+ * @returns {string} SAML Attribute XML 字符串
6
+ */
7
+ export interface SignatureConstructor {
8
+ rawSamlMessage: string;
9
+ referenceTagXPath?: string;
10
+ privateKey: string;
11
+ privateKeyPass?: string;
12
+ signatureAlgorithm: string;
13
+ signingCert: string | Buffer;
14
+ isBase64Output?: boolean;
15
+ signatureConfig?: any;
16
+ isMessageSigned?: boolean;
17
+ transformationAlgorithms?: string[];
18
+ }
19
+ export interface SignatureVerifierOptions {
20
+ metadata?: MetadataInterface;
21
+ keyFile?: string;
22
+ signatureAlgorithm?: string;
23
+ }
24
+ export interface ExtractorResult {
25
+ [key: string]: any;
26
+ signature?: string | string[];
27
+ issuer?: string | string[];
28
+ nameID?: string;
29
+ notexist?: boolean;
30
+ }
31
+ export interface LoginResponseAttribute {
32
+ name: string;
33
+ nameFormat: string;
34
+ valueXsiType: string;
35
+ valueTag: string;
36
+ valueXmlnsXs?: string;
37
+ valueXmlnsXsi?: string;
38
+ type?: string | string[];
39
+ }
40
+ export interface LoginResponseAdditionalTemplates {
41
+ attributeStatementTemplate?: AttributeStatementTemplate;
42
+ attributeTemplate?: AttributeTemplate;
43
+ }
44
+ export interface BaseSamlTemplate {
45
+ context: string;
46
+ }
47
+ export interface LoginResponseTemplate extends BaseSamlTemplate {
48
+ attributes?: LoginResponseAttribute[];
49
+ additionalTemplates?: LoginResponseAdditionalTemplates;
50
+ }
51
+ export interface AttributeStatementTemplate extends BaseSamlTemplate {
52
+ }
53
+ export interface AttributeTemplate extends BaseSamlTemplate {
54
+ }
55
+ export interface LoginRequestTemplate extends BaseSamlTemplate {
56
+ }
57
+ export interface LogoutRequestTemplate extends BaseSamlTemplate {
58
+ }
59
+ export interface LogoutResponseTemplate extends BaseSamlTemplate {
60
+ }
61
+ export type KeyUse = 'signing' | 'encryption';
62
+ export interface KeyComponent {
63
+ [key: string]: any;
64
+ }
65
+ export interface LibSamlInterface {
66
+ getQueryParamByType: (type: string) => string;
67
+ createXPath: (local: any, isExtractAll?: boolean) => string;
68
+ replaceTagsByValue: (rawXML: string, tagValues: any) => string;
69
+ attributeStatementBuilder: (attributes: LoginResponseAttribute[], attributeTemplate: AttributeTemplate, attributeStatementTemplate: AttributeStatementTemplate) => string;
70
+ constructSAMLSignature: (opts: SignatureConstructor) => string;
71
+ verifySignature: (xml: string, opts: SignatureVerifierOptions) => [boolean, any];
72
+ createKeySection: (use: KeyUse, cert: string | Buffer) => {};
73
+ constructMessageSignature: (octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string) => string;
74
+ verifyMessageSignature: (metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string) => boolean;
75
+ getKeyInfo: (x509Certificate: string, signatureConfig?: any) => void;
76
+ encryptAssertion: (sourceEntity: any, targetEntity: any, entireXML: string) => Promise<string>;
77
+ decryptAssertion: (here: any, entireXML: string) => Promise<[string, any]>;
78
+ getSigningScheme: (sigAlg: string) => string | null;
79
+ getDigestMethod: (sigAlg: string) => string | null;
80
+ nrsaAliasMapping: any;
81
+ defaultLoginRequestTemplate: LoginRequestTemplate;
82
+ defaultLoginResponseTemplate: LoginResponseTemplate;
83
+ defaultAttributeStatementTemplate: AttributeStatementTemplate;
84
+ defaultAttributeTemplate: AttributeTemplate;
85
+ defaultLogoutRequestTemplate: LogoutRequestTemplate;
86
+ defaultLogoutResponseTemplate: LogoutResponseTemplate;
87
+ }
88
+ declare const _default: {
89
+ createXPath: (local: any, isExtractAll?: boolean) => string;
90
+ getQueryParamByType: (type: string) => "SAMLRequest" | "SAMLResponse";
91
+ defaultLoginRequestTemplate: {
92
+ context: string;
93
+ };
94
+ defaultLoginResponseTemplate: {
95
+ context: string;
96
+ attributes: never[];
97
+ additionalTemplates: {
98
+ attributeStatementTemplate: {
99
+ context: string;
100
+ };
101
+ attributeTemplate: {
102
+ context: string;
103
+ };
104
+ };
105
+ };
106
+ defaultAttributeStatementTemplate: {
107
+ context: string;
108
+ };
109
+ defaultAttributeTemplate: {
110
+ context: string;
111
+ };
112
+ defaultLogoutRequestTemplate: {
113
+ context: string;
114
+ };
115
+ defaultLogoutResponseTemplate: {
116
+ context: string;
117
+ };
118
+ defaultAttributeValueTemplate: {
119
+ context: string;
120
+ };
121
+ /**
122
+ * @desc Replace the tag (e.g. {tag}) inside the raw XML
123
+ * @param {string} rawXML raw XML string used to do keyword replacement
124
+ * @param {array} tagValues tag values
125
+ * @return {string}
126
+ */
127
+ replaceTagsByValue(rawXML: string, tagValues: Record<string, unknown>): string;
128
+ /**
129
+ * @desc Helper function to build the AttributeStatement tag
130
+ * @param {LoginResponseAttribute} attributes an array of attribute configuration
131
+ * @param {AttributeTemplate} attributeTemplate the attribute tag template to be used
132
+ * @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used
133
+ * @return {string}
134
+ */
135
+ /** For Test */
136
+ attributeStatementBuilder(attributeData: any[]): string;
137
+ /**
138
+ * @desc Construct the XML signature for POST binding
139
+ * @param {string} rawSamlMessage request/response xml string
140
+ * @param {string} referenceTagXPath reference uri
141
+ * @param {string} privateKey declares the private key
142
+ * @param {string} passphrase passphrase of the private key [optional]
143
+ * @param {string|buffer} signingCert signing certificate
144
+ * @param {string} signatureAlgorithm signature algorithm
145
+ * @param {string[]} transformationAlgorithms canonicalization and transformation Algorithms
146
+ * @return {string} base64 encoded string
147
+ */
148
+ constructSAMLSignature(opts: SignatureConstructor): string;
149
+ /**
150
+ * @desc Verify the XML signature
151
+ * @param {string} xml xml
152
+ * @param {SignatureVerifierOptions} opts cert declares the X509 certificate
153
+ * @return {[boolean, string | null]} - A tuple where:
154
+ * - The first element is `true` if the signature is valid, `false` otherwise.
155
+ * - The second element is the cryptographically authenticated assertion node as a string, or `null` if not found.
156
+ */
157
+ verifySignature(xml: string, opts: SignatureVerifierOptions): (string | boolean)[] | (boolean | null)[];
158
+ /**
159
+ * @desc Helper function to create the key section in metadata (abstraction for signing and encrypt use)
160
+ * @param {string} use type of certificate (e.g. signing, encrypt)
161
+ * @param {string} certString declares the certificate String
162
+ * @return {object} object used in xml module
163
+ */
164
+ createKeySection(use: KeyUse, certString: string | Buffer): KeyComponent;
165
+ /**
166
+ * SAML 消息签名 (符合 SAML V2.0 绑定规范)
167
+ * @param octetString - 要签名的原始数据 (OCTET STRING)
168
+ * @param key - PEM 格式私钥
169
+ * @param passphrase - 私钥密码 (如果有加密)
170
+ * @param isBase64 - 是否返回 base64 编码 (默认 true)
171
+ * @param signingAlgorithm - 签名算法 (默认 'rsa-sha256')
172
+ * @returns 消息签名
173
+ */
174
+ constructMessageSignature(octetString: string | Buffer, key: string | Buffer, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string): string | Buffer;
175
+ verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string): boolean;
176
+ /**
177
+ * @desc Get the public key in string format
178
+ * @param {string} x509Certificate certificate
179
+ * @return {string} public key
180
+ */
181
+ getKeyInfo(x509Certificate: string, signatureConfig?: any): {
182
+ getKeyInfo: () => string;
183
+ getKey: () => string;
184
+ };
185
+ /**
186
+ * @desc Encrypt the assertion section in Response
187
+ * @param {Entity} sourceEntity source entity
188
+ * @param {Entity} targetEntity target entity
189
+ * @param {string} xml response in xml string format
190
+ * @return {Promise} a promise to resolve the finalized xml
191
+ */
192
+ encryptAssertion(sourceEntity: any, targetEntity: any, xml?: string): Promise<string>;
193
+ /**
194
+ * @desc Decrypt the assertion section in Response
195
+ * @param {string} type only accept SAMLResponse to proceed decryption
196
+ * @param {Entity} here this entity
197
+ * @param {Entity} from from the entity where the message is sent
198
+ * @param {string} entireXML response in xml string format
199
+ * @return {function} a promise to get back the entire xml with decrypted assertion
200
+ */
201
+ decryptAssertion(here: any, entireXML: string): Promise<[string, any]>;
202
+ /**
203
+ * @desc Check if the xml string is valid and bounded
204
+ */
205
+ isValidXml(input: string): Promise<any>;
206
+ };
207
+ export default _default;
208
+ //# sourceMappingURL=libsaml.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"libsaml.d.ts","sourceRoot":"","sources":["../src/libsaml.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,EAAC,iBAAiB,EAAC,MAAM,eAAe,CAAC;AAiCrD;;;;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;CAC7B;AAED,MAAM,WAAW,eAAe;IAC9B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAEnB,SAAS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+ */
6
+ import Metadata, { type MetadataInterface } from './metadata.js';
7
+ import type { MetadataIdpConstructor } from './types.js';
8
+ export interface IdpMetadataInterface extends MetadataInterface {
9
+ }
10
+ export default function (meta: MetadataIdpConstructor): IdpMetadata;
11
+ export declare class IdpMetadata extends Metadata {
12
+ constructor(meta: MetadataIdpConstructor);
13
+ /**
14
+ * @desc Get the preference whether it wants a signed request
15
+ * @return {boolean} WantAuthnRequestsSigned
16
+ */
17
+ isWantAuthnRequestsSigned(): boolean;
18
+ /**
19
+ * @desc Get the entity endpoint for single sign on service
20
+ * @param {string} binding protocol binding (e.g. redirect, post)
21
+ * @return {string/object} location
22
+ */
23
+ getSingleSignOnService(binding: string): string | object;
24
+ }
25
+ //# sourceMappingURL=metadata-idp.d.ts.map
@@ -0,0 +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;gBAE3B,IAAI,EAAE,sBAAsB;IA6FxC;;;MAGE;IACF,yBAAyB,IAAI,OAAO;IAQpC;;;;MAIE;IACF,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM;CAUzD"}
@@ -0,0 +1,37 @@
1
+ /**
2
+ * @file metadata-sp.ts
3
+ * @author tngan
4
+ * @desc Metadata of service provider
5
+ */
6
+ import Metadata, { type MetadataInterface } from './metadata.js';
7
+ import type { MetadataSpConstructor } from './types.js';
8
+ export interface SpMetadataInterface extends MetadataInterface {
9
+ }
10
+ export default function (meta: MetadataSpConstructor): SpMetadata;
11
+ /**
12
+ * @desc SP Metadata is for creating Service Provider, provides a set of API to manage the actions in SP.
13
+ */
14
+ export declare class SpMetadata extends Metadata {
15
+ /**
16
+ * @param {object/string} meta (either xml string or configuration in object)
17
+ * @return {object} prototypes including public functions
18
+ */
19
+ constructor(meta: MetadataSpConstructor);
20
+ /**
21
+ * @desc Get the preference whether it wants a signed assertion response
22
+ * @return {boolean} Wantassertionssigned
23
+ */
24
+ isWantAssertionsSigned(): boolean;
25
+ /**
26
+ * @desc Get the preference whether it signs request
27
+ * @return {boolean} Authnrequestssigned
28
+ */
29
+ isAuthnRequestSigned(): boolean;
30
+ /**
31
+ * @desc Get the entity endpoint for assertion consumer service
32
+ * @param {string} binding protocol binding (e.g. redirect, post)
33
+ * @return {string/[string]} URL of endpoint(s)
34
+ */
35
+ getAssertionConsumerService(binding: string): string | string[];
36
+ }
37
+ //# sourceMappingURL=metadata-sp.d.ts.map
@@ -0,0 +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;AAcD,MAAM,CAAC,OAAO,WAAU,IAAI,EAAE,qBAAqB,cAElD;AAED;;EAEE;AACF,qBAAa,UAAW,SAAQ,QAAQ;IAEtC;;;MAGE;gBACU,IAAI,EAAE,qBAAqB;IA2LvC;;;MAGE;IACK,sBAAsB,IAAI,OAAO;IAGxC;;;MAGE;IACK,oBAAoB,IAAI,OAAO;IAGtC;;;;MAIE;IACK,2BAA2B,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,EAAE;CAoBvE"}
@@ -0,0 +1,58 @@
1
+ export interface MetadataInterface {
2
+ xmlString: string;
3
+ getMetadata: () => string;
4
+ exportMetadata: (exportFile: string) => void;
5
+ getEntityID: () => string;
6
+ getX509Certificate: (certType: string) => string | string[];
7
+ getNameIDFormat: () => any[];
8
+ getSingleLogoutService: (binding: string | undefined) => string | object;
9
+ getSupportBindings: (services: string[]) => string[];
10
+ }
11
+ export default class Metadata implements MetadataInterface {
12
+ xmlString: string;
13
+ meta: any;
14
+ /**
15
+ * @param {string | Buffer} xml
16
+ * @param {object} extraParse for custom metadata extractor
17
+ */
18
+ constructor(xml: string | Buffer, extraParse?: any);
19
+ /**
20
+ * @desc Get the metadata in xml format
21
+ * @return {string} metadata in xml format
22
+ */
23
+ getMetadata(): string;
24
+ /**
25
+ * @desc Export the metadata to specific file
26
+ * @param {string} exportFile is the output file path
27
+ */
28
+ exportMetadata(exportFile: string): void;
29
+ /**
30
+ * @desc Get the entityID in metadata
31
+ * @return {string} entityID
32
+ */
33
+ getEntityID(): string;
34
+ /**
35
+ * @desc Get the x509 certificate declared in entity metadata
36
+ * @param {string} use declares the type of certificate
37
+ * @return {string} certificate in string format
38
+ */
39
+ getX509Certificate(use: string): any;
40
+ /**
41
+ * @desc Get the support NameID format declared in entity metadata
42
+ * @return {array} support NameID format
43
+ */
44
+ getNameIDFormat(): any;
45
+ /**
46
+ * @desc Get the entity endpoint for single logout service
47
+ * @param {string} binding e.g. redirect, post
48
+ * @return {string/object} location
49
+ */
50
+ getSingleLogoutService(binding: string | undefined): string | object;
51
+ /**
52
+ * @desc Get the support bindings
53
+ * @param {[string]} services
54
+ * @return {[string]} support bindings
55
+ */
56
+ getSupportBindings(services: string[]): string[];
57
+ }
58
+ //# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"metadata.d.ts","sourceRoot":"","sources":["../src/metadata.ts"],"names":[],"mappings":"AAUA,MAAM,WAAW,iBAAiB;IAChC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,cAAc,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,WAAW,EAAE,MAAM,MAAM,CAAC;IAC1B,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5D,eAAe,EAAE,MAAM,GAAG,EAAE,CAAC;IAC7B,sBAAsB,EAAE,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,KAAK,MAAM,GAAG,MAAM,CAAC;IACzE,kBAAkB,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,MAAM,EAAE,CAAC;CACtD;AAED,MAAM,CAAC,OAAO,OAAO,QAAS,YAAW,iBAAiB;IAExD,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,GAAG,CAAC;IAEV;;;MAGE;gBACU,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,UAAU,GAAE,GAAQ;IA2DtD;;;MAGE;IACK,WAAW,IAAI,MAAM;IAI5B;;;MAGE;IACK,cAAc,CAAC,UAAU,EAAE,MAAM,GAAG,IAAI;IAI/C;;;MAGE;IACK,WAAW,IAAI,MAAM;IAI5B;;;;MAIE;IACK,kBAAkB,CAAC,GAAG,EAAE,MAAM;IAIrC;;;MAGE;IACK,eAAe,IAAI,GAAG;IAI7B;;;;MAIE;IACK,sBAAsB,CAAC,OAAO,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,MAAM;IAe3E;;;;MAIE;IACK,kBAAkB,CAAC,QAAQ,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE;CAUxD"}
@@ -1,13 +1,15 @@
1
- import { DOMParser as dom, Options as DOMParserOptions } from '@xmldom/xmldom';
2
- interface Context extends ValidatorContext, DOMParserContext {
3
- }
4
- interface ValidatorContext {
5
- validate?: (xml: string) => Promise<any>;
6
- }
7
- interface DOMParserContext {
8
- dom: dom;
9
- }
10
- export declare function getContext(): Context;
11
- export declare function setSchemaValidator(params: ValidatorContext): void;
12
- export declare function setDOMParserOptions(options?: DOMParserOptions): void;
13
- export {};
1
+ import { DOMParser as dom } from '@xmldom/xmldom';
2
+ import type { Options as DOMParserOptions } from '@xmldom/xmldom';
3
+ interface Context extends ValidatorContext, DOMParserContext {
4
+ }
5
+ interface ValidatorContext {
6
+ validate?: (xml: string) => Promise<any>;
7
+ }
8
+ interface DOMParserContext {
9
+ dom: dom;
10
+ }
11
+ export declare function getContext(): Context;
12
+ export declare function setSchemaValidator(params: ValidatorContext): void;
13
+ export declare function setDOMParserOptions(options?: DOMParserOptions): void;
14
+ export {};
15
+ //# sourceMappingURL=api.d.ts.map
@@ -0,0 +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;AAClD,OAAO,KAAK,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAElE,UAAU,OAAQ,SAAQ,gBAAgB,EAAE,gBAAgB;CAAG;AAE/D,UAAU,gBAAgB;IACxB,QAAQ,CAAC,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,CAAC;CAC1C;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,GAAE,gBAAqB,GAAE,IAAI,CAEvE"}
@@ -1,47 +1,48 @@
1
- /**
2
- * @file binding-post.ts
3
- * @author tngan
4
- * @desc Binding-level API, declare the functions using POST binding
5
- */
6
- import { BindingContext } from './entity.js';
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
- */
13
- declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
14
- /**
15
- * @desc Generate a base64 encoded login response
16
- * @param {object} requestInfo corresponding request, used to obtain the id
17
- * @param {object} entity object includes both idp and sp
18
- * @param {object} user current logged user (e.g. req.user)
19
- * @param {function} customTagReplacement used when developers have their own login response template
20
- * @param {boolean} encryptThenSign whether or not to encrypt then sign first (if signing). Defaults to sign-then-encrypt
21
- * @param AttributeStatement
22
- */
23
- declare function base64LoginResponse(requestInfo: any, entity: any, user?: any, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean, AttributeStatement?: never[]): Promise<BindingContext>;
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
- */
32
- declare function base64LogoutRequest(user: any, referenceTagXPath: any, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
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
- */
40
- declare function base64LogoutResponse(requestInfo: any, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext;
41
- declare const postBinding: {
42
- base64LoginRequest: typeof base64LoginRequest;
43
- base64LoginResponse: typeof base64LoginResponse;
44
- base64LogoutRequest: typeof base64LogoutRequest;
45
- base64LogoutResponse: typeof base64LogoutResponse;
46
- };
47
- export default postBinding;
1
+ /**
2
+ * @file binding-post.ts
3
+ * @author tngan
4
+ * @desc Binding-level API, declare the functions using POST binding
5
+ */
6
+ import type { BindingContext } from './entity.js';
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
+ */
13
+ declare function base64LoginRequest(referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
14
+ /**
15
+ * @desc Generate a base64 encoded login response
16
+ * @param {object} requestInfo corresponding request, used to obtain the id
17
+ * @param {object} entity object includes both idp and sp
18
+ * @param {object} user current logged user (e.g. req.user)
19
+ * @param {function} customTagReplacement used when developers have their own login response template
20
+ * @param {boolean} encryptThenSign whether or not to encrypt then sign first (if signing). Defaults to sign-then-encrypt
21
+ * @param AttributeStatement
22
+ */
23
+ declare function base64LoginResponse(requestInfo: any | undefined, entity: any, user?: any, customTagReplacement?: (template: string) => BindingContext, encryptThenSign?: boolean, AttributeStatement?: never[]): Promise<BindingContext>;
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
+ */
32
+ declare function base64LogoutRequest(user: Record<string, unknown>, referenceTagXPath: string, entity: any, customTagReplacement?: (template: string) => BindingContext): BindingContext;
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
+ */
40
+ declare function base64LogoutResponse(requestInfo: any, entity: any, customTagReplacement: (template: string) => BindingContext): BindingContext;
41
+ declare const postBinding: {
42
+ base64LoginRequest: typeof base64LoginRequest;
43
+ base64LoginResponse: typeof base64LoginResponse;
44
+ base64LogoutRequest: typeof base64LogoutRequest;
45
+ base64LogoutResponse: typeof base64LogoutResponse;
46
+ };
47
+ export default postBinding;
48
+ //# sourceMappingURL=binding-post.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"binding-post.d.ts","sourceRoot":"","sources":["../../src/binding-post.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AAGF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAMlD;;;;;EAKE;AACF,iBAAS,kBAAkB,CAAC,iBAAiB,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CAqD/I;AACD;;;;;;;;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,EAAG,kBAAkB,UAAG,GAAG,OAAO,CAAC,cAAc,CAAC,CAuIrO;AACD;;;;;;;EAOE;AACF,iBAAS,mBAAmB,CAAC,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,EAAC,MAAM,EAAE,MAAM,KAAA,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CAkDzK;AACD;;;;;;EAME;AACF,iBAAS,oBAAoB,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,oBAAoB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CAsDvI;AAED,QAAA,MAAM,WAAW;;;;;CAKhB,CAAC;AAEF,eAAe,WAAW,CAAC"}
@@ -1,53 +1,54 @@
1
- import { BindingContext } from './entity.js';
2
- import { IdentityProvider as Idp } from './entity-idp.js';
3
- import { ServiceProvider as Sp } from './entity-sp.js';
4
- export interface BuildRedirectConfig {
5
- baseUrl: string;
6
- type: string;
7
- isSigned: boolean;
8
- context: string;
9
- entitySetting: any;
10
- relayState?: string;
11
- }
12
- /**
13
- * @desc Redirect URL for login request
14
- * @param {object} entity object includes both idp and sp
15
- * @param {function} customTagReplacement used when developers have their own login response template
16
- * @return {string} redirect URL
17
- */
18
- declare function loginRequestRedirectURL(entity: {
19
- idp: Idp;
20
- sp: Sp;
21
- }, customTagReplacement?: (template: string) => BindingContext): BindingContext;
22
- /**
23
- * @desc Redirect URL for login response
24
- * @param {object} requestInfo corresponding request, used to obtain the id
25
- * @param {object} entity object includes both idp and sp
26
- * @param {object} user current logged user (e.g. req.user)
27
- * @param {String} relayState the relaystate sent by sp corresponding request
28
- * @param {function} customTagReplacement used when developers have their own login response template
29
- * @param AttributeStatement
30
- */
31
- declare function loginResponseRedirectURL(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext, AttributeStatement?: never[]): BindingContext;
32
- /**
33
- * @desc Redirect URL for logout request
34
- * @param {object} user current logged user (e.g. req.user)
35
- * @param {object} entity object includes both idp and sp
36
- * @param {function} customTagReplacement used when developers have their own login response template
37
- * @return {string} redirect URL
38
- */
39
- declare function logoutRequestRedirectURL(user: any, entity: any, relayState?: string, customTagReplacement?: (template: string, tags: object) => BindingContext): BindingContext;
40
- /**
41
- * @desc Redirect URL for logout response
42
- * @param {object} requescorresponding request, used to obtain the id
43
- * @param {object} entity object includes both idp and sp
44
- * @param {function} customTagReplacement used when developers have their own login response template
45
- */
46
- declare function logoutResponseRedirectURL(requestInfo: any, entity: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
47
- declare const redirectBinding: {
48
- loginRequestRedirectURL: typeof loginRequestRedirectURL;
49
- loginResponseRedirectURL: typeof loginResponseRedirectURL;
50
- logoutRequestRedirectURL: typeof logoutRequestRedirectURL;
51
- logoutResponseRedirectURL: typeof logoutResponseRedirectURL;
52
- };
53
- export default redirectBinding;
1
+ import type { BindingContext } from './entity.js';
2
+ import { IdentityProvider as Idp } from './entity-idp.js';
3
+ import { ServiceProvider as Sp } from './entity-sp.js';
4
+ export interface BuildRedirectConfig {
5
+ baseUrl: string;
6
+ type: string;
7
+ isSigned: boolean;
8
+ context: string;
9
+ entitySetting: any;
10
+ relayState?: string;
11
+ }
12
+ /**
13
+ * @desc Redirect URL for login request
14
+ * @param {object} entity object includes both idp and sp
15
+ * @param {function} customTagReplacement used when developers have their own login response template
16
+ * @return {string} redirect URL
17
+ */
18
+ declare function loginRequestRedirectURL(entity: {
19
+ idp: Idp;
20
+ sp: Sp;
21
+ }, customTagReplacement?: (template: string) => BindingContext): BindingContext;
22
+ /**
23
+ * @desc Redirect URL for login response
24
+ * @param {object} requestInfo corresponding request, used to obtain the id
25
+ * @param {object} entity object includes both idp and sp
26
+ * @param {object} user current logged user (e.g. req.user)
27
+ * @param {String} relayState the relaystate sent by sp corresponding request
28
+ * @param {function} customTagReplacement used when developers have their own login response template
29
+ * @param AttributeStatement
30
+ */
31
+ declare function loginResponseRedirectURL(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext, AttributeStatement?: never[]): BindingContext;
32
+ /**
33
+ * @desc Redirect URL for logout request
34
+ * @param {object} user current logged user (e.g. req.user)
35
+ * @param {object} entity object includes both idp and sp
36
+ * @param {function} customTagReplacement used when developers have their own login response template
37
+ * @return {string} redirect URL
38
+ */
39
+ declare function logoutRequestRedirectURL(user: any, entity: any, relayState?: string, customTagReplacement?: (template: string, tags: object) => BindingContext): BindingContext;
40
+ /**
41
+ * @desc Redirect URL for logout response
42
+ * @param {object} requescorresponding request, used to obtain the id
43
+ * @param {object} entity object includes both idp and sp
44
+ * @param {function} customTagReplacement used when developers have their own login response template
45
+ */
46
+ declare function logoutResponseRedirectURL(requestInfo: any, entity: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext;
47
+ declare const redirectBinding: {
48
+ loginRequestRedirectURL: typeof loginRequestRedirectURL;
49
+ loginResponseRedirectURL: typeof loginResponseRedirectURL;
50
+ logoutRequestRedirectURL: typeof logoutRequestRedirectURL;
51
+ logoutResponseRedirectURL: typeof logoutResponseRedirectURL;
52
+ };
53
+ export default redirectBinding;
54
+ //# sourceMappingURL=binding-redirect.d.ts.map
@@ -0,0 +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;AAOrD,MAAM,WAAW,mBAAmB;IAClC,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;CACrB;AAgED;;;;;GAKG;AACH,iBAAS,uBAAuB,CAAC,MAAM,EAAE;IACvC,GAAG,EAAE,GAAG,CAAC;IACT,EAAE,EAAE,EAAE,CAAA;CACP,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CAyC9E;AAED;;;;;;;;GAQG;AACH,iBAAS,wBAAwB,CAAC,WAAW,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,IAAI,GAAE,GAAQ,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,EAAC,kBAAkB,UAAI,GAAG,cAAc,CAoGxM;AAED;;;;;;GAMG;AACH,iBAAS,wBAAwB,CAAC,IAAI,KAAA,EAAE,MAAM,KAAA,EAAE,UAAU,CAAC,EAAE,MAAM,EAAE,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,KAAK,cAAc,GAAG,cAAc,CA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