Skip to content

Commit

Permalink
Added www-stage and www-prod hosts
Browse files Browse the repository at this point in the history
  • Loading branch information
Igor-Losev committed Sep 11, 2023
1 parent dbba348 commit 09c6ab9
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
4 changes: 4 additions & 0 deletions docs/content/releases/5.9.0.md
Original file line number Diff line number Diff line change
@@ -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`.
22 changes: 22 additions & 0 deletions lib/common/Configuration.js
Original file line number Diff line number Diff line change
Expand Up @@ -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).
*
Expand All @@ -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).
*
Expand Down
40 changes: 40 additions & 0 deletions lib/gateway/PortfolioGateway.js
Original file line number Diff line number Diff line change
Expand Up @@ -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<PortfolioGateway>}
*/
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.
*
Expand Down Expand Up @@ -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<PortfolioGateway>}
*/
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.
*
Expand Down

0 comments on commit 09c6ab9

Please sign in to comment.