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.
- package/LICENSE +1 -1
- package/README.md +36 -65
- package/build/.idea/deployment.xml +14 -0
- package/{src → build}/.idea/modules.xml +1 -1
- package/build/.idea/workspace.xml +57 -0
- package/build/index.js +18 -54
- package/build/index.js.map +1 -1
- package/build/src/api.js +18 -24
- package/build/src/api.js.map +1 -1
- package/build/src/binding-post.js +337 -365
- package/build/src/binding-post.js.map +1 -1
- package/build/src/binding-redirect.js +312 -340
- package/build/src/binding-redirect.js.map +1 -1
- package/build/src/binding-simplesign.js +201 -229
- package/build/src/binding-simplesign.js.map +1 -1
- package/build/src/entity-idp.js +119 -127
- package/build/src/entity-idp.js.map +1 -1
- package/build/src/entity-sp.js +88 -96
- package/build/src/entity-sp.js.map +1 -1
- package/build/src/entity.js +193 -225
- package/build/src/entity.js.map +1 -1
- package/build/src/extractor.js +361 -369
- package/build/src/extractor.js.map +1 -1
- package/build/src/flow.js +313 -320
- package/build/src/flow.js.map +1 -1
- package/build/src/libsaml.js +693 -721
- package/build/src/libsaml.js.map +1 -1
- package/build/src/metadata-idp.js +119 -127
- package/build/src/metadata-idp.js.map +1 -1
- package/build/src/metadata-sp.js +223 -231
- package/build/src/metadata-sp.js.map +1 -1
- package/build/src/metadata.js +138 -166
- package/build/src/metadata.js.map +1 -1
- package/build/src/types.js +4 -11
- package/build/src/types.js.map +1 -1
- package/build/src/urn.js +204 -212
- package/build/src/urn.js.map +1 -1
- package/build/src/utility.js +277 -292
- package/build/src/utility.js.map +1 -1
- package/build/src/validator.js +24 -27
- package/build/src/validator.js.map +1 -1
- package/package.json +19 -14
- package/types/api.d.ts +15 -0
- package/types/api.d.ts.map +1 -0
- package/types/binding-post.d.ts +48 -0
- package/types/binding-post.d.ts.map +1 -0
- package/types/binding-redirect.d.ts +54 -0
- package/types/binding-redirect.d.ts.map +1 -0
- package/types/binding-simplesign.d.ts +41 -0
- package/types/binding-simplesign.d.ts.map +1 -0
- package/types/entity-idp.d.ts +38 -0
- package/types/entity-idp.d.ts.map +1 -0
- package/types/entity-sp.d.ts +38 -0
- package/types/entity-sp.d.ts.map +1 -0
- package/types/entity.d.ts +100 -0
- package/types/entity.d.ts.map +1 -0
- package/types/extractor.d.ts +26 -0
- package/types/extractor.d.ts.map +1 -0
- package/types/flow.d.ts +7 -0
- package/types/flow.d.ts.map +1 -0
- package/types/index.d.ts +11 -10
- package/types/index.d.ts.map +1 -0
- package/types/libsaml.d.ts +208 -0
- package/types/libsaml.d.ts.map +1 -0
- package/types/metadata-idp.d.ts +25 -0
- package/types/metadata-idp.d.ts.map +1 -0
- package/types/metadata-sp.d.ts +37 -0
- package/types/metadata-sp.d.ts.map +1 -0
- package/types/metadata.d.ts +58 -0
- package/types/metadata.d.ts.map +1 -0
- package/types/src/api.d.ts +15 -13
- package/types/src/api.d.ts.map +1 -0
- package/types/src/binding-post.d.ts +48 -47
- package/types/src/binding-post.d.ts.map +1 -0
- package/types/src/binding-redirect.d.ts +54 -53
- package/types/src/binding-redirect.d.ts.map +1 -0
- package/types/src/binding-simplesign.d.ts +41 -40
- package/types/src/binding-simplesign.d.ts.map +1 -0
- package/types/src/entity-idp.d.ts +38 -37
- package/types/src/entity-idp.d.ts.map +1 -0
- package/types/src/entity-sp.d.ts +38 -36
- package/types/src/entity-sp.d.ts.map +1 -0
- package/types/src/entity.d.ts +100 -101
- package/types/src/entity.d.ts.map +1 -0
- package/types/src/extractor.d.ts +26 -25
- package/types/src/extractor.d.ts.map +1 -0
- package/types/src/flow.d.ts +7 -6
- package/types/src/flow.d.ts.map +1 -0
- package/types/src/libsaml.d.ts +208 -209
- package/types/src/libsaml.d.ts.map +1 -0
- package/types/src/metadata-idp.d.ts +25 -24
- package/types/src/metadata-idp.d.ts.map +1 -0
- package/types/src/metadata-sp.d.ts +37 -36
- package/types/src/metadata-sp.d.ts.map +1 -0
- package/types/src/metadata.d.ts +58 -59
- package/types/src/metadata.d.ts.map +1 -0
- package/types/src/types.d.ts +128 -129
- package/types/src/types.d.ts.map +1 -0
- package/types/src/urn.d.ts +195 -194
- package/types/src/urn.d.ts.map +1 -0
- package/types/src/utility.d.ts +133 -134
- package/types/src/utility.d.ts.map +1 -0
- package/types/src/validator.d.ts +4 -3
- package/types/src/validator.d.ts.map +1 -0
- package/types/types.d.ts +128 -0
- package/types/types.d.ts.map +1 -0
- package/types/urn.d.ts +195 -0
- package/types/urn.d.ts.map +1 -0
- package/types/utility.d.ts +133 -0
- package/types/utility.d.ts.map +1 -0
- package/types/validator.d.ts +4 -0
- package/types/validator.d.ts.map +1 -0
- package/.editorconfig +0 -19
- package/.github/FUNDING.yml +0 -1
- package/.idea/inspectionProfiles/Project_Default.xml +0 -6
- package/.idea/modules.xml +0 -8
- package/.idea/vcs.xml +0 -6
- package/.pre-commit.sh +0 -15
- package/.snyk +0 -8
- package/.travis.yml +0 -29
- package/Makefile +0 -25
- package/index.d.ts +0 -10
- package/index.js +0 -19
- package/index.js.map +0 -1
- package/index.ts +0 -28
- package/qodana.yaml +0 -29
- package/src/.idea/src.iml +0 -12
- package/src/.idea/vcs.xml +0 -6
- package/src/api.ts +0 -36
- package/src/binding-post.ts +0 -348
- package/src/binding-redirect.ts +0 -356
- package/src/binding-simplesign.ts +0 -238
- package/src/entity-idp.ts +0 -153
- package/src/entity-sp.ts +0 -114
- package/src/entity.ts +0 -243
- package/src/extractor.ts +0 -392
- package/src/flow.ts +0 -467
- package/src/libsaml.ts +0 -895
- package/src/metadata-idp.ts +0 -146
- package/src/metadata-sp.ts +0 -268
- package/src/metadata.ts +0 -166
- package/src/types.ts +0 -153
- package/src/urn.ts +0 -211
- package/src/utility.ts +0 -319
- package/src/validator.ts +0 -39
- package/tsconfig.json +0 -38
- package/tslint.json +0 -35
- package/types.d.ts +0 -2
- /package/{.idea/samlify.iml → build/.idea/build.iml} +0 -0
|
@@ -1,40 +1,41 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file binding-simplesign.ts
|
|
3
|
-
* @author Orange
|
|
4
|
-
* @desc Binding-level API, declare the functions using POST SimpleSign binding
|
|
5
|
-
*/
|
|
6
|
-
import { BindingContext, SimpleSignComputedContext } from './entity.js';
|
|
7
|
-
export interface BuildSimpleSignConfig {
|
|
8
|
-
type: string;
|
|
9
|
-
context: string;
|
|
10
|
-
entitySetting: any;
|
|
11
|
-
relayState?: string;
|
|
12
|
-
}
|
|
13
|
-
export interface BindingSimpleSignContext {
|
|
14
|
-
id: string;
|
|
15
|
-
context: string;
|
|
16
|
-
signature: any;
|
|
17
|
-
sigAlg: string;
|
|
18
|
-
}
|
|
19
|
-
/**
|
|
20
|
-
* @desc Generate a base64 encoded login request
|
|
21
|
-
* @param {string} referenceTagXPath reference uri
|
|
22
|
-
* @param {object} entity object includes both idp and sp
|
|
23
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
24
|
-
*/
|
|
25
|
-
declare function base64LoginRequest(entity: any, customTagReplacement?: (template: string) => BindingContext): SimpleSignComputedContext;
|
|
26
|
-
/**
|
|
27
|
-
* @desc Generate a base64 encoded login response
|
|
28
|
-
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
29
|
-
* @param {object} entity object includes both idp and sp
|
|
30
|
-
* @param {object} user current logged user (e.g. req.user)
|
|
31
|
-
* @param {string} relayState the relay state
|
|
32
|
-
* @param {function} customTagReplacement used when developers have their own login response template
|
|
33
|
-
* @param AttributeStatement
|
|
34
|
-
*/
|
|
35
|
-
declare function base64LoginResponse(requestInfo: any, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext, AttributeStatement?: []): Promise<BindingSimpleSignContext>;
|
|
36
|
-
declare const simpleSignBinding: {
|
|
37
|
-
base64LoginRequest: typeof base64LoginRequest;
|
|
38
|
-
base64LoginResponse: typeof base64LoginResponse;
|
|
39
|
-
};
|
|
40
|
-
export default simpleSignBinding;
|
|
1
|
+
/**
|
|
2
|
+
* @file binding-simplesign.ts
|
|
3
|
+
* @author Orange
|
|
4
|
+
* @desc Binding-level API, declare the functions using POST SimpleSign binding
|
|
5
|
+
*/
|
|
6
|
+
import type { BindingContext, SimpleSignComputedContext } from './entity.js';
|
|
7
|
+
export interface BuildSimpleSignConfig {
|
|
8
|
+
type: string;
|
|
9
|
+
context: string;
|
|
10
|
+
entitySetting: any;
|
|
11
|
+
relayState?: string;
|
|
12
|
+
}
|
|
13
|
+
export interface BindingSimpleSignContext {
|
|
14
|
+
id: string;
|
|
15
|
+
context: string;
|
|
16
|
+
signature: any;
|
|
17
|
+
sigAlg: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @desc Generate a base64 encoded login request
|
|
21
|
+
* @param {string} referenceTagXPath reference uri
|
|
22
|
+
* @param {object} entity object includes both idp and sp
|
|
23
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
24
|
+
*/
|
|
25
|
+
declare function base64LoginRequest(entity: any, customTagReplacement?: (template: string) => BindingContext): SimpleSignComputedContext;
|
|
26
|
+
/**
|
|
27
|
+
* @desc Generate a base64 encoded login response
|
|
28
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
29
|
+
* @param {object} entity object includes both idp and sp
|
|
30
|
+
* @param {object} user current logged user (e.g. req.user)
|
|
31
|
+
* @param {string} relayState the relay state
|
|
32
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
33
|
+
* @param AttributeStatement
|
|
34
|
+
*/
|
|
35
|
+
declare function base64LoginResponse(requestInfo: any | undefined, entity: any, user?: any, relayState?: string, customTagReplacement?: (template: string) => BindingContext, AttributeStatement?: []): Promise<BindingSimpleSignContext>;
|
|
36
|
+
declare const simpleSignBinding: {
|
|
37
|
+
base64LoginRequest: typeof base64LoginRequest;
|
|
38
|
+
base64LoginResponse: typeof base64LoginResponse;
|
|
39
|
+
};
|
|
40
|
+
export default simpleSignBinding;
|
|
41
|
+
//# sourceMappingURL=binding-simplesign.d.ts.map
|
|
@@ -0,0 +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;AA6CD;;;;;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,CA6FtO;AAED,QAAA,MAAM,iBAAiB;;;CAGpB,CAAC;AAEJ,eAAe,iBAAiB,CAAC"}
|
|
@@ -1,37 +1,38 @@
|
|
|
1
|
-
import Entity, { ESamlHttpRequest } from './entity.js';
|
|
2
|
-
import { ServiceProviderConstructor as ServiceProvider, IdentityProviderMetadata, IdentityProviderSettings } from './types.js';
|
|
3
|
-
import { FlowResult } from './flow.js';
|
|
4
|
-
import { BindingContext } from './entity.js';
|
|
5
|
-
/**
|
|
6
|
-
* Identity provider can be configured using either metadata importing or idpSetting
|
|
7
|
-
*/
|
|
8
|
-
export default function (props: IdentityProviderSettings): IdentityProvider;
|
|
9
|
-
/**
|
|
10
|
-
* Identity provider can be configured using either metadata importing or idpSetting
|
|
11
|
-
*/
|
|
12
|
-
export declare class IdentityProvider extends Entity {
|
|
13
|
-
entityMeta: IdentityProviderMetadata;
|
|
14
|
-
constructor(idpSetting: IdentityProviderSettings);
|
|
15
|
-
/**
|
|
16
|
-
* @desc Generates the login response for developers to design their own method
|
|
17
|
-
* @param params
|
|
18
|
-
*/
|
|
19
|
-
createLoginResponse(params: {
|
|
20
|
-
sp: ServiceProvider;
|
|
21
|
-
requestInfo: Record<string, any>;
|
|
22
|
-
binding?: string;
|
|
23
|
-
user: Record<string, any>;
|
|
24
|
-
customTagReplacement?: (template: string) => BindingContext;
|
|
25
|
-
encryptThenSign?: boolean;
|
|
26
|
-
relayState?: string;
|
|
27
|
-
context: Record<string, any>;
|
|
28
|
-
AttributeStatement: [];
|
|
29
|
-
}): Promise<any>;
|
|
30
|
-
/**
|
|
31
|
-
* Validation of the parsed URL parameters
|
|
32
|
-
* @param sp ServiceProvider instance
|
|
33
|
-
* @param binding Protocol binding
|
|
34
|
-
* @param req RequesmessageSigningOrderst
|
|
35
|
-
*/
|
|
36
|
-
parseLoginRequest(sp: ServiceProvider, binding: string, req: ESamlHttpRequest): Promise<FlowResult>;
|
|
37
|
-
}
|
|
1
|
+
import Entity, { type ESamlHttpRequest } from './entity.js';
|
|
2
|
+
import { ServiceProviderConstructor as ServiceProvider, IdentityProviderMetadata, type IdentityProviderSettings } from './types.js';
|
|
3
|
+
import { type FlowResult } from './flow.js';
|
|
4
|
+
import type { BindingContext } from './entity.js';
|
|
5
|
+
/**
|
|
6
|
+
* Identity provider can be configured using either metadata importing or idpSetting
|
|
7
|
+
*/
|
|
8
|
+
export default function (props: IdentityProviderSettings): IdentityProvider;
|
|
9
|
+
/**
|
|
10
|
+
* Identity provider can be configured using either metadata importing or idpSetting
|
|
11
|
+
*/
|
|
12
|
+
export declare class IdentityProvider extends Entity {
|
|
13
|
+
entityMeta: IdentityProviderMetadata;
|
|
14
|
+
constructor(idpSetting: IdentityProviderSettings);
|
|
15
|
+
/**
|
|
16
|
+
* @desc Generates the login response for developers to design their own method
|
|
17
|
+
* @param params
|
|
18
|
+
*/
|
|
19
|
+
createLoginResponse(params: {
|
|
20
|
+
sp: ServiceProvider;
|
|
21
|
+
requestInfo: Record<string, any>;
|
|
22
|
+
binding?: string;
|
|
23
|
+
user: Record<string, any>;
|
|
24
|
+
customTagReplacement?: (template: string) => BindingContext;
|
|
25
|
+
encryptThenSign?: boolean;
|
|
26
|
+
relayState?: string;
|
|
27
|
+
context: Record<string, any>;
|
|
28
|
+
AttributeStatement: [];
|
|
29
|
+
}): Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* Validation of the parsed URL parameters
|
|
32
|
+
* @param sp ServiceProvider instance
|
|
33
|
+
* @param binding Protocol binding
|
|
34
|
+
* @param req RequesmessageSigningOrderst
|
|
35
|
+
*/
|
|
36
|
+
parseLoginRequest(sp: ServiceProvider, binding: string, req: ESamlHttpRequest): Promise<FlowResult>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=entity-idp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-idp.d.ts","sourceRoot":"","sources":["../../src/entity-idp.ts"],"names":[],"mappings":"AAYA,OAAO,MAAM,EAAE,EAAE,KAAK,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAC5D,OAAO,EACL,0BAA0B,IAAI,eAAe,EAE7C,wBAAwB,EACxB,KAAK,wBAAwB,EAC9B,MAAM,YAAY,CAAC;AAMpB,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAO,WAAW,CAAC;AAEnD,OAAO,KAAM,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEnD;;GAEG;AACH,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,wBAAwB,oBAEtD;AAED;;GAEG;AACH,qBAAa,gBAAiB,SAAQ,MAAM;IAElC,UAAU,EAAE,wBAAwB,CAAC;gBAEjC,UAAU,EAAE,wBAAwB;IAqChD;;;OAGG;IACU,mBAAmB,CAAC,MAAM,EAAC;QACtC,EAAE,EAAE,eAAe,CAAC;QACpB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QACjC,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC1B,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,CAAC;QAC5D,eAAe,CAAC,EAAE,OAAO,CAAC;QAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;QACpB,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;QAC7B,kBAAkB,EAAC,EAAE,CAAA;KACtB;IAyCD;;;;;OAKG;IACH,iBAAiB,CAAC,EAAE,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,gBAAgB;CAY9E"}
|
package/types/src/entity-sp.d.ts
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @file entity-sp.ts
|
|
3
|
-
* @author tngan
|
|
4
|
-
* @desc Declares the actions taken by service provider
|
|
5
|
-
*/
|
|
6
|
-
import Entity
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
* @
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
* @
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* @
|
|
25
|
-
* @param {
|
|
26
|
-
* @param {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
* @
|
|
32
|
-
* @param {
|
|
33
|
-
* @param {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
1
|
+
/**
|
|
2
|
+
* @file entity-sp.ts
|
|
3
|
+
* @author tngan
|
|
4
|
+
* @desc Declares the actions taken by service provider
|
|
5
|
+
*/
|
|
6
|
+
import Entity from './entity.js';
|
|
7
|
+
import type { BindingContext, PostBindingContext, ESamlHttpRequest, SimpleSignBindingContext } from './entity.js';
|
|
8
|
+
import { IdentityProviderConstructor as IdentityProvider, ServiceProviderMetadata, type ServiceProviderSettings } from './types.js';
|
|
9
|
+
import { type FlowResult } from './flow.js';
|
|
10
|
+
export default function (props: ServiceProviderSettings): ServiceProvider;
|
|
11
|
+
/**
|
|
12
|
+
* @desc Service provider can be configured using either metadata importing or spSetting
|
|
13
|
+
* @param {object} spSettingimport { FlowResult } from '../types/src/flow.d';
|
|
14
|
+
|
|
15
|
+
*/
|
|
16
|
+
export declare class ServiceProvider extends Entity {
|
|
17
|
+
entityMeta: ServiceProviderMetadata;
|
|
18
|
+
/**
|
|
19
|
+
* @desc Inherited from Entity
|
|
20
|
+
* @param {object} spSetting setting of service provider
|
|
21
|
+
*/
|
|
22
|
+
constructor(spSetting: ServiceProviderSettings);
|
|
23
|
+
/**
|
|
24
|
+
* @desc Generates the login request for developers to design their own method
|
|
25
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
26
|
+
* @param {string} binding protocol binding
|
|
27
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
28
|
+
*/
|
|
29
|
+
createLoginRequest(idp: IdentityProvider, binding?: string, customTagReplacement?: (template: string) => BindingContext): BindingContext | PostBindingContext | SimpleSignBindingContext;
|
|
30
|
+
/**
|
|
31
|
+
* @desc Validation of the parsed the URL parameters
|
|
32
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
33
|
+
* @param {string} binding protocol binding
|
|
34
|
+
* @param {request} req request
|
|
35
|
+
*/
|
|
36
|
+
parseLoginResponse(idp: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=entity-sp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity-sp.d.ts","sourceRoot":"","sources":["../../src/entity-sp.ts"],"names":[],"mappings":"AAAA;;;;EAIE;AACF,OAAO,MAEN,MAAM,aAAa,CAAC;AACrB,OAAQ,KAAK,EAAG,cAAc,EAC5B,kBAAkB,EAClB,gBAAgB,EAChB,wBAAwB,EAAE,MAAK,aAAa,CAAC;AAC/C,OAAO,EACL,2BAA2B,IAAI,gBAAgB,EAC/C,uBAAuB,EACvB,KAAK,uBAAuB,EAC7B,MAAM,YAAY,CAAC;AAKpB,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAO,WAAW,CAAC;AAKnD,MAAM,CAAC,OAAO,WAAU,KAAK,EAAE,uBAAuB,mBAErD;AAED;;;;EAIE;AACF,qBAAa,eAAgB,SAAQ,MAAM;IAChC,UAAU,EAAE,uBAAuB,CAAC;IAE7C;;;MAGE;gBACU,SAAS,EAAE,uBAAuB;IAS9C;;;;;MAKE;IACK,kBAAkB,CACvB,GAAG,EAAE,gBAAgB,EACrB,OAAO,SAAa,EACpB,oBAAoB,CAAC,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,cAAc,GAC1D,cAAc,GAAG,kBAAkB,GAAE,wBAAwB;IAkChE;;;;;MAKE;IACK,kBAAkB,CAAC,GAAG,KAAA,EAAE,OAAO,KAAA,EAAE,OAAO,EAAE,gBAAgB;CAalE"}
|
package/types/src/entity.d.ts
CHANGED
|
@@ -1,101 +1,100 @@
|
|
|
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
|
-
|
|
100
|
-
|
|
101
|
-
}
|
|
1
|
+
import { IdpMetadata as IdpMetadataConstructor } from './metadata-idp.js';
|
|
2
|
+
import { SpMetadata as SpMetadataConstructor } from './metadata-sp.js';
|
|
3
|
+
import type { MetadataIdpConstructor, MetadataSpConstructor, EntitySetting } from './types.js';
|
|
4
|
+
import { type FlowResult } from './flow.js';
|
|
5
|
+
export interface ESamlHttpRequest {
|
|
6
|
+
query?: any;
|
|
7
|
+
body?: any;
|
|
8
|
+
octetString?: string;
|
|
9
|
+
}
|
|
10
|
+
export interface BindingContext {
|
|
11
|
+
context: string;
|
|
12
|
+
id: string;
|
|
13
|
+
}
|
|
14
|
+
export interface PostBindingContext extends BindingContext {
|
|
15
|
+
relayState?: string;
|
|
16
|
+
entityEndpoint: string;
|
|
17
|
+
type: string;
|
|
18
|
+
}
|
|
19
|
+
export interface SimpleSignBindingContext extends PostBindingContext {
|
|
20
|
+
sigAlg?: string;
|
|
21
|
+
signature?: string;
|
|
22
|
+
keyInfo?: string;
|
|
23
|
+
}
|
|
24
|
+
export interface SimpleSignComputedContext extends BindingContext {
|
|
25
|
+
sigAlg?: string;
|
|
26
|
+
signature?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ParseResult {
|
|
29
|
+
samlContent: string;
|
|
30
|
+
extract: any;
|
|
31
|
+
sigAlg: string;
|
|
32
|
+
}
|
|
33
|
+
export type EntityConstructor = (MetadataIdpConstructor | MetadataSpConstructor) & {
|
|
34
|
+
metadata?: string | Buffer;
|
|
35
|
+
};
|
|
36
|
+
export default class Entity {
|
|
37
|
+
entitySetting: EntitySetting;
|
|
38
|
+
entityType: string;
|
|
39
|
+
entityMeta: IdpMetadataConstructor | SpMetadataConstructor;
|
|
40
|
+
/**
|
|
41
|
+
* @param entitySetting
|
|
42
|
+
* @param entityMeta is the entity metadata, deprecated after 2.0
|
|
43
|
+
*/
|
|
44
|
+
constructor(entitySetting: EntityConstructor, entityType: 'idp' | 'sp');
|
|
45
|
+
/**
|
|
46
|
+
* @desc Returns the setting of entity
|
|
47
|
+
* @return {object}
|
|
48
|
+
*/
|
|
49
|
+
getEntitySetting(): EntitySetting;
|
|
50
|
+
/**
|
|
51
|
+
* @desc Returns the xml string of entity metadata
|
|
52
|
+
* @return {string}
|
|
53
|
+
*/
|
|
54
|
+
getMetadata(): string;
|
|
55
|
+
/**
|
|
56
|
+
* @desc Exports the entity metadata into specified folder
|
|
57
|
+
* @param {string} exportFile indicates the file name
|
|
58
|
+
*/
|
|
59
|
+
exportMetadata(exportFile: string): void;
|
|
60
|
+
/** * @desc Verify fields with the one specified in metadata
|
|
61
|
+
* @param {string/[string]} field is a string or an array of string indicating the field value in SAML message
|
|
62
|
+
* @param {string} metaField is a string indicating the same field specified in metadata
|
|
63
|
+
* @return {boolean} True/False
|
|
64
|
+
*/
|
|
65
|
+
verifyFields(field: string | string[], metaField: string): boolean;
|
|
66
|
+
/** @desc Generates the logout request for developers to design their own method
|
|
67
|
+
* @param {ServiceProvider} sp object of service provider
|
|
68
|
+
* @param {string} binding protocol binding
|
|
69
|
+
* @param {object} user current logged user (e.g. user)
|
|
70
|
+
* @param {string} relayState the URL to which to redirect the user when logout is complete
|
|
71
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
72
|
+
*/
|
|
73
|
+
createLogoutRequest(targetEntity: any, binding: any, user: any, relayState?: string, customTagReplacement?: any): BindingContext | PostBindingContext;
|
|
74
|
+
/**
|
|
75
|
+
* @desc Generates the logout response for developers to design their own method
|
|
76
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
77
|
+
* @param {object} requestInfo corresponding request, used to obtain the id
|
|
78
|
+
* @param {string} relayState the URL to which to redirect the user when logout is complete.
|
|
79
|
+
* @param {string} binding protocol binding
|
|
80
|
+
* @param {function} customTagReplacement used when developers have their own login response template
|
|
81
|
+
*/
|
|
82
|
+
createLogoutResponse(target: any, requestInfo: any, binding: any, relayState?: string, customTagReplacement?: any): BindingContext | PostBindingContext;
|
|
83
|
+
/**
|
|
84
|
+
* @desc Validation of the parsed the URL parameters
|
|
85
|
+
* @param {IdentityProvider} idp object of identity provider
|
|
86
|
+
* @param {string} binding protocol binding
|
|
87
|
+
* @param {request} req request
|
|
88
|
+
* @return {Promise}
|
|
89
|
+
*/
|
|
90
|
+
parseLogoutRequest(from: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
91
|
+
/**
|
|
92
|
+
* @desc Validation of the parsed the URL parameters
|
|
93
|
+
* @param {object} config config for the parser
|
|
94
|
+
* @param {string} binding protocol binding
|
|
95
|
+
* @param {request} req request
|
|
96
|
+
* @return {Promise}
|
|
97
|
+
*/
|
|
98
|
+
parseLogoutResponse(from: any, binding: any, request: ESamlHttpRequest): Promise<FlowResult>;
|
|
99
|
+
}
|
|
100
|
+
//# sourceMappingURL=entity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entity.d.ts","sourceRoot":"","sources":["../../src/entity.ts"],"names":[],"mappings":"AAQA,OAAoB,EAAE,WAAW,IAAI,sBAAsB,EAAE,MAAM,mBAAmB,CAAC;AACvF,OAAmB,EAAE,UAAU,IAAI,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAGnF,OAAQ,KAAK,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChG,OAAO,EAAQ,KAAK,UAAU,EAAE,MAAO,WAAW,CAAC;AAoBnD,MAAM,WAAW,gBAAgB;IAC/B,KAAK,CAAC,EAAE,GAAG,CAAC;IACZ,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,CAAC;IAChB,EAAE,EAAE,MAAM,CAAC;CACZ;AAED,MAAM,WAAW,kBAAmB,SAAQ,cAAc;IACxD,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,wBAAyB,SAAQ,kBAAkB;IAClE,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,yBAA0B,SAAQ,cAAc;IAC/D,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,MAAM,iBAAiB,GAAG,CAAC,sBAAsB,GAAG,qBAAqB,CAAC,GAC5E;IAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAEnC,MAAM,CAAC,OAAO,OAAO,MAAM;IACzB,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,sBAAsB,GAAG,qBAAqB,CAAC;IAE3D;;;MAGE;gBACU,aAAa,EAAE,iBAAiB,EAAE,UAAU,EAAE,KAAK,GAAG,IAAI;IAsBtE;;;MAGE;IACF,gBAAgB;IAGhB;;;MAGE;IACF,WAAW,IAAI,MAAM;IAIrB;;;MAGE;IACF,cAAc,CAAC,UAAU,EAAE,MAAM;IAIjC;;;;MAIE;IACF,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,EAAE,SAAS,EAAE,MAAM,GAAG,OAAO;IAgBlE;;;;;;MAME;IACF,mBAAmB,CAAC,YAAY,KAAA,EAAE,OAAO,KAAA,EAAE,IAAI,KAAA,EAAE,UAAU,SAAK,EAAE,oBAAoB,CAAC,KAAA,GAAG,cAAc,GAAG,kBAAkB;IAqB7H;;;;;;;MAOE;IACF,oBAAoB,CAAC,MAAM,KAAA,EAAE,WAAW,KAAA,EAAE,OAAO,KAAA,EAAE,UAAU,SAAK,EAAE,oBAAoB,CAAC,KAAA,GAAG,cAAc,GAAG,kBAAkB;IAuB/H;;;;;;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/extractor.d.ts
CHANGED
|
@@ -1,25 +1,26 @@
|
|
|
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 {};
|
|
26
|
+
//# sourceMappingURL=extractor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"extractor.d.ts","sourceRoot":"","sources":["../../src/extractor.ts"],"names":[],"mappings":"AAKA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,EAAE,GAAG,MAAM,EAAE,EAAE,CAAC;IACjC,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,EAAE,CAAC;IACzB,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,MAAM,eAAe,GAAG,cAAc,EAAE,CAAC;AA4B/C,eAAO,MAAM,kBAAkB,EAAE,eA2BhC,CAAC;AAGF,eAAO,MAAM,yBAAyB;;;;GAWrC,CAAC;AAGF,eAAO,MAAM,0BAA0B;;;;GAWtC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,CAAC,CAAC,SAAS,EAAE,GAAG,KAAK,eAAe,CAiDrE,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,eA2BjC,CAAC;AAEF,eAAO,MAAM,oBAAoB,EAAE,eAiBlC,CAAC;AAEF,wBAAgB,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,KAAA,OAiM9C"}
|
package/types/src/flow.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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>;
|
|
7
|
+
//# sourceMappingURL=flow.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flow.d.ts","sourceRoot":"","sources":["../../src/flow.ts"],"names":[],"mappings":"AAyBA,MAAM,WAAW,UAAU;IACzB,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,GAAG,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,GAAC,IAAI,CAAE;CACvB;AA4ZD,wBAAgB,IAAI,CAAC,OAAO,KAAA,GAAG,OAAO,CAAC,UAAU,CAAC,CAyBjD"}
|