diff --git a/config/env/default.js b/config/env/default.js index a3e8c5e8cc..9aeb343e49 100644 --- a/config/env/default.js +++ b/config/env/default.js @@ -46,5 +46,15 @@ module.exports = { fileSize: 1 * 1024 * 1024 // Max file size in bytes (1 MB) } } + }, + shared: { + owasp: { + allowPassphrases: true, + maxLength: 128, + minLength: 10, + minPhraseLength: 20, + minOptionalTestsToPass: 4 + } } + }; diff --git a/config/env/development.js b/config/env/development.js index c60bc87c76..74526e5335 100644 --- a/config/env/development.js +++ b/config/env/development.js @@ -58,13 +58,6 @@ module.exports = { callbackURL: '/api/auth/paypal/callback', sandbox: true }, - owasp: { - allowPassphrases: true, - maxLength: 128, - minLength: 4, - minPhraseLength: 20, - minOptionalTestsToPass: 2 - }, mailer: { from: process.env.MAILER_FROM || 'MAILER_FROM', options: { diff --git a/config/env/production.js b/config/env/production.js index b7fb331cb7..3ad416ed2a 100644 --- a/config/env/production.js +++ b/config/env/production.js @@ -78,13 +78,6 @@ module.exports = { callbackURL: '/api/auth/paypal/callback', sandbox: false }, - owasp: { - allowPassphrases: true, - maxLength: 128, - minLength: 10, - minPhraseLength: 20, - minOptionalTestsToPass: 4 - }, mailer: { from: process.env.MAILER_FROM || 'MAILER_FROM', options: { diff --git a/config/env/test.js b/config/env/test.js index c3583ff6f9..f8fb5d7368 100644 --- a/config/env/test.js +++ b/config/env/test.js @@ -59,13 +59,6 @@ module.exports = { callbackURL: '/api/auth/paypal/callback', sandbox: true }, - owasp: { - allowPassphrases: true, - maxLength: 128, - minLength: 10, - minPhraseLength: 20, - minOptionalTestsToPass: 4 - }, mailer: { from: process.env.MAILER_FROM || 'MAILER_FROM', options: { diff --git a/modules/core/server/controllers/core.server.controller.js b/modules/core/server/controllers/core.server.controller.js index d4ca4094b4..c4a8973cac 100644 --- a/modules/core/server/controllers/core.server.controller.js +++ b/modules/core/server/controllers/core.server.controller.js @@ -26,7 +26,7 @@ exports.renderIndex = function (req, res) { res.render('modules/core/server/views/index', { user: JSON.stringify(safeUserObject), - owaspConfig: JSON.stringify(config.owasp) + sharedConfig: JSON.stringify(config.shared) }); }; diff --git a/modules/core/server/views/layout.server.view.html b/modules/core/server/views/layout.server.view.html index 75c995602a..13c822f465 100644 --- a/modules/core/server/views/layout.server.view.html +++ b/modules/core/server/views/layout.server.view.html @@ -68,7 +68,8 @@ {{#if livereload}} diff --git a/modules/users/server/models/user.server.model.js b/modules/users/server/models/user.server.model.js index ec33999078..16c3546e78 100644 --- a/modules/users/server/models/user.server.model.js +++ b/modules/users/server/models/user.server.model.js @@ -12,7 +12,7 @@ var mongoose = require('mongoose'), generatePassword = require('generate-password'), owasp = require('owasp-password-strength-test'); -owasp.config(config.owasp); +owasp.config(config.shared.owasp); /**