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.

Files changed (60) hide show
  1. package/build/.idea/workspace.xml +13 -1
  2. package/build/index.js +54 -64
  3. package/build/index.js.map +1 -1
  4. package/build/src/api.js +24 -23
  5. package/build/src/api.js.map +1 -1
  6. package/build/src/binding-post.js +358 -368
  7. package/build/src/binding-post.js.map +1 -1
  8. package/build/src/binding-redirect.js +333 -332
  9. package/build/src/binding-redirect.js.map +1 -1
  10. package/build/src/binding-simplesign.js +222 -232
  11. package/build/src/binding-simplesign.js.map +1 -1
  12. package/build/src/entity-idp.js +130 -130
  13. package/build/src/entity-idp.js.map +1 -1
  14. package/build/src/entity-sp.js +96 -96
  15. package/build/src/entity-sp.js.map +1 -1
  16. package/build/src/entity.js +225 -235
  17. package/build/src/entity.js.map +1 -1
  18. package/build/src/extractor.js +385 -369
  19. package/build/src/extractor.js.map +1 -1
  20. package/build/src/flow.js +320 -319
  21. package/build/src/flow.js.map +1 -1
  22. package/build/src/libsaml.js +665 -641
  23. package/build/src/libsaml.js.map +1 -1
  24. package/build/src/metadata-idp.js +127 -127
  25. package/build/src/metadata-idp.js.map +1 -1
  26. package/build/src/metadata-sp.js +231 -231
  27. package/build/src/metadata-sp.js.map +1 -1
  28. package/build/src/metadata.js +166 -176
  29. package/build/src/metadata.js.map +1 -1
  30. package/build/src/types.js +11 -11
  31. package/build/src/urn.js +212 -212
  32. package/build/src/urn.js.map +1 -1
  33. package/build/src/utility.js +292 -248
  34. package/build/src/utility.js.map +1 -1
  35. package/build/src/validator.js +27 -26
  36. package/build/src/validator.js.map +1 -1
  37. package/package.json +8 -10
  38. package/src/api.ts +1 -1
  39. package/src/binding-redirect.ts +83 -64
  40. package/src/extractor.ts +23 -5
  41. package/src/libsaml.ts +95 -62
  42. package/src/utility.ts +147 -76
  43. package/types/index.d.ts +10 -10
  44. package/types/src/api.d.ts +13 -13
  45. package/types/src/binding-post.d.ts +46 -46
  46. package/types/src/binding-redirect.d.ts +52 -52
  47. package/types/src/binding-simplesign.d.ts +39 -39
  48. package/types/src/entity-idp.d.ts +42 -42
  49. package/types/src/entity-sp.d.ts +36 -36
  50. package/types/src/entity.d.ts +101 -99
  51. package/types/src/extractor.d.ts +25 -25
  52. package/types/src/flow.d.ts +6 -6
  53. package/types/src/libsaml.d.ts +200 -210
  54. package/types/src/metadata-idp.d.ts +24 -24
  55. package/types/src/metadata-sp.d.ts +36 -36
  56. package/types/src/metadata.d.ts +59 -57
  57. package/types/src/types.d.ts +129 -127
  58. package/types/src/urn.d.ts +194 -194
  59. package/types/src/utility.d.ts +134 -134
  60. package/types/src/validator.d.ts +3 -3
@@ -1,99 +1,101 @@
1
- import { IdpMetadata as IdpMetadataConstructor } from './metadata-idp.js';
2
- import { SpMetadata as SpMetadataConstructor } from './metadata-sp.js';
3
- import { MetadataIdpConstructor, MetadataSpConstructor, EntitySetting } from './types.js';
4
- import { 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
- }
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
+ }
@@ -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 {};
@@ -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>;