cloudcms-server 0.9.256 → 0.9.261
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.
- package/README.md +1 -1
- package/broadcast/providers/redis.js +24 -49
- package/clients/nrp.js +117 -0
- package/clients/redis.js +64 -0
- package/launchpad/index.js +161 -11
- package/launchpad/launchers/cluster.js +87 -109
- package/launchpad/launchers/redis.js +53 -0
- package/launchpad/launchers/single.js +30 -22
- package/locks/locks.js +4 -3
- package/locks/providers/cluster.js +1 -1
- package/locks/providers/memory.js +1 -1
- package/locks/providers/redis.js +62 -61
- package/middleware/admin/admin.js +2 -2
- package/middleware/authentication/providers/saml.js +2 -1
- package/middleware/awareness/awareness.js +12 -2
- package/middleware/awareness/providers/redis.js +224 -179
- package/middleware/cache/providers/redis.js +125 -68
- package/middleware/cloudcms/cloudcms.js +5 -1
- package/middleware/proxy/proxy.js +2 -1
- package/middleware/stores/stores.js +2 -2
- package/middleware/virtual-config/virtual-config.js +4 -4
- package/middleware/wcm/wcm.js +4 -4
- package/package.json +11 -7
- package/server/index.js +622 -591
- package/temp/clusterlock/index.js +2 -0
- package/temp/passport-saml/LICENSE +23 -0
- package/temp/passport-saml/README.md +406 -0
- package/temp/passport-saml/lib/node-saml/algorithms.d.ts +5 -0
- package/temp/passport-saml/lib/node-saml/algorithms.js +41 -0
- package/temp/passport-saml/lib/node-saml/algorithms.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/index.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/index.js +6 -0
- package/temp/passport-saml/lib/node-saml/index.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.d.ts +45 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js +86 -0
- package/temp/passport-saml/lib/node-saml/inmemory-cache-provider.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.js +15 -0
- package/temp/passport-saml/lib/node-saml/saml-post-signing.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/saml.d.ts +77 -0
- package/temp/passport-saml/lib/node-saml/saml.js +1170 -0
- package/temp/passport-saml/lib/node-saml/saml.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/types.d.ts +95 -0
- package/temp/passport-saml/lib/node-saml/types.js +8 -0
- package/temp/passport-saml/lib/node-saml/types.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/utility.d.ts +3 -0
- package/temp/passport-saml/lib/node-saml/utility.js +19 -0
- package/temp/passport-saml/lib/node-saml/utility.js.map +1 -0
- package/temp/passport-saml/lib/node-saml/xml.d.ts +21 -0
- package/temp/passport-saml/lib/node-saml/xml.js +140 -0
- package/temp/passport-saml/lib/node-saml/xml.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/index.d.ts +6 -0
- package/temp/passport-saml/lib/passport-saml/index.js +11 -0
- package/temp/passport-saml/lib/passport-saml/index.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.d.ts +13 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js +63 -0
- package/temp/passport-saml/lib/passport-saml/multiSamlStrategy.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/strategy.d.ts +20 -0
- package/temp/passport-saml/lib/passport-saml/strategy.js +167 -0
- package/temp/passport-saml/lib/passport-saml/strategy.js.map +1 -0
- package/temp/passport-saml/lib/passport-saml/types.d.ts +51 -0
- package/temp/passport-saml/lib/passport-saml/types.js +11 -0
- package/temp/passport-saml/lib/passport-saml/types.js.map +1 -0
- package/temp/passport-saml/package.json +96 -0
- package/util/auth.js +1 -1
- package/util/cloudcms.js +6 -6
- package/util/proxy-factory.js +22 -7
- package/util/redis.js +51 -1
- package/util/util.js +1 -1
- package/launchpad/launchers/sticky-cluster.js +0 -43
|
@@ -0,0 +1,15 @@
|
|
|
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
|
|
@@ -0,0 +1 @@
|
|
|
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"]}
|
|
@@ -0,0 +1,77 @@
|
|
|
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 };
|