cloudcms-server 3.2.321 → 3.2.324

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.
Files changed (100) hide show
  1. package/README.md +1 -7
  2. package/index.js +0 -17
  3. package/middleware/authentication/authentication.js +0 -5
  4. package/middleware/authentication/providers/saml.js +8 -4
  5. package/middleware/config/adapter.js +0 -44
  6. package/middleware/deployment/deployment.js +0 -10
  7. package/middleware/registration/registration.js +0 -5
  8. package/middleware/stores/engines/empty.js +0 -4
  9. package/middleware/stores/engines/fs-caching-adapter.js +0 -5
  10. package/middleware/stores/engines/fs.js +0 -9
  11. package/middleware/stores/engines/s3.js +0 -5
  12. package/middleware/stores/engines/s3fs.js +0 -5
  13. package/middleware/stores/multistore.js +0 -29
  14. package/middleware/stores/store.js +0 -9
  15. package/middleware/virtual-config/virtual-config.js +127 -124
  16. package/old_package.json +119 -0
  17. package/package.json +44 -55
  18. package/server/index.js +42 -81
  19. package/server/standalone.js +0 -5
  20. package/util/util.js +12 -6
  21. package/duster/helpers/core/cloudcms/associations.js +0 -34
  22. package/duster/helpers/core/cloudcms/beta/markdown.js +0 -46
  23. package/duster/helpers/core/cloudcms/beta/nodeAttachmentText.js +0 -46
  24. package/duster/helpers/core/cloudcms/beta/params.js +0 -33
  25. package/duster/helpers/core/cloudcms/beta/processTemplate.js +0 -82
  26. package/duster/helpers/core/cloudcms/content.js +0 -34
  27. package/duster/helpers/core/cloudcms/expand.js +0 -38
  28. package/duster/helpers/core/cloudcms/form.js +0 -34
  29. package/duster/helpers/core/cloudcms/query.js +0 -34
  30. package/duster/helpers/core/cloudcms/queryOne.js +0 -34
  31. package/duster/helpers/core/cloudcms/relatives.js +0 -34
  32. package/duster/helpers/core/cloudcms/search.js +0 -34
  33. package/duster/helpers/core/cloudcms/searchOne.js +0 -34
  34. package/duster/helpers/core/cloudcms/wcm/dependency.js +0 -83
  35. package/duster/helpers/core/cloudcms/wcm/fragment.js +0 -34
  36. package/duster/helpers/core/dev/debug.js +0 -42
  37. package/duster/helpers/core/dom/block.js +0 -49
  38. package/duster/helpers/core/dom/include.js +0 -38
  39. package/duster/helpers/core/dom/layout.js +0 -49
  40. package/duster/helpers/core/dom/link.js +0 -81
  41. package/duster/helpers/core/dom/resource.js +0 -77
  42. package/duster/helpers/core/engine.js +0 -1580
  43. package/duster/helpers/core/ice/value.js +0 -65
  44. package/duster/helpers/core/index.js +0 -49
  45. package/duster/helpers/core/operators/if.js +0 -64
  46. package/duster/helpers/core/operators/iter.js +0 -45
  47. package/duster/helpers/core/operators/iterate.js +0 -129
  48. package/duster/helpers/sample/nyt.js +0 -114
  49. package/duster/index.js +0 -319
  50. package/duster/support.js +0 -436
  51. package/duster/tracker.js +0 -262
  52. package/middleware/authentication/providers/cas.js +0 -73
  53. package/middleware/authentication/providers/facebook.js +0 -120
  54. package/middleware/authentication/providers/github.js +0 -88
  55. package/middleware/authentication/providers/linkedin.js +0 -112
  56. package/middleware/authentication/providers/twitter.js +0 -120
  57. package/middleware/server-tags/server-tags.js +0 -113
  58. package/middleware/wcm/wcm.js +0 -1437
  59. package/temp/clusterlock/README.md +0 -6
  60. package/temp/clusterlock/index.js +0 -198
  61. package/temp/clusterlock/package.json +0 -24
  62. package/temp/passport-saml/LICENSE +0 -23
  63. package/temp/passport-saml/README.md +0 -406
  64. package/temp/passport-saml/lib/node-saml/algorithms.d.ts +0 -5
  65. package/temp/passport-saml/lib/node-saml/algorithms.js +0 -41
  66. package/temp/passport-saml/lib/node-saml/algorithms.js.map +0 -1
  67. package/temp/passport-saml/lib/node-saml/index.d.ts +0 -3
  68. package/temp/passport-saml/lib/node-saml/index.js +0 -6
  69. package/temp/passport-saml/lib/node-saml/index.js.map +0 -1
  70. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.d.ts +0 -45
  71. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js +0 -86
  72. package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js.map +0 -1
  73. package/temp/passport-saml/lib/node-saml/saml-post-signing.d.ts +0 -3
  74. package/temp/passport-saml/lib/node-saml/saml-post-signing.js +0 -15
  75. package/temp/passport-saml/lib/node-saml/saml-post-signing.js.map +0 -1
  76. package/temp/passport-saml/lib/node-saml/saml.d.ts +0 -77
  77. package/temp/passport-saml/lib/node-saml/saml.js +0 -1170
  78. package/temp/passport-saml/lib/node-saml/saml.js.map +0 -1
  79. package/temp/passport-saml/lib/node-saml/types.d.ts +0 -95
  80. package/temp/passport-saml/lib/node-saml/types.js +0 -8
  81. package/temp/passport-saml/lib/node-saml/types.js.map +0 -1
  82. package/temp/passport-saml/lib/node-saml/utility.d.ts +0 -3
  83. package/temp/passport-saml/lib/node-saml/utility.js +0 -19
  84. package/temp/passport-saml/lib/node-saml/utility.js.map +0 -1
  85. package/temp/passport-saml/lib/node-saml/xml.d.ts +0 -21
  86. package/temp/passport-saml/lib/node-saml/xml.js +0 -140
  87. package/temp/passport-saml/lib/node-saml/xml.js.map +0 -1
  88. package/temp/passport-saml/lib/passport-saml/index.d.ts +0 -6
  89. package/temp/passport-saml/lib/passport-saml/index.js +0 -11
  90. package/temp/passport-saml/lib/passport-saml/index.js.map +0 -1
  91. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.d.ts +0 -13
  92. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js +0 -63
  93. package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js.map +0 -1
  94. package/temp/passport-saml/lib/passport-saml/strategy.d.ts +0 -20
  95. package/temp/passport-saml/lib/passport-saml/strategy.js +0 -167
  96. package/temp/passport-saml/lib/passport-saml/strategy.js.map +0 -1
  97. package/temp/passport-saml/lib/passport-saml/types.d.ts +0 -51
  98. package/temp/passport-saml/lib/passport-saml/types.js +0 -11
  99. package/temp/passport-saml/lib/passport-saml/types.js.map +0 -1
  100. package/temp/passport-saml/package.json +0 -96
@@ -1,41 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getSigner = exports.getDigestAlgorithm = exports.getSigningAlgorithm = void 0;
4
- const crypto = require("crypto");
5
- function getSigningAlgorithm(shortName) {
6
- switch (shortName) {
7
- case "sha256":
8
- return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha256";
9
- case "sha512":
10
- return "http://www.w3.org/2001/04/xmldsig-more#rsa-sha512";
11
- case "sha1":
12
- default:
13
- return "http://www.w3.org/2000/09/xmldsig#rsa-sha1";
14
- }
15
- }
16
- exports.getSigningAlgorithm = getSigningAlgorithm;
17
- function getDigestAlgorithm(shortName) {
18
- switch (shortName) {
19
- case "sha256":
20
- return "http://www.w3.org/2001/04/xmlenc#sha256";
21
- case "sha512":
22
- return "http://www.w3.org/2001/04/xmlenc#sha512";
23
- case "sha1":
24
- default:
25
- return "http://www.w3.org/2000/09/xmldsig#sha1";
26
- }
27
- }
28
- exports.getDigestAlgorithm = getDigestAlgorithm;
29
- function getSigner(shortName) {
30
- switch (shortName) {
31
- case "sha256":
32
- return crypto.createSign("RSA-SHA256");
33
- case "sha512":
34
- return crypto.createSign("RSA-SHA512");
35
- case "sha1":
36
- default:
37
- return crypto.createSign("RSA-SHA1");
38
- }
39
- }
40
- exports.getSigner = getSigner;
41
- //# sourceMappingURL=algorithms.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"algorithms.js","sourceRoot":"","sources":["../../src/node-saml/algorithms.ts"],"names":[],"mappings":";;;AAAA,iCAAiC;AAEjC,SAAgB,mBAAmB,CAAC,SAAkB;IACpD,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,mDAAmD,CAAC;QAC7D,KAAK,QAAQ;YACX,OAAO,mDAAmD,CAAC;QAC7D,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,4CAA4C,CAAC;KACvD;AACH,CAAC;AAVD,kDAUC;AAED,SAAgB,kBAAkB,CAAC,SAAkB;IACnD,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,yCAAyC,CAAC;QACnD,KAAK,QAAQ;YACX,OAAO,yCAAyC,CAAC;QACnD,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,wCAAwC,CAAC;KACnD;AACH,CAAC;AAVD,gDAUC;AAED,SAAgB,SAAS,CAAC,SAAkB;IAC1C,QAAQ,SAAS,EAAE;QACjB,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QACzC,KAAK,QAAQ;YACX,OAAO,MAAM,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QACzC,KAAK,MAAM,CAAC;QACZ;YACE,OAAO,MAAM,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;KACxC;AACH,CAAC;AAVD,8BAUC","sourcesContent":["import * as crypto from \"crypto\";\n\nexport function getSigningAlgorithm(shortName?: string): string {\n switch (shortName) {\n case \"sha256\":\n return \"http://www.w3.org/2001/04/xmldsig-more#rsa-sha256\";\n case \"sha512\":\n return \"http://www.w3.org/2001/04/xmldsig-more#rsa-sha512\";\n case \"sha1\":\n default:\n return \"http://www.w3.org/2000/09/xmldsig#rsa-sha1\";\n }\n}\n\nexport function getDigestAlgorithm(shortName?: string): string {\n switch (shortName) {\n case \"sha256\":\n return \"http://www.w3.org/2001/04/xmlenc#sha256\";\n case \"sha512\":\n return \"http://www.w3.org/2001/04/xmlenc#sha512\";\n case \"sha1\":\n default:\n return \"http://www.w3.org/2000/09/xmldsig#sha1\";\n }\n}\n\nexport function getSigner(shortName?: string): crypto.Signer {\n switch (shortName) {\n case \"sha256\":\n return crypto.createSign(\"RSA-SHA256\");\n case \"sha512\":\n return crypto.createSign(\"RSA-SHA512\");\n case \"sha1\":\n default:\n return crypto.createSign(\"RSA-SHA1\");\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import type { CacheItem, CacheProvider } from "./inmemory-cache-provider";
2
- import { SAML } from "./saml";
3
- export { SAML, CacheItem, CacheProvider };
@@ -1,6 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SAML = void 0;
4
- const saml_1 = require("./saml");
5
- Object.defineProperty(exports, "SAML", { enumerable: true, get: function () { return saml_1.SAML; } });
6
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/node-saml/index.ts"],"names":[],"mappings":";;;AACA,iCAA8B;AAErB,qFAFA,WAAI,OAEA","sourcesContent":["import type { CacheItem, CacheProvider } from \"./inmemory-cache-provider\";\nimport { SAML } from \"./saml\";\n\nexport { SAML, CacheItem, CacheProvider };\n"]}
@@ -1,45 +0,0 @@
1
- /**
2
- * Simple in memory cache provider. To be used to store state of requests that needs
3
- * to be validated/checked when a response is received.
4
- *
5
- * This is the default implementation of a cache provider used by Passport-SAML. For
6
- * multiple server instances/load balanced scenarios (I.e. the SAML request could have
7
- * been generated from a different server/process handling the SAML response) this
8
- * implementation will NOT be sufficient.
9
- *
10
- * The caller should provide their own implementation for a cache provider as defined
11
- * in the config options for Passport-SAML.
12
- * @param options
13
- * @constructor
14
- */
15
- export interface CacheItem {
16
- value: string;
17
- createdAt: number;
18
- }
19
- interface CacheProviderOptions {
20
- keyExpirationPeriodMs: number;
21
- }
22
- export declare class CacheProvider {
23
- cacheKeys: Record<string, CacheItem>;
24
- options: CacheProviderOptions;
25
- constructor(options: Partial<CacheProviderOptions>);
26
- /**
27
- * Store an item in the cache, using the specified key and value.
28
- * Internally will keep track of the time the item was added to the cache
29
- * @param id
30
- * @param value
31
- */
32
- saveAsync(key: string, value: string): Promise<CacheItem | null>;
33
- /**
34
- * Returns the value of the specified key in the cache
35
- * @param id
36
- * @returns {boolean}
37
- */
38
- getAsync(key: string): Promise<string | null>;
39
- /**
40
- * Removes an item from the cache if it exists
41
- * @param key
42
- */
43
- removeAsync(key: string): Promise<string | null>;
44
- }
45
- export {};
@@ -1,86 +0,0 @@
1
- "use strict";
2
- /**
3
- * Simple in memory cache provider. To be used to store state of requests that needs
4
- * to be validated/checked when a response is received.
5
- *
6
- * This is the default implementation of a cache provider used by Passport-SAML. For
7
- * multiple server instances/load balanced scenarios (I.e. the SAML request could have
8
- * been generated from a different server/process handling the SAML response) this
9
- * implementation will NOT be sufficient.
10
- *
11
- * The caller should provide their own implementation for a cache provider as defined
12
- * in the config options for Passport-SAML.
13
- * @param options
14
- * @constructor
15
- */
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.CacheProvider = void 0;
18
- class CacheProvider {
19
- constructor(options) {
20
- var _a;
21
- this.cacheKeys = {};
22
- this.options = {
23
- ...options,
24
- keyExpirationPeriodMs: (_a = options === null || options === void 0 ? void 0 : options.keyExpirationPeriodMs) !== null && _a !== void 0 ? _a : 28800000, // 8 hours,
25
- };
26
- // Expire old cache keys
27
- const expirationTimer = setInterval(() => {
28
- const nowMs = new Date().getTime();
29
- const keys = Object.keys(this.cacheKeys);
30
- keys.forEach((key) => {
31
- if (nowMs >=
32
- new Date(this.cacheKeys[key].createdAt).getTime() + this.options.keyExpirationPeriodMs) {
33
- this.removeAsync(key);
34
- }
35
- });
36
- }, this.options.keyExpirationPeriodMs);
37
- // we only want this to run if the process is still open; it shouldn't hold the process open (issue #68)
38
- expirationTimer.unref();
39
- }
40
- /**
41
- * Store an item in the cache, using the specified key and value.
42
- * Internally will keep track of the time the item was added to the cache
43
- * @param id
44
- * @param value
45
- */
46
- async saveAsync(key, value) {
47
- if (!this.cacheKeys[key]) {
48
- this.cacheKeys[key] = {
49
- createdAt: new Date().getTime(),
50
- value: value,
51
- };
52
- return this.cacheKeys[key];
53
- }
54
- else {
55
- return null;
56
- }
57
- }
58
- /**
59
- * Returns the value of the specified key in the cache
60
- * @param id
61
- * @returns {boolean}
62
- */
63
- async getAsync(key) {
64
- if (this.cacheKeys[key]) {
65
- return this.cacheKeys[key].value;
66
- }
67
- else {
68
- return null;
69
- }
70
- }
71
- /**
72
- * Removes an item from the cache if it exists
73
- * @param key
74
- */
75
- async removeAsync(key) {
76
- if (this.cacheKeys[key]) {
77
- delete this.cacheKeys[key];
78
- return key;
79
- }
80
- else {
81
- return null;
82
- }
83
- }
84
- }
85
- exports.CacheProvider = CacheProvider;
86
- //# sourceMappingURL=inmemory-cache-provider.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"inmemory-cache-provider.js","sourceRoot":"","sources":["../../src/node-saml/inmemory-cache-provider.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;GAaG;;;AAWH,MAAa,aAAa;IAIxB,YAAY,OAAsC;;QAChD,IAAI,CAAC,SAAS,GAAG,EAAE,CAAC;QAEpB,IAAI,CAAC,OAAO,GAAG;YACb,GAAG,OAAO;YACV,qBAAqB,EAAE,MAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,qBAAqB,mCAAI,QAAQ,EAAE,WAAW;SAC/E,CAAC;QAEF,wBAAwB;QACxB,MAAM,eAAe,GAAG,WAAW,CAAC,GAAG,EAAE;YACvC,MAAM,KAAK,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CAAC;YACnC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;YACzC,IAAI,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE;gBACnB,IACE,KAAK;oBACL,IAAI,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,qBAAqB,EACtF;oBACA,IAAI,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;iBACvB;YACH,CAAC,CAAC,CAAC;QACL,CAAC,EAAE,IAAI,CAAC,OAAO,CAAC,qBAAqB,CAAC,CAAC;QAEvC,wGAAwG;QACxG,eAAe,CAAC,KAAK,EAAE,CAAC;IAC1B,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,SAAS,CAAC,GAAW,EAAE,KAAa;QACxC,IAAI,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;YACxB,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,GAAG;gBACpB,SAAS,EAAE,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE;gBAC/B,KAAK,EAAE,KAAK;aACb,CAAC;YACF,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;SAC5B;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,QAAQ,CAAC,GAAW;QACxB,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC;SAClC;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,WAAW,CAAC,GAAW;QAC3B,IAAI,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,EAAE;YACvB,OAAO,IAAI,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC;YAC3B,OAAO,GAAG,CAAC;SACZ;aAAM;YACL,OAAO,IAAI,CAAC;SACb;IACH,CAAC;CACF;AAzED,sCAyEC","sourcesContent":["/**\n * Simple in memory cache provider. To be used to store state of requests that needs\n * to be validated/checked when a response is received.\n *\n * This is the default implementation of a cache provider used by Passport-SAML. For\n * multiple server instances/load balanced scenarios (I.e. the SAML request could have\n * been generated from a different server/process handling the SAML response) this\n * implementation will NOT be sufficient.\n *\n * The caller should provide their own implementation for a cache provider as defined\n * in the config options for Passport-SAML.\n * @param options\n * @constructor\n */\n\nexport interface CacheItem {\n value: string;\n createdAt: number;\n}\n\ninterface CacheProviderOptions {\n keyExpirationPeriodMs: number;\n}\n\nexport class CacheProvider {\n cacheKeys: Record<string, CacheItem>;\n options: CacheProviderOptions;\n\n constructor(options: Partial<CacheProviderOptions>) {\n this.cacheKeys = {};\n\n this.options = {\n ...options,\n keyExpirationPeriodMs: options?.keyExpirationPeriodMs ?? 28800000, // 8 hours,\n };\n\n // Expire old cache keys\n const expirationTimer = setInterval(() => {\n const nowMs = new Date().getTime();\n const keys = Object.keys(this.cacheKeys);\n keys.forEach((key) => {\n if (\n nowMs >=\n new Date(this.cacheKeys[key].createdAt).getTime() + this.options.keyExpirationPeriodMs\n ) {\n this.removeAsync(key);\n }\n });\n }, this.options.keyExpirationPeriodMs);\n\n // we only want this to run if the process is still open; it shouldn't hold the process open (issue #68)\n expirationTimer.unref();\n }\n\n /**\n * Store an item in the cache, using the specified key and value.\n * Internally will keep track of the time the item was added to the cache\n * @param id\n * @param value\n */\n async saveAsync(key: string, value: string): Promise<CacheItem | null> {\n if (!this.cacheKeys[key]) {\n this.cacheKeys[key] = {\n createdAt: new Date().getTime(),\n value: value,\n };\n return this.cacheKeys[key];\n } else {\n return null;\n }\n }\n\n /**\n * Returns the value of the specified key in the cache\n * @param id\n * @returns {boolean}\n */\n async getAsync(key: string): Promise<string | null> {\n if (this.cacheKeys[key]) {\n return this.cacheKeys[key].value;\n } else {\n return null;\n }\n }\n\n /**\n * Removes an item from the cache if it exists\n * @param key\n */\n async removeAsync(key: string): Promise<string | null> {\n if (this.cacheKeys[key]) {\n delete this.cacheKeys[key];\n return key;\n } else {\n return null;\n }\n }\n}\n"]}
@@ -1,3 +0,0 @@
1
- import { SamlSigningOptions } from "./types";
2
- export declare function signSamlPost(samlMessage: string, xpath: string, options: SamlSigningOptions): string;
3
- export declare function signAuthnRequestPost(authnRequest: string, options: SamlSigningOptions): string;
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.signAuthnRequestPost = exports.signSamlPost = void 0;
4
- const xml_1 = require("./xml");
5
- const authnRequestXPath = '/*[local-name(.)="AuthnRequest" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:protocol"]';
6
- const issuerXPath = '/*[local-name(.)="Issuer" and namespace-uri(.)="urn:oasis:names:tc:SAML:2.0:assertion"]';
7
- function signSamlPost(samlMessage, xpath, options) {
8
- return (0, xml_1.signXml)(samlMessage, xpath, { reference: xpath + issuerXPath, action: "after" }, options);
9
- }
10
- exports.signSamlPost = signSamlPost;
11
- function signAuthnRequestPost(authnRequest, options) {
12
- return signSamlPost(authnRequest, authnRequestXPath, options);
13
- }
14
- exports.signAuthnRequestPost = signAuthnRequestPost;
15
- //# sourceMappingURL=saml-post-signing.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"saml-post-signing.js","sourceRoot":"","sources":["../../src/node-saml/saml-post-signing.ts"],"names":[],"mappings":";;;AACA,+BAAgC;AAEhC,MAAM,iBAAiB,GACrB,8FAA8F,CAAC;AACjG,MAAM,WAAW,GACf,yFAAyF,CAAC;AAE5F,SAAgB,YAAY,CAC1B,WAAmB,EACnB,KAAa,EACb,OAA2B;IAE3B,OAAO,IAAA,aAAO,EAAC,WAAW,EAAE,KAAK,EAAE,EAAE,SAAS,EAAE,KAAK,GAAG,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,EAAE,OAAO,CAAC,CAAC;AACnG,CAAC;AAND,oCAMC;AAED,SAAgB,oBAAoB,CAAC,YAAoB,EAAE,OAA2B;IACpF,OAAO,YAAY,CAAC,YAAY,EAAE,iBAAiB,EAAE,OAAO,CAAC,CAAC;AAChE,CAAC;AAFD,oDAEC","sourcesContent":["import { SamlSigningOptions } from \"./types\";\nimport { signXml } from \"./xml\";\n\nconst authnRequestXPath =\n '/*[local-name(.)=\"AuthnRequest\" and namespace-uri(.)=\"urn:oasis:names:tc:SAML:2.0:protocol\"]';\nconst issuerXPath =\n '/*[local-name(.)=\"Issuer\" and namespace-uri(.)=\"urn:oasis:names:tc:SAML:2.0:assertion\"]';\n\nexport function signSamlPost(\n samlMessage: string,\n xpath: string,\n options: SamlSigningOptions\n): string {\n return signXml(samlMessage, xpath, { reference: xpath + issuerXPath, action: \"after\" }, options);\n}\n\nexport function signAuthnRequestPost(authnRequest: string, options: SamlSigningOptions): string {\n return signSamlPost(authnRequest, authnRequestXPath, options);\n}\n"]}
@@ -1,77 +0,0 @@
1
- /// <reference types="node" />
2
- import * as querystring from "querystring";
3
- import { CacheProvider as InMemoryCacheProvider } from "./inmemory-cache-provider";
4
- import { ParsedQs } from "qs";
5
- import { SamlOptions } from "./types";
6
- import { AuthenticateOptions, AuthorizeOptions, Profile, SamlConfig } from "../passport-saml/types";
7
- interface NameID {
8
- value: string | null;
9
- format: string | null;
10
- }
11
- declare class SAML {
12
- options: SamlOptions;
13
- cacheProvider: InMemoryCacheProvider;
14
- constructor(ctorOptions: SamlConfig);
15
- initialize(ctorOptions: SamlConfig): SamlOptions;
16
- private getCallbackUrl;
17
- _generateUniqueID(): string;
18
- private generateInstant;
19
- private signRequest;
20
- private generateAuthorizeRequestAsync;
21
- _generateLogoutRequest(user: Profile): Promise<string>;
22
- _generateLogoutResponse(logoutRequest: Profile): string;
23
- _requestToUrlAsync(request: string | null | undefined, response: string | null, operation: string, additionalParameters: querystring.ParsedUrlQuery): Promise<string>;
24
- _getAdditionalParams(RelayState: string, operation: string, overrideParams?: querystring.ParsedUrlQuery): querystring.ParsedUrlQuery;
25
- getAuthorizeUrlAsync(RelayState: string, host: string | undefined, options: AuthorizeOptions): Promise<string>;
26
- getAuthorizeFormAsync(RelayState: string, host?: string): Promise<string>;
27
- getLogoutUrlAsync(user: Profile, RelayState: string, options: AuthenticateOptions & AuthorizeOptions): Promise<string>;
28
- getLogoutResponseUrl(samlLogoutRequest: Profile, RelayState: string, options: AuthenticateOptions & AuthorizeOptions, callback: (err: Error | null, url?: string | null) => void): void;
29
- private getLogoutResponseUrlAsync;
30
- _certToPEM(cert: string): string;
31
- private certsToCheck;
32
- validateSignature(fullXml: string, currentNode: Element, certs: string[]): boolean;
33
- validatePostResponseAsync(container: Record<string, string>): Promise<{
34
- profile?: Profile | null;
35
- loggedOut?: boolean;
36
- }>;
37
- private validateInResponseTo;
38
- validateRedirectAsync(container: ParsedQs, originalQuery: string | null): Promise<{
39
- profile?: Profile | null;
40
- loggedOut?: boolean;
41
- }>;
42
- private hasValidSignatureForRedirect;
43
- private validateSignatureForRedirect;
44
- private verifyLogoutRequest;
45
- private verifyLogoutResponse;
46
- private verifyIssuer;
47
- private processValidlySignedAssertionAsync;
48
- private checkTimestampsValidityError;
49
- private checkAudienceValidityError;
50
- validatePostRequestAsync(container: Record<string, string>): Promise<{
51
- profile?: Profile;
52
- loggedOut?: boolean;
53
- }>;
54
- _getNameIdAsync(self: SAML, doc: Node): Promise<NameID>;
55
- generateServiceProviderMetadata(decryptionCert: string | null, signingCert?: string | null): string;
56
- _keyToPEM(key: string | Buffer): typeof key extends string | Buffer ? string | Buffer : Error;
57
- /**
58
- * Process max age assertion and use it if it is more restrictive than the NotOnOrAfter age
59
- * assertion received in the SAMLResponse.
60
- *
61
- * @param maxAssertionAgeMs Max time after IssueInstant that we will accept assertion, in Ms.
62
- * @param notOnOrAfter Expiration provided in response.
63
- * @param issueInstant Time when response was issued.
64
- * @returns {*} The expiration time to be used, in Ms.
65
- */
66
- private processMaxAgeAssertionTime;
67
- /**
68
- * Convert a date string to a timestamp (in milliseconds).
69
- *
70
- * @param dateString A string representation of a date
71
- * @param label Descriptive name of the date being passed in, e.g. "NotOnOrAfter"
72
- * @throws Will throw an error if parsing `dateString` returns `NaN`
73
- * @returns {number} The timestamp (in milliseconds) representation of the given date
74
- */
75
- private dateStringToTimestamp;
76
- }
77
- export { SAML };