Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
ng-password-validator-v2
Advanced tools
The password validator is a pop-up window that appears when you start typing in input box. Here you can configure the password acceptance criteria, once your enter characters fullfil the requirement you will get a success message.
The password validator is a pop-up window that appears when you start typing in input box. Here you can configure the password acceptance criteria, once your enter characters fullfil the requirement you will get a success message.
Help to make Password Validator better by answering a few questions.
https://jaganbishoyi.github.io/ngx-password-validator/
Install the npm package.
npm i ng-password-validator
Import in NgModule
:
import { NgPasswordValidatorModule } from 'ng-password-validator';
@NgModule({
imports: [ NgPasswordValidatorModule ]
})
Options can be set in the directive tag, so they have the highest priority.
<input type="text" id="password" name="password" placeholder="Password.."
NgPasswordValidator placement="top">
You may pass as an object:
<input type="text" id="password" name="password" placeholder="Password.."
[NgPasswordValidator]="options">
Password type as 'range':
options = {
'placement': 'top',
'password': {
'type': "range";
'min': 6;
'max': 10;
},
'shadow': false,
'offset': 15,
}
Password type as 'number':
options = {
'placement': 'top',
'password': {
'type': "number";
'length': 8;
},
'shadow': false,
'offset': 15,
}
Theming( Default value is pro ):
<input type="text" id="password" name="password" placeholder="Password.."
[NgPasswordValidator]="options">
Theme as 'basic':
options = {
'placement': 'top',
'theme': 'basic'
}
Theme as 'pro':
options = {
'placement': 'top',
'theme': 'pro'
}
You can also change Popup header and success message:
<input type="text" id="password" name="password" placeholder="Password.."
[NgPasswordValidator]="options">
options = {
'heading': 'Password Requirement',
'successMessage': 'Wow! Password is Strong.'
}
After closing the popup window, you will get one output for password validity (true/false):
<input type="text" id="password" name="password" placeholder="Password.."
NgPasswordValidator placement="top" (valid)="isValid($event)">
isValid(event: boolean) {
this.isPasswordValid = event;
}
In app.module.ts export the default options like below:
import { NgPasswordValidatorModule, NgPasswordValidatorOptions } from "ng-password-validator";
export const MyDefaultOptions: NgPasswordValidatorOptions = {
placement: "right",
rules: {
"include-symbol": true,
"include-number": true,
"include-lowercase-characters": true,
"include-uppercase-characters": false,
}
};
And pass your parameters when importing the module:
@NgModule({
imports: [
NgPasswordValidatorModule.forRoot(MyDefaultOptions as NgPasswordValidatorOptions)
]
})
name | type | default | description |
---|---|---|---|
placement | "top", "bottom", "left", "right" | "bottom" | The position of the popup window. |
z-index | number | 0 | Z-index of the popup window. |
trigger | "focus" | Specifies how the popup window is triggered. | |
popup-class | string | Classes to be passed to the popup window. | |
heading | string | Password Policy | Heading of popup window. |
successMessage | string | Awesome! Password requirement fulfilled. | Success message after requirements fulfilled. |
animation-duration | number | 300 | The duration controls how long the animation takes to run from start to finish. |
theme | "basic" | "basic" | Theme of popup window background and text. |
shadow | boolean | true | Shadow of the popup window. |
offset | number | 8 | Offset the popup window relative to the item. |
width | number | undefined | Width of the popup window. |
max-width | number | 390 | Maximum width of the popup window. |
pointerEvents | "auto", "none" | "none" | Defines whether or not an element reacts to pointer events. |
position | {top: number, left: number} | undefined | The popup window coordinates relative to the browser window. |
When you call events, the delays that are specified in the options in the directive are taken into account.
Event | Description |
---|---|
{type: "show", position: DOMRect} | The event is called before the popup window appears. |
{type: "shown", position: DOMRect} | The event is called after the animation of the appearance of the popup window. |
{type: "hide", position: DOMRect} | The event is called before the popup window is hidden. |
{type: "hidden", position: DOMRect} | The event is called after the animation of the popup window is hidden. |
License under the MIT License (MIT)
Copyright (c) 2020-2021 Jagan Mohan Bishoyi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
The password validator is a pop-up window that appears when you start typing in input box. Here you can configure the password acceptance criteria, once your enter characters fullfil the requirement you will get a success message.
The npm package ng-password-validator-v2 receives a total of 4 weekly downloads. As such, ng-password-validator-v2 popularity was classified as not popular.
We found that ng-password-validator-v2 demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.