1
0
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:
Vincent Salucci
2020-03-10 12:50:54 -05:00
committed by GitHub
parent 44b86f5dd0
commit ee8ca0beed
3 changed files with 58 additions and 9 deletions

View File

@@ -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;
}
}