samlesa 2.12.3 → 2.12.6

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 (66) hide show
  1. package/build/index.js +54 -64
  2. package/build/index.js.map +1 -1
  3. package/build/src/api.js +24 -23
  4. package/build/src/api.js.map +1 -1
  5. package/build/src/binding-post.js +358 -368
  6. package/build/src/binding-post.js.map +1 -1
  7. package/build/src/binding-redirect.js +333 -332
  8. package/build/src/binding-redirect.js.map +1 -1
  9. package/build/src/binding-simplesign.js +222 -232
  10. package/build/src/binding-simplesign.js.map +1 -1
  11. package/build/src/entity-idp.js +132 -130
  12. package/build/src/entity-idp.js.map +1 -1
  13. package/build/src/entity-sp.js +96 -96
  14. package/build/src/entity-sp.js.map +1 -1
  15. package/build/src/entity.js +225 -235
  16. package/build/src/entity.js.map +1 -1
  17. package/build/src/extractor.js +369 -369
  18. package/build/src/extractor.js.map +1 -1
  19. package/build/src/flow.js +320 -319
  20. package/build/src/flow.js.map +1 -1
  21. package/build/src/libsaml.js +660 -641
  22. package/build/src/libsaml.js.map +1 -1
  23. package/build/src/metadata-idp.js +127 -127
  24. package/build/src/metadata-idp.js.map +1 -1
  25. package/build/src/metadata-sp.js +231 -231
  26. package/build/src/metadata-sp.js.map +1 -1
  27. package/build/src/metadata.js +166 -176
  28. package/build/src/metadata.js.map +1 -1
  29. package/build/src/types.js +11 -11
  30. package/build/src/urn.js +212 -212
  31. package/build/src/urn.js.map +1 -1
  32. package/build/src/utility.js +292 -248
  33. package/build/src/utility.js.map +1 -1
  34. package/build/src/validator.js +27 -26
  35. package/build/src/validator.js.map +1 -1
  36. package/index.d.ts +10 -10
  37. package/index.js +18 -18
  38. package/package.json +1 -5
  39. package/qodana.yaml +29 -29
  40. package/src/binding-post.ts +1 -1
  41. package/src/binding-redirect.ts +83 -64
  42. package/src/entity-idp.ts +26 -20
  43. package/src/libsaml.ts +79 -48
  44. package/src/utility.ts +147 -76
  45. package/types/index.d.ts +10 -10
  46. package/types/src/api.d.ts +13 -13
  47. package/types/src/binding-post.d.ts +46 -46
  48. package/types/src/binding-redirect.d.ts +52 -52
  49. package/types/src/binding-simplesign.d.ts +39 -39
  50. package/types/src/entity-idp.d.ts +35 -42
  51. package/types/src/entity-sp.d.ts +36 -36
  52. package/types/src/entity.d.ts +101 -99
  53. package/types/src/extractor.d.ts +25 -25
  54. package/types/src/flow.d.ts +6 -6
  55. package/types/src/libsaml.d.ts +200 -210
  56. package/types/src/metadata-idp.d.ts +24 -24
  57. package/types/src/metadata-sp.d.ts +36 -36
  58. package/types/src/metadata.d.ts +59 -57
  59. package/types/src/types.d.ts +129 -127
  60. package/types/src/urn.d.ts +194 -194
  61. package/types/src/utility.d.ts +134 -134
  62. package/types/src/validator.d.ts +3 -3
  63. package/.idea/compiler.xml +0 -6
  64. package/.idea/deployment.xml +0 -14
  65. package/.idea/jsLibraryMappings.xml +0 -6
  66. package/build/.idea/workspace.xml +0 -58
@@ -1,210 +1,200 @@
1
- /**
2
- * @file SamlLib.js
3
- * @author tngan
4
- * @desc A simple library including some common functions
5
- */
6
- import { MetadataInterface } from './metadata.js';
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
- /**
119
- * @desc Replace the tag (e.g. {tag}) inside the raw XML
120
- * @param {string} rawXML raw XML string used to do keyword replacement
121
- * @param {array} tagValues tag values
122
- * @return {string}
123
- */
124
- replaceTagsByValue(rawXML: string, tagValues: Record<string, unknown>): string;
125
- /**
126
- * @desc Helper function to build the AttributeStatement tag
127
- * @param {LoginResponseAttribute} attributes an array of attribute configuration
128
- * @param {AttributeTemplate} attributeTemplate the attribute tag template to be used
129
- * @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used
130
- * @return {string}
131
- */
132
- attributeStatementBuilder(attributes: LoginResponseAttribute[], attributeTemplate?: AttributeTemplate, attributeStatementTemplate?: AttributeStatementTemplate): string;
133
- /**
134
- * @desc Construct the XML signature for POST binding
135
- * @param {string} rawSamlMessage request/response xml string
136
- * @param {string} referenceTagXPath reference uri
137
- * @param {string} privateKey declares the private key
138
- * @param {string} passphrase passphrase of the private key [optional]
139
- * @param {string|buffer} signingCert signing certificate
140
- * @param {string} signatureAlgorithm signature algorithm
141
- * @param {string[]} transformationAlgorithms canonicalization and transformation Algorithms
142
- * @return {string} base64 encoded string
143
- */
144
- constructSAMLSignature(opts: SignatureConstructor): string;
145
- /**
146
- * @desc Verify the XML signature
147
- * @param {string} xml xml
148
- * @param {SignatureVerifierOptions} opts cert declares the X509 certificate
149
- * @return {[boolean, string | null]} - A tuple where:
150
- * - The first element is `true` if the signature is valid, `false` otherwise.
151
- * - The second element is the cryptographically authenticated assertion node as a string, or `null` if not found.
152
- */
153
- verifySignature(xml: string, opts: SignatureVerifierOptions): (string | boolean)[] | (boolean | null)[];
154
- /**
155
- * @desc Helper function to create the key section in metadata (abstraction for signing and encrypt use)
156
- * @param {string} use type of certificate (e.g. signing, encrypt)
157
- * @param {string} certString declares the certificate String
158
- * @return {object} object used in xml module
159
- */
160
- createKeySection(use: KeyUse, certString: string | Buffer): KeyComponent;
161
- /**
162
- * @desc Constructs SAML message
163
- * @param {string} octetString see "Bindings for the OASIS Security Assertion Markup Language (SAML V2.0)" P.17/46
164
- * @param {string} key declares the pem-formatted private key
165
- * @param {string} passphrase passphrase of private key [optional]
166
- * @param {string} signingAlgorithm signing algorithm
167
- * @return {string} message signature
168
- */
169
- constructMessageSignature(octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string): string | Buffer<ArrayBufferLike>;
170
- /**
171
- * @desc Verifies message signature
172
- * @param {Metadata} metadata metadata object of identity provider or service provider
173
- * @param {string} octetString see "Bindings for the OASIS Security Assertion Markup Language (SAML V2.0)" P.17/46
174
- * @param {string} signature context of XML signature
175
- * @param {string} verifyAlgorithm algorithm used to verify
176
- * @return {boolean} verification result
177
- */
178
- verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string): boolean;
179
- /**
180
- * @desc Get the public key in string format
181
- * @param {string} x509Certificate certificate
182
- * @return {string} public key
183
- */
184
- getKeyInfo(x509Certificate: string, signatureConfig?: any): {
185
- getKeyInfo: () => string;
186
- getKey: () => string;
187
- };
188
- /**
189
- * @desc Encrypt the assertion section in Response
190
- * @param {Entity} sourceEntity source entity
191
- * @param {Entity} targetEntity target entity
192
- * @param {string} xml response in xml string format
193
- * @return {Promise} a promise to resolve the finalized xml
194
- */
195
- encryptAssertion(sourceEntity: any, targetEntity: any, xml?: string): Promise<string>;
196
- /**
197
- * @desc Decrypt the assertion section in Response
198
- * @param {string} type only accept SAMLResponse to proceed decryption
199
- * @param {Entity} here this entity
200
- * @param {Entity} from from the entity where the message is sent
201
- * @param {string} entireXML response in xml string format
202
- * @return {function} a promise to get back the entire xml with decrypted assertion
203
- */
204
- decryptAssertion(here: any, entireXML: string): Promise<[string, any]>;
205
- /**
206
- * @desc Check if the xml string is valid and bounded
207
- */
208
- isValidXml(input: string): Promise<any>;
209
- };
210
- export default _default;
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ import { MetadataInterface } from './metadata.js';
4
+ export interface SignatureConstructor {
5
+ rawSamlMessage: string;
6
+ referenceTagXPath?: string;
7
+ privateKey: string;
8
+ privateKeyPass?: string;
9
+ signatureAlgorithm: string;
10
+ signingCert: string | Buffer;
11
+ isBase64Output?: boolean;
12
+ signatureConfig?: any;
13
+ isMessageSigned?: boolean;
14
+ transformationAlgorithms?: string[];
15
+ }
16
+ export interface SignatureVerifierOptions {
17
+ metadata?: MetadataInterface;
18
+ keyFile?: string;
19
+ signatureAlgorithm?: string;
20
+ }
21
+ export interface ExtractorResult {
22
+ [key: string]: any;
23
+ signature?: string | string[];
24
+ issuer?: string | string[];
25
+ nameID?: string;
26
+ notexist?: boolean;
27
+ }
28
+ export interface LoginResponseAttribute {
29
+ name: string;
30
+ nameFormat: string;
31
+ valueXsiType: string;
32
+ valueTag: string;
33
+ valueXmlnsXs?: string;
34
+ valueXmlnsXsi?: string;
35
+ type?: string | string[];
36
+ }
37
+ export interface LoginResponseAdditionalTemplates {
38
+ attributeStatementTemplate?: AttributeStatementTemplate;
39
+ attributeTemplate?: AttributeTemplate;
40
+ }
41
+ export interface BaseSamlTemplate {
42
+ context: string;
43
+ }
44
+ export interface LoginResponseTemplate extends BaseSamlTemplate {
45
+ attributes?: LoginResponseAttribute[];
46
+ additionalTemplates?: LoginResponseAdditionalTemplates;
47
+ }
48
+ export interface AttributeStatementTemplate extends BaseSamlTemplate {
49
+ }
50
+ export interface AttributeTemplate extends BaseSamlTemplate {
51
+ }
52
+ export interface LoginRequestTemplate extends BaseSamlTemplate {
53
+ }
54
+ export interface LogoutRequestTemplate extends BaseSamlTemplate {
55
+ }
56
+ export interface LogoutResponseTemplate extends BaseSamlTemplate {
57
+ }
58
+ export type KeyUse = 'signing' | 'encryption';
59
+ export interface KeyComponent {
60
+ [key: string]: any;
61
+ }
62
+ export interface LibSamlInterface {
63
+ getQueryParamByType: (type: string) => string;
64
+ createXPath: (local: any, isExtractAll?: boolean) => string;
65
+ replaceTagsByValue: (rawXML: string, tagValues: any) => string;
66
+ attributeStatementBuilder: (attributes: LoginResponseAttribute[], attributeTemplate: AttributeTemplate, attributeStatementTemplate: AttributeStatementTemplate) => string;
67
+ constructSAMLSignature: (opts: SignatureConstructor) => string;
68
+ verifySignature: (xml: string, opts: SignatureVerifierOptions) => [boolean, any];
69
+ createKeySection: (use: KeyUse, cert: string | Buffer) => {};
70
+ constructMessageSignature: (octetString: string, key: string, passphrase?: string, isBase64?: boolean, signingAlgorithm?: string) => string;
71
+ verifyMessageSignature: (metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string) => boolean;
72
+ getKeyInfo: (x509Certificate: string, signatureConfig?: any) => void;
73
+ encryptAssertion: (sourceEntity: any, targetEntity: any, entireXML: string) => Promise<string>;
74
+ decryptAssertion: (here: any, entireXML: string) => Promise<[string, any]>;
75
+ getSigningScheme: (sigAlg: string) => string | null;
76
+ getDigestMethod: (sigAlg: string) => string | null;
77
+ nrsaAliasMapping: any;
78
+ defaultLoginRequestTemplate: LoginRequestTemplate;
79
+ defaultLoginResponseTemplate: LoginResponseTemplate;
80
+ defaultAttributeStatementTemplate: AttributeStatementTemplate;
81
+ defaultAttributeTemplate: AttributeTemplate;
82
+ defaultLogoutRequestTemplate: LogoutRequestTemplate;
83
+ defaultLogoutResponseTemplate: LogoutResponseTemplate;
84
+ }
85
+ declare const _default: {
86
+ createXPath: (local: any, isExtractAll?: boolean | undefined) => string;
87
+ getQueryParamByType: (type: string) => "SAMLRequest" | "SAMLResponse";
88
+ defaultLoginRequestTemplate: {
89
+ context: string;
90
+ };
91
+ defaultLoginResponseTemplate: {
92
+ context: string;
93
+ attributes: never[];
94
+ additionalTemplates: {
95
+ attributeStatementTemplate: {
96
+ context: string;
97
+ };
98
+ attributeTemplate: {
99
+ context: string;
100
+ };
101
+ };
102
+ };
103
+ defaultAttributeStatementTemplate: {
104
+ context: string;
105
+ };
106
+ defaultAttributeTemplate: {
107
+ context: string;
108
+ };
109
+ defaultLogoutRequestTemplate: {
110
+ context: string;
111
+ };
112
+ defaultLogoutResponseTemplate: {
113
+ context: string;
114
+ };
115
+ /**
116
+ * @desc Replace the tag (e.g. {tag}) inside the raw XML
117
+ * @param {string} rawXML raw XML string used to do keyword replacement
118
+ * @param {array} tagValues tag values
119
+ * @return {string}
120
+ */
121
+ replaceTagsByValue(rawXML: string, tagValues: Record<string, unknown>): string;
122
+ /**
123
+ * @desc Helper function to build the AttributeStatement tag
124
+ * @param {LoginResponseAttribute} attributes an array of attribute configuration
125
+ * @param {AttributeTemplate} attributeTemplate the attribute tag template to be used
126
+ * @param {AttributeStatementTemplate} attributeStatementTemplate the attributeStatement tag template to be used
127
+ * @return {string}
128
+ */
129
+ attributeStatementBuilder(attributes: LoginResponseAttribute[], attributeTemplate?: AttributeTemplate, attributeStatementTemplate?: AttributeStatementTemplate): string;
130
+ /**
131
+ * @desc Construct the XML signature for POST binding
132
+ * @param {string} rawSamlMessage request/response xml string
133
+ * @param {string} referenceTagXPath reference uri
134
+ * @param {string} privateKey declares the private key
135
+ * @param {string} passphrase passphrase of the private key [optional]
136
+ * @param {string|buffer} signingCert signing certificate
137
+ * @param {string} signatureAlgorithm signature algorithm
138
+ * @param {string[]} transformationAlgorithms canonicalization and transformation Algorithms
139
+ * @return {string} base64 encoded string
140
+ */
141
+ constructSAMLSignature(opts: SignatureConstructor): string;
142
+ /**
143
+ * @desc Verify the XML signature
144
+ * @param {string} xml xml
145
+ * @param {SignatureVerifierOptions} opts cert declares the X509 certificate
146
+ * @return {[boolean, string | null]} - A tuple where:
147
+ * - The first element is `true` if the signature is valid, `false` otherwise.
148
+ * - The second element is the cryptographically authenticated assertion node as a string, or `null` if not found.
149
+ */
150
+ verifySignature(xml: string, opts: SignatureVerifierOptions): (string | boolean)[] | (boolean | null)[];
151
+ /**
152
+ * @desc Helper function to create the key section in metadata (abstraction for signing and encrypt use)
153
+ * @param {string} use type of certificate (e.g. signing, encrypt)
154
+ * @param {string} certString declares the certificate String
155
+ * @return {object} object used in xml module
156
+ */
157
+ createKeySection(use: KeyUse, certString: string | Buffer): KeyComponent;
158
+ /**
159
+ * SAML 消息签名 (符合 SAML V2.0 绑定规范)
160
+ * @param octetString - 要签名的原始数据 (OCTET STRING)
161
+ * @param key - PEM 格式私钥
162
+ * @param passphrase - 私钥密码 (如果有加密)
163
+ * @param isBase64 - 是否返回 base64 编码 (默认 true)
164
+ * @param signingAlgorithm - 签名算法 (默认 'rsa-sha256')
165
+ * @returns 消息签名
166
+ */
167
+ constructMessageSignature(octetString: string | Buffer, key: string | Buffer, passphrase?: string | undefined, isBase64?: boolean, signingAlgorithm?: string): string | Buffer;
168
+ verifyMessageSignature(metadata: any, octetString: string, signature: string | Buffer, verifyAlgorithm?: string | undefined): boolean;
169
+ /**
170
+ * @desc Get the public key in string format
171
+ * @param {string} x509Certificate certificate
172
+ * @return {string} public key
173
+ */
174
+ getKeyInfo(x509Certificate: string, signatureConfig?: any): {
175
+ getKeyInfo: () => string;
176
+ getKey: () => string;
177
+ };
178
+ /**
179
+ * @desc Encrypt the assertion section in Response
180
+ * @param {Entity} sourceEntity source entity
181
+ * @param {Entity} targetEntity target entity
182
+ * @param {string} xml response in xml string format
183
+ * @return {Promise} a promise to resolve the finalized xml
184
+ */
185
+ encryptAssertion(sourceEntity: any, targetEntity: any, xml?: string | undefined): Promise<string>;
186
+ /**
187
+ * @desc Decrypt the assertion section in Response
188
+ * @param {string} type only accept SAMLResponse to proceed decryption
189
+ * @param {Entity} here this entity
190
+ * @param {Entity} from from the entity where the message is sent
191
+ * @param {string} entireXML response in xml string format
192
+ * @return {function} a promise to get back the entire xml with decrypted assertion
193
+ */
194
+ decryptAssertion(here: any, entireXML: string): Promise<[string, any]>;
195
+ /**
196
+ * @desc Check if the xml string is valid and bounded
197
+ */
198
+ isValidXml(input: string): Promise<any>;
199
+ };
200
+ export default _default;
@@ -1,24 +1,24 @@
1
- /**
2
- * @file metadata-idp.ts
3
- * @author tngan
4
- * @desc Metadata of identity provider
5
- */
6
- import Metadata, { MetadataInterface } from './metadata.js';
7
- import { 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
- }
1
+ /**
2
+ * @file metadata-idp.ts
3
+ * @author tngan
4
+ * @desc Metadata of identity provider
5
+ */
6
+ import Metadata, { MetadataInterface } from './metadata.js';
7
+ import { 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
+ }
@@ -1,36 +1,36 @@
1
- /**
2
- * @file metadata-sp.ts
3
- * @author tngan
4
- * @desc Metadata of service provider
5
- */
6
- import Metadata, { MetadataInterface } from './metadata.js';
7
- import { 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
- }
1
+ /**
2
+ * @file metadata-sp.ts
3
+ * @author tngan
4
+ * @desc Metadata of service provider
5
+ */
6
+ import Metadata, { MetadataInterface } from './metadata.js';
7
+ import { 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
+ }