{"id":23301596,"url":"https://github.com/jdforsythe/angular-password-enforcement","last_synced_at":"2025-09-04T03:39:21.162Z","repository":{"id":58216233,"uuid":"57409609","full_name":"jdforsythe/angular-password-enforcement","owner":"jdforsythe","description":null,"archived":false,"fork":false,"pushed_at":"2016-04-30T18:47:20.000Z","size":11,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-06T23:05:43.117Z","etag":null,"topics":["angular","angular-directive","angular-directives","angular-validation","angularjs","password","password-strength","validation"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jdforsythe.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-04-29T19:59:26.000Z","updated_at":"2016-04-29T20:01:13.000Z","dependencies_parsed_at":"2022-09-02T11:00:19.610Z","dependency_job_id":null,"html_url":"https://github.com/jdforsythe/angular-password-enforcement","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/jdforsythe/angular-password-enforcement","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdforsythe%2Fangular-password-enforcement","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdforsythe%2Fangular-password-enforcement/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdforsythe%2Fangular-password-enforcement/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdforsythe%2Fangular-password-enforcement/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jdforsythe","download_url":"https://codeload.github.com/jdforsythe/angular-password-enforcement/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jdforsythe%2Fangular-password-enforcement/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263986295,"owners_count":23539812,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","angular-directive","angular-directives","angular-validation","angularjs","password","password-strength","validation"],"created_at":"2024-12-20T10:14:37.903Z","updated_at":"2025-07-09T01:39:03.310Z","avatar_url":"https://github.com/jdforsythe.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"angular-password-enforcement\n============================\n\n[![Build Status](https://travis-ci.org/jdforsythe/angular-password-enforcement.svg?branch=master)](https://travis-ci.org/jdforsythe/angular-password-enforcement)\n\nAn Angular directive for validating password input against a set of rules\n\n## Installation\n```bash\n$ bower install angular-password-enforcement\n```\n\n## Setup\n\nInclude `angular-password-enforcement'` in your module's dependencies:\n\n```js\nangular.module('myApp', ['angular-password-enforcement']);\n```\n\n## Configuration\n\nBy default, the directive includes a loose policy for the valid password (defaults are shown in the example below).\nThis is configurable based on your needs. Simple add a config block for your app:\n\n```js\nangular.module('myApp', ['angular-password-enforcement'])\n.config(function(validPasswordConfigProvider) {\n  validPasswordConfigProvider.setConfig({\n    minLength: 7,\n    maxLength: 30,\n    pattern: /^((?=.*[a-z])(?=.*[A-Z])(?=.*\\d)(?=.*(_|[^\\w])).{7,30})$/;\n  });\n});\n```\n\nIt is recommended to also set a constant for the explanation of your password rules, that you can inject to use in all the views you'll have\npassword fields:\n\n```js\n.constant('PASSWORD_RULES', '7-30 characters. At least 1 uppercase, 1 lowercase, 1 number, and 1 symbol. Symbols include: `~!@#$%^\u0026*()-_=+[]{}\\\\|;:\\'\",.\u003c\u003e/?');\n\n\napp.controller('MyController', function(PASSWORD_RULES) {\n  var vm = this;\n  vm.passwordRules = PASSWORD_RULES;\n});\n```\n\n## Usage\n\nSimply add the `valid-password` attribute to your `\u003cinput\u003e` field.\n\nThe directive attaches `ng-minlength` and `ng-maxlength` attributes to your form field. It also attaches an `invalidPassword` property to the\n`$error` on your form field, so it can be used like any of the built-in validation directives.\n\nNote: This does *NOT FAIL* if the password field is empty. This is for cases where the user may be editing their profile and should\nbe allowed to leave the field empty. If you want to test for the empty field, you must add `ng-required=\"true\"` to the input.\n\nThe examples below assume the configuration block and constant are configured as shown above.\n\n### Example with `ng-messages`\n\n```html\n\u003cform name=\"newUserForm\"\u003e\n  \u003cinput type=\"text\" ng-model=\"vm.password\" name=\"userPassword\" ng-required=\"true\" valid-password\u003e\n  \u003cdiv ng-messages=\"newUserForm.userPassword.$error\" ng-if=\"newUserForm.userPassword.$dirty\"\u003e\n    \u003cdiv ng-message=\"required\"\u003ePassword is required\u003c/div\u003e\n    \u003cdiv ng-message-exp=\"['minlength', 'maxlength', 'invalidPassword']\"\u003e{{ vm.passwordRules }}\u003c/div\u003e\n  \u003c/div\u003e\n\u003c/form\u003e\n```\n\n### Without `ng-messages`\n\n```html\n\u003cform name=\"newUserForm\"\u003e\n  \u003cinput type=\"text\" ng-model=\"vm.password\" name=\"userPassword\" ng-required=\"true\" valid-password\u003e\n  \u003cdiv ng-if=\"newUserForm.userPassword.$dirty \u0026\u0026 newUserForm.userPassword.$invalid\"\u003e\n    \u003cdiv ng-if=\"newUserForm.userPassword.$error.required\"\u003eRouting number is required\u003c/div\u003e\n    \u003cdiv ng-if=\"newUserForm.userPassword.$error.minlength || newUserform.userPassword.$error.maxlength || newUserForm.userPassword.$error.invalidPassword\"\u003e\n      {{ vm.passwordRules }}\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/form\u003e\n```\n\n## Tests\n\nA round of tests is included. To run the tests, execute:\n\n```bash\ngulp test\n```\n\n## Contributions\n\nContributions are always welcome. Please submit issues and pull requests.\n\n## License\n\n[MIT](LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdforsythe%2Fangular-password-enforcement","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjdforsythe%2Fangular-password-enforcement","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjdforsythe%2Fangular-password-enforcement/lists"}