mirror of
https://github.com/bitwarden/browser
synced 2025-12-19 01:33:33 +00:00
Password Generator Passphrase Policy (#85)
* Initial commit for passphrase enforcement * Updated type implementation * Updated default type conditional * Added helper method to enforced options object Co-authored-by: Vincent Salucci <vsalucci@bitwarden.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
import Domain from './domainBase';
|
||||
|
||||
export class PasswordGeneratorPolicyOptions extends Domain {
|
||||
defaultType: string = '';
|
||||
minLength: number = 0;
|
||||
useUppercase: boolean = false;
|
||||
useLowercase: boolean = false;
|
||||
@@ -8,4 +9,21 @@ export class PasswordGeneratorPolicyOptions extends Domain {
|
||||
numberCount: number = 0;
|
||||
useSpecial: boolean = false;
|
||||
specialCount: number = 0;
|
||||
minNumberWords: number = 0;
|
||||
capitalize: boolean = false;
|
||||
includeNumber: boolean = false;
|
||||
|
||||
inEffect() {
|
||||
return this.defaultType !== '' ||
|
||||
this.minLength > 0 ||
|
||||
this.numberCount > 0 ||
|
||||
this.specialCount > 0 ||
|
||||
this.useUppercase ||
|
||||
this.useLowercase ||
|
||||
this.useNumbers ||
|
||||
this.useSpecial ||
|
||||
this.minNumberWords > 0 ||
|
||||
this.capitalize ||
|
||||
this.includeNumber;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user