samlesa 2.12.3 → 2.12.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of samlesa might be problematic. Click here for more details.
- package/build/.idea/workspace.xml +13 -1
- package/build/index.js +54 -64
- package/build/index.js.map +1 -1
- package/build/src/api.js +24 -23
- package/build/src/api.js.map +1 -1
- package/build/src/binding-post.js +358 -368
- package/build/src/binding-post.js.map +1 -1
- package/build/src/binding-redirect.js +333 -332
- package/build/src/binding-redirect.js.map +1 -1
- package/build/src/binding-simplesign.js +222 -232
- package/build/src/binding-simplesign.js.map +1 -1
- package/build/src/entity-idp.js +130 -130
- package/build/src/entity-idp.js.map +1 -1
- package/build/src/entity-sp.js +96 -96
- package/build/src/entity-sp.js.map +1 -1
- package/build/src/entity.js +225 -235
- package/build/src/entity.js.map +1 -1
- package/build/src/extractor.js +385 -369
- package/build/src/extractor.js.map +1 -1
- package/build/src/flow.js +320 -319
- package/build/src/flow.js.map +1 -1
- package/build/src/libsaml.js +665 -641
- package/build/src/libsaml.js.map +1 -1
- package/build/src/metadata-idp.js +127 -127
- package/build/src/metadata-idp.js.map +1 -1
- package/build/src/metadata-sp.js +231 -231
- package/build/src/metadata-sp.js.map +1 -1
- package/build/src/metadata.js +166 -176
- package/build/src/metadata.js.map +1 -1
- package/build/src/types.js +11 -11
- package/build/src/urn.js +212 -212
- package/build/src/urn.js.map +1 -1
- package/build/src/utility.js +292 -248
- package/build/src/utility.js.map +1 -1
- package/build/src/validator.js +27 -26
- package/build/src/validator.js.map +1 -1
- package/package.json +8 -10
- package/src/api.ts +1 -1
- package/src/binding-redirect.ts +83 -64
- package/src/extractor.ts +23 -5
- package/src/libsaml.ts +95 -62
- package/src/utility.ts +147 -76
- package/types/index.d.ts +10 -10
- package/types/src/api.d.ts +13 -13
- package/types/src/binding-post.d.ts +46 -46
- package/types/src/binding-redirect.d.ts +52 -52
- package/types/src/binding-simplesign.d.ts +39 -39
- package/types/src/entity-idp.d.ts +42 -42
- package/types/src/entity-sp.d.ts +36 -36
- package/types/src/entity.d.ts +101 -99
- package/types/src/extractor.d.ts +25 -25
- package/types/src/flow.d.ts +6 -6
- package/types/src/libsaml.d.ts +200 -210
- package/types/src/metadata-idp.d.ts +24 -24
- package/types/src/metadata-sp.d.ts +36 -36
- package/types/src/metadata.d.ts +59 -57
- package/types/src/types.d.ts +129 -127
- package/types/src/urn.d.ts +194 -194
- package/types/src/utility.d.ts +134 -134
- package/types/src/validator.d.ts +3 -3
package/types/src/entity.d.ts
CHANGED
|
@@ -1,99 +1,101 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
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
|
-
* @param {
|
|
70
|
-
* @param {string}
|
|
71
|
-
* @param {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
* @
|
|
78
|
-
* @param {
|
|
79
|
-
* @param {
|
|
80
|
-
* @param {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
* @
|
|
87
|
-
* @param {
|
|
88
|
-
* @
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
* @
|
|
95
|
-
* @param {
|
|
96
|
-
* @
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/// <reference types="node" />
|
|
3
|
+
import { IdpMetadata as IdpMetadataConstructor } from './metadata-idp.js';
|
|
4
|
+
import { SpMetadata as SpMetadataConstructor } from './metadata-sp.js';
|
|
5
|
+
import { MetadataIdpConstructor, MetadataSpConstructor, EntitySetting } from './types.js';
|
|
6
|
+
import { FlowResult } from './flow.js';
|
|
7
|
+
export interface ESamlHttpRequest {
|
|
8
|
+
query?: any;
|
|
9
|
+
body?: any;
|
|
10
|
+
octetString?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface BindingContext {
|
|
13
|
+
context: string;
|
|
14
|
+
id: string;
|
|
15
|
+
}
|
|
16
|
+
export interface PostBindingContext extends BindingContext {
|
|
17
|
+
relayState?: string;
|
|
18
|
+
entityEndpoint: string;
|
|
19
|
+
type: string;
|
|
20
|
+
}
|
|
21
|
+
export interface SimpleSignBindingContext extends PostBindingContext {
|
|
22
|
+
sigAlg?: string;
|
|
23
|
+
signature?: string;
|
|
24
|
+
keyInfo?: string;
|
|
25
|
+
}
|
|
26
|
+
export interface SimpleSignComputedContext extends BindingContext {
|
|
27
|
+
sigAlg?: string;
|
|
28
|
+
signature?: string;
|
|
29
|
+
}
|
|
30
|
+
export interface ParseResult {
|
|
31
|
+
samlContent: string;
|
|
32
|
+
extract: any;
|
|
33
|
+
sigAlg: string;
|
|
34
|
+
}
|
|
35
|
+
export type EntityConstructor = (MetadataIdpConstructor | MetadataSpConstructor) & {
|
|
36
|
+
metadata?: string | Buffer;
|
|
37
|
+
};
|
|
38
|
+
export default class Entity {
|
|
39
|
+
entitySetting: EntitySetting;
|
|
40
|
+
entityType: string;
|
|
41
|
+
entityMeta: IdpMetadataConstructor | SpMetadataConstructor;
|
|
42
|
+
/**
|
|
43
|
+
* @param entitySetting
|
|
44
|
+
* @param entityMeta is the entity metadata, deprecated after 2.0
|
|
45
|
+
*/
|
|
46
|
+
constructor(entitySetting: EntityConstructor, entityType: 'idp' | 'sp');
|
|
47
|
+
/**
|
|
48
|
+
* @desc Returns the setting of entity
|
|
49
|
+
* @return {object}
|
|
50
|
+
*/
|
|
51
|
+
getEntitySetting(): EntitySetting;
|
|
52
|
+
/**
|
|
53
|
+
* @desc Returns the xml string of entity metadata
|
|
54
|
+
* @return {string}
|
|
55
|
+
*/
|
|
56
|
+
getMetadata(): string;
|
|
57
|
+
/**
|
|
58
|
+
* @desc Exports the entity metadata into specified folder
|
|
59
|
+
* @param {string} exportFile indicates the file name
|
|
60
|
+
*/
|
|
61
|
+
exportMetadata(exportFile: string): void;
|
|
62
|
+
/** * @desc Verify fields with the one specified in metadata
|
|
63
|
+
* @param {string/[string]} field is a string or an array of string indicating the field value in SAML message
|
|
64
|
+
* @param {string} metaField is a string indicating the same field specified in metadata
|
|
65
|
+
* @return {boolean} True/False
|
|
66
|
+
*/
|
|
67
|
+
verifyFields(field: string | string[], metaField: string): boolean;
|
|
68
|
+
/** @desc Generates the logout request for developers to design their own method
|
|
69
|
+
* @param {ServiceProvider} sp object of service provider
|
|
70
|
+
* @param {string} binding protocol binding
|
|
71
|
+
* @param {object} user current logged user (e.g. user)
|
|
72
|
+
* @param {string} relayState the URL to which to redirect the user when logout is complete
|
|
73
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
74
|
+
*/
|
|
75
|
+
createLogoutRequest(targetEntity: any, binding: any, user: any, relayState?: string, customTagReplacement?: any): BindingContext | PostBindingContext;
|
|
76
|
+
/**
|
|
77
|
+
* @desc Generates the logout response for developers to design their own method
|
|
78
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
79
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
80
|
+
* @param {string} relayState the URL to which to redirect the user when logout is complete.
|
|
81
|
+
* @param {string} binding protocol binding
|
|
82
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
83
|
+
*/
|
|
84
|
+
createLogoutResponse(target: any, requestInfo: any, binding: any, relayState?: string, customTagReplacement?: any): BindingContext | PostBindingContext;
|
|
85
|
+
/**
|
|
86
|
+
* @desc Validation of the parsed the URL parameters
|
|
87
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
88
|
+
* @param {string} binding protocol binding
|
|
89
|
+
* @param {request} req request
|
|
90
|
+
* @return {Promise}
|
|
91
|
+
*/
|
|
92
|
+
parseLogoutRequest(from: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
93
|
+
/**
|
|
94
|
+
* @desc Validation of the parsed the URL parameters
|
|
95
|
+
* @param {object} config config for the parser
|
|
96
|
+
* @param {string} binding protocol binding
|
|
97
|
+
* @param {request} req request
|
|
98
|
+
* @return {Promise}
|
|
99
|
+
*/
|
|
100
|
+
parseLogoutResponse(from: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
101
|
+
}
|
package/types/src/extractor.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
interface ExtractorField {
|
|
2
|
-
key: string;
|
|
3
|
-
localPath: string[] | string[][];
|
|
4
|
-
attributes: string[];
|
|
5
|
-
index?: string[];
|
|
6
|
-
attributePath?: string[];
|
|
7
|
-
context?: boolean;
|
|
8
|
-
}
|
|
9
|
-
export type ExtractorFields = ExtractorField[];
|
|
10
|
-
export declare const loginRequestFields: ExtractorFields;
|
|
11
|
-
export declare const loginResponseStatusFields: {
|
|
12
|
-
key: string;
|
|
13
|
-
localPath: string[];
|
|
14
|
-
attributes: string[];
|
|
15
|
-
}[];
|
|
16
|
-
export declare const logoutResponseStatusFields: {
|
|
17
|
-
key: string;
|
|
18
|
-
localPath: string[];
|
|
19
|
-
attributes: string[];
|
|
20
|
-
}[];
|
|
21
|
-
export declare const loginResponseFields: ((assertion: any) => ExtractorFields);
|
|
22
|
-
export declare const logoutRequestFields: ExtractorFields;
|
|
23
|
-
export declare const logoutResponseFields: ExtractorFields;
|
|
24
|
-
export declare function extract(context: string, fields: any): any;
|
|
25
|
-
export {};
|
|
1
|
+
interface ExtractorField {
|
|
2
|
+
key: string;
|
|
3
|
+
localPath: string[] | string[][];
|
|
4
|
+
attributes: string[];
|
|
5
|
+
index?: string[];
|
|
6
|
+
attributePath?: string[];
|
|
7
|
+
context?: boolean;
|
|
8
|
+
}
|
|
9
|
+
export type ExtractorFields = ExtractorField[];
|
|
10
|
+
export declare const loginRequestFields: ExtractorFields;
|
|
11
|
+
export declare const loginResponseStatusFields: {
|
|
12
|
+
key: string;
|
|
13
|
+
localPath: string[];
|
|
14
|
+
attributes: string[];
|
|
15
|
+
}[];
|
|
16
|
+
export declare const logoutResponseStatusFields: {
|
|
17
|
+
key: string;
|
|
18
|
+
localPath: string[];
|
|
19
|
+
attributes: string[];
|
|
20
|
+
}[];
|
|
21
|
+
export declare const loginResponseFields: ((assertion: any) => ExtractorFields);
|
|
22
|
+
export declare const logoutRequestFields: ExtractorFields;
|
|
23
|
+
export declare const logoutResponseFields: ExtractorFields;
|
|
24
|
+
export declare function extract(context: string, fields: any): any;
|
|
25
|
+
export {};
|
package/types/src/flow.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export interface FlowResult {
|
|
2
|
-
samlContent: string;
|
|
3
|
-
extract: any;
|
|
4
|
-
sigAlg?: string | null;
|
|
5
|
-
}
|
|
6
|
-
export declare function flow(options: any): Promise<FlowResult>;
|
|
1
|
+
export interface FlowResult {
|
|
2
|
+
samlContent: string;
|
|
3
|
+
extract: any;
|
|
4
|
+
sigAlg?: string | null;
|
|
5
|
+
}
|
|
6
|
+
export declare function flow(options: any): Promise<FlowResult>;
|