owasp-password-strength-test
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -97,2 +97,4 @@ (function(exports) { | ||
errors : [], | ||
failedTests : [], | ||
passedTests : [], | ||
isPassphrase : false, | ||
@@ -104,2 +106,3 @@ strong : true, | ||
// Always submit the password/passphrase to the required tests | ||
var i = 0; | ||
this.tests.required.forEach(function(test) { | ||
@@ -110,3 +113,7 @@ var err = test(password); | ||
result.errors.push(err); | ||
result.failedTests.push(i); | ||
} else { | ||
result.passedTests.push(i); | ||
} | ||
i++; | ||
}); | ||
@@ -125,2 +132,3 @@ | ||
if (!result.isPassphrase) { | ||
var j = this.tests.required.length; | ||
this.tests.optional.forEach(function(test) { | ||
@@ -130,5 +138,8 @@ var err = test(password); | ||
result.errors.push(err); | ||
result.failedTests.push(j); | ||
} else { | ||
result.optionalTestsPassed++; | ||
result.passedTests.push(j); | ||
} | ||
j++; | ||
}); | ||
@@ -135,0 +146,0 @@ } |
{ | ||
"name": "owasp-password-strength-test", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "A password-strength tester based upon the OWASP guidelines for enforcing strong passwords.", | ||
@@ -5,0 +5,0 @@ "main": "owasp-password-strength-test.js", |
@@ -72,3 +72,3 @@ OWASP Password Strength Test | ||
// `window.owaspPasswordStrengthTest` object availble. | ||
var result = owaspPasswordStrenghTest.test('correct horse battery staple'); | ||
var result = owaspPasswordStrengthTest.test('correct horse battery staple'); | ||
``` | ||
@@ -81,2 +81,4 @@ | ||
errors : [], | ||
failedTests : [], | ||
passedTests : [ 0, 1, 2, 3, 4, 5, 6 ], | ||
isPassphrase : false, | ||
@@ -94,10 +96,12 @@ strong : true, | ||
errors: [ | ||
'The password must be at least 10 characters long.', | ||
'The password must contain at least one uppercase letter.', | ||
'The password must contain at least one number.', | ||
'The password must contain at least one special character.' | ||
], | ||
isPassphrase : false, | ||
strong : false, | ||
optionalTestsPassed : 1 | ||
'The password must be at least 10 characters long.', | ||
'The password must contain at least one uppercase letter.', | ||
'The password must contain at least one number.', | ||
'The password must contain at least one special character.' | ||
], | ||
failedTests : [ 0, 4, 5, 6 ], | ||
passedTests : [ 1, 2, 3 ], | ||
isPassphrase : false, | ||
strong : false, | ||
optionalTestsPassed : 1 | ||
} | ||
@@ -111,2 +115,8 @@ ``` | ||
- `failedTests` enumerates which tests have failed, beginning from 0 with the | ||
first required test | ||
- `passedTests` enumerates which tests have succeeded, beginning from 0 with | ||
the first required test | ||
- `isPassphrase` is a `boolean` indicating whether or not the password was | ||
@@ -113,0 +123,0 @@ considered to be a passphrase. |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16903
159
223