From 09c6ab94b29a58a28defac99655a1675d7b61be4 Mon Sep 17 00:00:00 2001 From: Igor Losev Date: Mon, 11 Sep 2023 12:26:34 +0200 Subject: [PATCH] Added www-stage and www-prod hosts --- docs/content/releases/5.9.0.md | 4 ++++ lib/common/Configuration.js | 22 ++++++++++++++++++ lib/gateway/PortfolioGateway.js | 40 +++++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 docs/content/releases/5.9.0.md diff --git a/docs/content/releases/5.9.0.md b/docs/content/releases/5.9.0.md new file mode 100644 index 00000000..e0ec40f0 --- /dev/null +++ b/docs/content/releases/5.9.0.md @@ -0,0 +1,4 @@ +**New Features** + +* Added a `portfolio-www-stage.aws.barchart.com` hostname to the `PortfolioGateway` as `www-stage`. +* Added a `portfolio-www.aws.barchart.com` hostname to the `PortfolioGateway` as `www-prod`. diff --git a/lib/common/Configuration.js b/lib/common/Configuration.js index f10c13ed..3a23383d 100644 --- a/lib/common/Configuration.js +++ b/lib/common/Configuration.js @@ -45,6 +45,17 @@ module.exports = (() => { return 'portfolio-stage.aws.barchart.com'; } + /** + * The hostname of the REST API for the staging WWW environment (public use allowed). + * + * @public + * @static + * @returns {String} + */ + static get stagingWwwHost() { + return 'portfolio-www-stage.aws.barchart.com'; + } + /** * The hostname of the REST API for the demo environment (intended for Barchart use only). * @@ -67,6 +78,17 @@ module.exports = (() => { return 'portfolio.aws.barchart.com'; } + /** + * The hostname of the REST API for the production WWW environment (public use allowed). + * + * @public + * @static + * @returns {String} + */ + static get productionWwwHost() { + return 'portfolio-www.aws.barchart.com'; + } + /** * The hostname of the REST API for the admin environment (intended for Barchart use only). * diff --git a/lib/gateway/PortfolioGateway.js b/lib/gateway/PortfolioGateway.js index d6602490..f72e0e84 100644 --- a/lib/gateway/PortfolioGateway.js +++ b/lib/gateway/PortfolioGateway.js @@ -1296,6 +1296,26 @@ module.exports = (() => { }); } + /** + * Creates and starts a new {@link PortfolioGateway} for use in the private staging WWW environment. + * + * @public + * @ignore + * @static + * @param {JwtProvider} jwtProvider + * @param {String=} product + * @returns {Promise} + */ + static forStagingWww(jwtProvider, product) { + return Promise.resolve() + .then(() => { + assert.argumentIsRequired(jwtProvider, 'jwtProvider', JwtProvider, 'JwtProvider'); + assert.argumentIsOptional(product, 'product', String); + + return start(new PortfolioGateway(REST_API_SECURE_PROTOCOL, Configuration.stagingWwwHost, REST_API_SECURE_PORT, 'www-staging', product), jwtProvider); + }); + } + /** * Creates and starts a new {@link PortfolioGateway} for use in the public demo environment. * @@ -1334,6 +1354,26 @@ module.exports = (() => { }); } + /** + * Creates and starts a new {@link PortfolioGateway} for use in the private production WWW environment. + * + * @public + * @ignore + * @static + * @param {JwtProvider} jwtProvider + * @param {String=} product + * @returns {Promise} + */ + static forProductionWww(jwtProvider, product) { + return Promise.resolve() + .then(() => { + assert.argumentIsRequired(jwtProvider, 'jwtProvider', JwtProvider, 'JwtProvider'); + assert.argumentIsOptional(product, 'product', String); + + return start(new PortfolioGateway(REST_API_SECURE_PROTOCOL, Configuration.productionWwwHost, REST_API_SECURE_PORT, 'www-production', product), jwtProvider); + }); + } + /** * Creates and starts a new {@link PortfolioGateway} for use in the private admin environment. *