Skip to content
This repository has been archived by the owner on Aug 30, 2021. It is now read-only.

Commit

Permalink
Moved owasp config into default and reverted other config files.
Browse files Browse the repository at this point in the history
Modified config to be "shared". This will allow future configurations to be easily passed to the client.
  • Loading branch information
wansco committed Sep 12, 2016
1 parent 8dcf3f6 commit 0588eab
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 24 deletions.
10 changes: 10 additions & 0 deletions config/env/default.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

};
7 changes: 0 additions & 7 deletions config/env/development.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
7 changes: 0 additions & 7 deletions config/env/production.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
7 changes: 0 additions & 7 deletions config/env/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -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: {
Expand Down
2 changes: 1 addition & 1 deletion modules/core/server/controllers/core.server.controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
});
};

Expand Down
3 changes: 2 additions & 1 deletion modules/core/server/views/layout.server.view.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@

<!--owasp config sync-->
<script type="text/javascript">
owaspPasswordStrengthTest.config({{{ owaspConfig }}});
var sharedConfig = {{{ sharedConfig }}};
owaspPasswordStrengthTest.config(sharedConfig.owasp);
</script>

{{#if livereload}}
Expand Down
2 changes: 1 addition & 1 deletion modules/users/server/models/user.server.model.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);


/**
Expand Down

0 comments on commit 0588eab

Please sign in to comment.