Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PAY-480][PAY-482][PAY-488][PAY-503][PAY-520][PAY-588] Activate premium content middleware #3841

Merged
merged 16 commits into from
Sep 27, 2022
2 changes: 1 addition & 1 deletion creator-node/src/apiSigning.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const recoverWallet = (data, signature) => {

/**
* Returns boolean indicating if provided timestamp is older than maxTTL
* @param {string} signatureTimestamp unix timestamp string when signature was generated
* @param {number} signatureTimestamp unix timestamp string when signature was generated
*/
const signatureHasExpired = (
signatureTimestamp,
Expand Down
7 changes: 7 additions & 0 deletions creator-node/src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@ const {
const healthCheckRoutes = require('./components/healthCheck/healthCheckController')
const contentBlacklistRoutes = require('./components/contentBlacklist/contentBlacklistController')
const replicaSetRoutes = require('./components/replicaSet/replicaSetController')
const {
PremiumContentAccessChecker
} = require('./premiumContent/premiumContentAccessChecker')

function errorHandler(err, req, res, next) {
req.logger.error('Internal server error')
Expand Down Expand Up @@ -199,6 +202,10 @@ const initializeApp = (port, serviceRegistry) => {
// https://expressjs.com/en/guide/behind-proxies.html
app.set('trust proxy', true)

// Initialize premium content access checker and make accessible via app handle
const premiumContentAccessChecker = new PremiumContentAccessChecker()
app.set('premiumContentAccessChecker', premiumContentAccessChecker)

SidSethi marked this conversation as resolved.
Show resolved Hide resolved
const server = app.listen(port, () =>
logger.info(`Listening on port ${port}...`)
)
Expand Down