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

Commit 0588eab

Browse files
committed
Moved owasp config into default and reverted other config files.
Modified config to be "shared". This will allow future configurations to be easily passed to the client.
1 parent 8dcf3f6 commit 0588eab

File tree

7 files changed

+14
-24
lines changed

7 files changed

+14
-24
lines changed

config/env/default.js

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,5 +46,15 @@ module.exports = {
4646
fileSize: 1 * 1024 * 1024 // Max file size in bytes (1 MB)
4747
}
4848
}
49+
},
50+
shared: {
51+
owasp: {
52+
allowPassphrases: true,
53+
maxLength: 128,
54+
minLength: 10,
55+
minPhraseLength: 20,
56+
minOptionalTestsToPass: 4
57+
}
4958
}
59+
5060
};

config/env/development.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,13 +58,6 @@ module.exports = {
5858
callbackURL: '/api/auth/paypal/callback',
5959
sandbox: true
6060
},
61-
owasp: {
62-
allowPassphrases: true,
63-
maxLength: 128,
64-
minLength: 4,
65-
minPhraseLength: 20,
66-
minOptionalTestsToPass: 2
67-
},
6861
mailer: {
6962
from: process.env.MAILER_FROM || 'MAILER_FROM',
7063
options: {

config/env/production.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -78,13 +78,6 @@ module.exports = {
7878
callbackURL: '/api/auth/paypal/callback',
7979
sandbox: false
8080
},
81-
owasp: {
82-
allowPassphrases: true,
83-
maxLength: 128,
84-
minLength: 10,
85-
minPhraseLength: 20,
86-
minOptionalTestsToPass: 4
87-
},
8881
mailer: {
8982
from: process.env.MAILER_FROM || 'MAILER_FROM',
9083
options: {

config/env/test.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,13 +59,6 @@ module.exports = {
5959
callbackURL: '/api/auth/paypal/callback',
6060
sandbox: true
6161
},
62-
owasp: {
63-
allowPassphrases: true,
64-
maxLength: 128,
65-
minLength: 10,
66-
minPhraseLength: 20,
67-
minOptionalTestsToPass: 4
68-
},
6962
mailer: {
7063
from: process.env.MAILER_FROM || 'MAILER_FROM',
7164
options: {

modules/core/server/controllers/core.server.controller.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ exports.renderIndex = function (req, res) {
2626

2727
res.render('modules/core/server/views/index', {
2828
user: JSON.stringify(safeUserObject),
29-
owaspConfig: JSON.stringify(config.owasp)
29+
sharedConfig: JSON.stringify(config.shared)
3030
});
3131
};
3232

modules/core/server/views/layout.server.view.html

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,8 @@
6868

6969
<!--owasp config sync-->
7070
<script type="text/javascript">
71-
owaspPasswordStrengthTest.config({{{ owaspConfig }}});
71+
var sharedConfig = {{{ sharedConfig }}};
72+
owaspPasswordStrengthTest.config(sharedConfig.owasp);
7273
</script>
7374

7475
{{#if livereload}}

modules/users/server/models/user.server.model.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var mongoose = require('mongoose'),
1212
generatePassword = require('generate-password'),
1313
owasp = require('owasp-password-strength-test');
1414

15-
owasp.config(config.owasp);
15+
owasp.config(config.shared.owasp);
1616

1717

1818
/**

0 commit comments

Comments
 (0)