New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

angular-zxcvbn

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-zxcvbn - npm Package Compare versions

Comparing version 3.1.1 to 3.2.2

CHANGELOG

13

bower.json
{
"name": "angular-zxcvbn",
"version": "3.1.1",
"version": "3.2.2",
"authors": [
"Jose Luis Rivas <me@ghostbar.co>",
"James Clark <james.clark92@hotmail.co.uk"
"James Clark <james.clark92@hotmail.co.uk>"
],

@@ -26,4 +26,3 @@ "description": "Angular Directive for the zxcvbn library",

"gulpfile.js",
"History.md",
"karma.conf.js",
"CHANGELOG",
"LICENSE",

@@ -34,8 +33,8 @@ "package.json",

"devDependencies": {
"angular-mocks": "~1.5.0-rc.0"
"angular-mocks": "1.5.0"
},
"dependencies": {
"zxcvbn": "~4.2.0",
"angular": "~1.5.0-rc.0"
"zxcvbn": "4.4.0",
"angular": "~1.5.0"
}
}

@@ -56,4 +56,3 @@ (function () {

if (angular.isUndefined(scope.zxPassword)) {
console.log('Cant run zxcvbn because the password is not defined in the scope.');
return;
scope.zxPassword = '';
}

@@ -171,2 +170,2 @@

});
})();
})();

@@ -1,1 +0,1 @@

!function(){"use strict";angular.module("zxcvbn",[]).directive("zxcvbn",function(){return{scope:{password:"=",extras:"=?",data:"=?"},restrict:"E",template:"{{ display.crack_times_display }}",link:function(r,t,a){r.$watch("password",function(t){angular.isString(t)&&(r.extras?r.timeToCrack=zxcvbn(t,r.extras):r.timeToCrack=zxcvbn(t),"data"in a&&r.timeToCrack&&(r.data=angular.copy(r.timeToCrack)),r.display=angular.copy(r.timeToCrack))})}}})}(),function(){"use strict";angular.module("zxcvbn").directive("zxcvbn",function(){return{require:"ngModel",restrict:"A",scope:{zxResult:"=?zxcvbn",zxExtras:"=?",zxMinScore:"@?"},link:function(r,t,a,e){r.runZxcvbn=function(){return angular.isUndefined(r.zxPassword)?void console.log("Cant run zxcvbn because the password is not defined in the scope."):void(angular.isDefined(r.zxExtrasArray)&&r.zxExtrasArray.length>0?r.zxResult=zxcvbn(r.zxPassword,r.zxExtrasArray):r.zxResult=zxcvbn(r.zxPassword))},r.isForm=function(r){try{return"FormController"===Object.getPrototypeOf(r).constructor.name}catch(t){return!1}},r.setZxExtrasWatcher=function(){var t=r.zxExtras;angular.isFunction(r.zxExtrasWatcher)&&r.zxExtrasWatcher(),r.zxExtrasWatcher=void 0,angular.isDefined(t)&&(angular.isArray(t)?r.zxArrayWatcher():r.isForm(t)&&r.zxFormWatcher())},r.zxFormWatcher=function(){var t=r.zxExtras;console.assert(r.isForm(t),"zx-extras element is some how not a form."),r.zxExtrasWatcher=r.$watch(function(){var r=[],a=new RegExp("^(?!\\$|__)");for(var e in t)a.test(e)&&t[e].hasOwnProperty("$viewValue")&&-1===e.toLowerCase().indexOf("password")&&r.push(t[e].$viewValue);return r},function(t){r.zxExtrasArray=[];for(var a=0;a<t.length;a++)angular.isString(t[a])&&r.zxExtrasArray.push(t[a]);e.$validate()},!0)},r.zxArrayWatcher=function(){r.zxExtrasWatcher=r.$watch("zxExtras",function(t){r.zxExtrasArray=t,e.$validate()},!0)},r.setZxExtrasWatcher(),e.$validators.passwordStrength=function(t){var a=parseInt(r.zxMinScore);return a=isNaN(a)||0>a||a>4?0:a,r.zxPassword=t,r.runZxcvbn(),a<=r.zxResult.score},a.$observe("zxExtras",function(){r.setZxExtrasWatcher(),e.$validate()}),a.$observe("zxMinScore",function(t){r.zxMinScore=t,e.$validate()})}}})}();
!function(){"use strict";angular.module("zxcvbn",[]).directive("zxcvbn",function(){return{scope:{password:"=",extras:"=?",data:"=?"},restrict:"E",template:"{{ display.crack_times_display }}",link:function(r,a,t){r.$watch("password",function(a){angular.isString(a)&&(r.extras?r.timeToCrack=zxcvbn(a,r.extras):r.timeToCrack=zxcvbn(a),"data"in t&&r.timeToCrack&&(r.data=angular.copy(r.timeToCrack)),r.display=angular.copy(r.timeToCrack))})}}})}(),function(){"use strict";angular.module("zxcvbn").directive("zxcvbn",function(){return{require:"ngModel",restrict:"A",scope:{zxResult:"=?zxcvbn",zxExtras:"=?",zxMinScore:"@?"},link:function(r,a,t,e){r.runZxcvbn=function(){angular.isUndefined(r.zxPassword)&&(r.zxPassword=""),angular.isDefined(r.zxExtrasArray)&&r.zxExtrasArray.length>0?r.zxResult=zxcvbn(r.zxPassword,r.zxExtrasArray):r.zxResult=zxcvbn(r.zxPassword)},r.isForm=function(r){try{return"FormController"===Object.getPrototypeOf(r).constructor.name}catch(a){return!1}},r.setZxExtrasWatcher=function(){var a=r.zxExtras;angular.isFunction(r.zxExtrasWatcher)&&r.zxExtrasWatcher(),r.zxExtrasWatcher=void 0,angular.isDefined(a)&&(angular.isArray(a)?r.zxArrayWatcher():r.isForm(a)&&r.zxFormWatcher())},r.zxFormWatcher=function(){var a=r.zxExtras;console.assert(r.isForm(a),"zx-extras element is some how not a form."),r.zxExtrasWatcher=r.$watch(function(){var r=[],t=new RegExp("^(?!\\$|__)");for(var e in a)t.test(e)&&a[e].hasOwnProperty("$viewValue")&&-1===e.toLowerCase().indexOf("password")&&r.push(a[e].$viewValue);return r},function(a){r.zxExtrasArray=[];for(var t=0;t<a.length;t++)angular.isString(a[t])&&r.zxExtrasArray.push(a[t]);e.$validate()},!0)},r.zxArrayWatcher=function(){r.zxExtrasWatcher=r.$watch("zxExtras",function(a){r.zxExtrasArray=a,e.$validate()},!0)},r.setZxExtrasWatcher(),e.$validators.passwordStrength=function(a){var t=parseInt(r.zxMinScore);return t=isNaN(t)||0>t||t>4?0:t,r.zxPassword=a,r.runZxcvbn(),t<=r.zxResult.score},t.$observe("zxExtras",function(){r.setZxExtrasWatcher(),e.$validate()}),t.$observe("zxMinScore",function(a){r.zxMinScore=a,e.$validate()})}}})}();

@@ -16,4 +16,4 @@ /* jshint strict: false */

var srcFiles = ['./src/main/**/*.js'];
var testFiles = ['./src/test/**/*.js'];
var srcFiles = ['./src/*.js'];
var testFiles = ['./test/*.js'];
var srcAndTestFiles = srcFiles.concat(testFiles);

@@ -55,2 +55,9 @@

gulp.task('test-saucelabs', function (done) {
new Server({
configFile: __dirname + '/karma-saucelabs.conf.js',
singleRun: true
}, done).start();
});
gulp.task('tdd', function (done) {

@@ -60,2 +67,2 @@ new Server({

}, done).start();
});
});
'use strict';
module.exports = function (config) {
module.exports = function(config) {
config.set({
// base path, that will be used to resolve files and exclude
basePath: '',
// frameworks to use
frameworks: ['jasmine'],
reporters: ['progress', 'coverage'],
// list of files / patterns to load in the browser
files: [

@@ -16,23 +16,46 @@ 'bower_components/zxcvbn/dist/zxcvbn.js',

'bower_components/angular-mocks/angular-mocks.js',
'node_modules/phantomjs-polyfill/bind-polyfill.js',
'src/**/*.js'
'src/*.js',
'test/*.js'
],
exclude: [],
preprocessors: {
'src/main/**/*.js': ['coverage']
},
// list of files to exclude
exclude: [
],
// test results reporter to use
// possible values: 'dots', 'progress', 'junit', 'growl', 'coverage'
reporters: ['progress', 'coverage'],
coverageReporter: {
type: 'html',
dir: 'coverage/'
type : 'lcovonly',
dir : 'coverage/',
subdir: '.',
file: 'lcov.info'
},
preprocessors: {
'src/*.js': 'coverage'
},
// web server port
port: 9876,
// enable / disable colors in the output (reporters and logs)
colors: true,
// level of logging
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
logLevel: config.LOG_INFO,
autoWatch: true,
browsers: ['PhantomJS'],
singleRun: false
// enable / disable watching file and executing tests whenever any file changes
autoWatch: false,
// Continuous Integration mode
// if true, it capture browsers, run tests and exit
singleRun: false,
browsers: ['Firefox']
});
};
{
"name": "angular-zxcvbn",
"version": "3.1.1",
"version": "3.2.2",
"description": "Angular directive for the library zxcvbn",
"main": "dist/angular-zxcvbn.js",
"directories": {
"example": "example"
},
"devDependencies": {
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-concat": "^2.6.0",
"gulp-jshint": "^2.0.0",
"gulp-rename": "^1.2.2",
"gulp-uglify": "^1.5.1",
"jasmine-core": "^2.4.1",
"jshint": "^2.8.0",
"karma": "^0.13.15",
"karma-cli": "0.0.4",
"karma-coverage": "^0.5.3",
"karma-jasmine": "^0.2.2",
"karma-phantomjs-launcher": "^0.1.4",
"run-sequence": "^1.1.5",
"phantomjs-polyfill": "0.0.1"
},
"scripts": {
"test": "./node_modules/.bin/karma start --single-run"
"test": "grunt test"
},
"repository": {
"type": "git",
"url": "https://github.com/jamesclark92/angular-zxcvbn"
},
"keywords": [

@@ -40,9 +16,31 @@ "angular",

"Jose Luis Rivas <me@ghostbar.co>",
"James Clark <james.clark92@hotmail.co.uk"
"James Clark <james.clark92@hotmail.co.uk>",
"Giovanni Pellerano <giovanni.pellerano@evilaliv3.org>"
],
"license": "MIT",
"homepage": "https://github.com/ghostbar/angular-zxcvbn",
"repository": {
"type": "git",
"url": "https://github.com/ghostbar/angular-zxcvbn"
},
"bugs": {
"url": "https://github.com/jamesclark92/angular-zxcvbn/issues"
"url": "https://github.com/ghostbar/angular-zxcvbn/issues"
},
"homepage": "https://github.com/jamesclark92/angular-zxcvbn"
"devDependencies": {
"del": "2.2.0",
"gulp": "3.9.1",
"gulp-concat": "2.6.0",
"gulp-jshint": "2.0.0",
"gulp-rename": "1.2.2",
"gulp-uglify": "1.5.3",
"jasmine": "2.4.1",
"jshint": "^2.8.0",
"karma": "0.13.22",
"karma-cli": "0.1.2",
"karma-coverage": "0.5.5",
"karma-jasmine": "0.3.7",
"karma-firefox-launcher": "0.1.7",
"karma-sauce-launcher": "0.3.1",
"run-sequence": "^1.1.5"
}
}

@@ -1,3 +0,5 @@

# angular-zxcvbn [![Build Status](https://travis-ci.org/ghostbar/angular-zxcvbn.svg?branch=master)](https://travis-ci.org/ghostbar/angular-zxcvbn)
# angular-zxcvbn [![Build Status](https://travis-ci.org/ghostbar/angular-zxcvbn.svg)](https://travis-ci.org/ghostbar/angular-zxcvbn) [![Code Climate](https://codeclimate.com/github/ghostbar/angular-zxcvbn/badges/gpa.svg)](https://codeclimate.com/github/ghostbar/angular-zxcvbn) [![Test Coverage](https://codeclimate.com/github/ghostbar/angular-zxcvbn/badges/coverage.svg)](https://codeclimate.com/github/ghostbar/angular-zxcvbn/coverage)
[![Saucelabs Test Status](https://saucelabs.com/browser-matrix/angular-zxcvbn.svg)](https://saucelabs.com/u/angular-zxcvbn)
This is a simple directive for the [zxcvbn](https://github.com/dropbox/zxcvbn) library.

@@ -49,4 +51,4 @@

The directive has an optional attribute of `zx-extras`. This takes either an array or angular form object, which will be passed as the
optional argument to the `zxcvbn` call.
The directive has an optional attribute of `zx-extras`. This takes either an `array` or an [angular form object](https://docs.angularjs
.org/api/ng/type/form.FormController), which will be passed as the optional argument to the `zxcvbn` call.

@@ -65,9 +67,8 @@ > The optional argument is an array of strings that zxcvbn will treat as an extra dictionary. This can be whatever list of strings you like, but is meant for user inputs from other fields of the form, like name and email. That way a password that includes a user's personal information can be heavily penalized. This list is also good for site-specific vocabulary — Acme Brick Co. might want to include ['acme', 'brick', 'acmebrick', etc].

```
* Here you can see we give the 3rd input element the two attributes.
* We pass `zx-extras` the value `myForm`, which is the value of the `name` attribute of the parent form element - this allows the directive
to access the associated scope property.*
* `angular-zxcvbn` will look at all `<input>` elements with `name` and `ng-model` attributes inside the `<form>` element - *ignoring
We pass `zx-extras` the value `myForm`, which is the value of the `name` attribute of the parent `<form>` element.
`angular-zxcvbn` will look at all `<input>` elements with `name` and `ng-model` attributes inside the `<form>` element - *ignoring
fields with 'password' in their name*. Found fields are then used as the extras parameter in the zxcvbn call.
**Note:** if you do not wish to pass in a form object, you can also pass a scope variable that is an array of strings.
**Note:** if you do not wish to pass in a form object, you can also pass a scope variable that is an *array of strings*.

@@ -77,10 +78,14 @@ ---

If you have passed in a form object as the extras value, then you may also want to have the password field marked as invalid when below a certain score. This can be done in 2 ways:
If you are using the [AngularJS form directive](https://docs.angularjs.org/api/ng/directive/form) you may also want to have the password field marked as
invalid when below a certain score.
This can be done by passing a `zx-min-score` attribute, which takes an integer between 0 and 4 inclusive. For example: `zx-min-score="2"`
would invalidate passwords with scores 0 or 1.
```html
<input type="password" ng-model="password" name="password" zxcvbn="passwordStrength" zx-extras="myForm" zx-min-score="2"> // hard code the
value
<input type="password" ng-model="password" name="password" zxcvbn="passwordStrength" zx-extras="myForm" zx-min-score="{{ minScore }}"> // pass it a scope
variable
<input type="password" ng-model="password" name="password" zxcvbn="passwordStrength" zx-min-score="2">
```
You can also pass an interpolated scope value: `zx-min-score="{{ minScore }}"`
---

@@ -100,5 +105,5 @@ ### Element

## History ##
## Changelog ##
Refer to the [History.md](History.md) file.
Refer to the [CHANGELOG](CHANGELOG) file.

@@ -111,6 +116,8 @@ ## Author ##

2015, James Clark, <james.clark92@hotmail.co.uk>.
2015, James Clark, <james.clark92@hotmail.co.uk>
2016, Giovanni Pellerano, <giovanni.pellerano@evilaliv3.org>
## License ##
The files are licensed under the MIT terms.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc