mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 18:23:31 +00:00
* Add generate command * Add JSDoc * Minor improvements * Remove unneeded comment * Make some properties optional * Remove main.background.ts changes * One more * Lint * Make all but length optional * Address PR feedback * Move generate command code to command * Address PR feedback * Use new alarm scheme * Let feature handle state keys Moves to a feature folder and creates clipboard-module level state handler functions. StateService is being paired down to storage routing, so we are handling storage specifics in-module. Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com> Co-authored-by: Daniel Smith <djsmith85@users.noreply.github.com> * Missed some changes Co-authored-by: Matt Gibson <mgibson@bitwarden.com> Co-authored-by: Justin Baur <justindbaur@users.noreply.github.com> Co-authored-by: Daniel Smith <djsmith85@users.noreply.github.com>
25 lines
1.3 KiB
TypeScript
25 lines
1.3 KiB
TypeScript
import * as zxcvbn from "zxcvbn";
|
|
|
|
import { GeneratedPasswordHistory } from "../models/domain/generated-password-history";
|
|
import { PasswordGeneratorOptions } from "../models/domain/password-generator-options";
|
|
import { PasswordGeneratorPolicyOptions } from "../models/domain/password-generator-policy-options";
|
|
|
|
export abstract class PasswordGenerationService {
|
|
generatePassword: (options: PasswordGeneratorOptions) => Promise<string>;
|
|
generatePassphrase: (options: PasswordGeneratorOptions) => Promise<string>;
|
|
getOptions: () => Promise<[PasswordGeneratorOptions, PasswordGeneratorPolicyOptions]>;
|
|
enforcePasswordGeneratorPoliciesOnOptions: (
|
|
options: PasswordGeneratorOptions
|
|
) => Promise<[PasswordGeneratorOptions, PasswordGeneratorPolicyOptions]>;
|
|
getPasswordGeneratorPolicyOptions: () => Promise<PasswordGeneratorPolicyOptions>;
|
|
saveOptions: (options: PasswordGeneratorOptions) => Promise<void>;
|
|
getHistory: () => Promise<GeneratedPasswordHistory[]>;
|
|
addHistory: (password: string) => Promise<void>;
|
|
clear: (userId?: string) => Promise<void>;
|
|
passwordStrength: (password: string, userInputs?: string[]) => zxcvbn.ZXCVBNResult;
|
|
normalizeOptions: (
|
|
options: PasswordGeneratorOptions,
|
|
enforcedPolicyOptions: PasswordGeneratorPolicyOptions
|
|
) => void;
|
|
}
|