mirror of
https://github.com/bitwarden/browser
synced 2025-12-17 16:53:34 +00:00
[PM-15001] Replace throttle decorator (#15015)
* Add comments to AuditService Abstraction * Replace throttle usage with rxjs mergeMap with concurrent limit * Add test cases for audit service * Remove throttle
This commit is contained in:
@@ -1,8 +1,17 @@
|
||||
// FIXME: Update this file to be type safe and remove this and next line
|
||||
// @ts-strict-ignore
|
||||
import { BreachAccountResponse } from "../models/response/breach-account.response";
|
||||
|
||||
export abstract class AuditService {
|
||||
passwordLeaked: (password: string) => Promise<number>;
|
||||
breachedAccounts: (username: string) => Promise<BreachAccountResponse[]>;
|
||||
/**
|
||||
* Checks how many times a password has been leaked.
|
||||
* @param password The password to check.
|
||||
* @returns A promise that resolves to the number of times the password has been leaked.
|
||||
*/
|
||||
abstract passwordLeaked: (password: string) => Promise<number>;
|
||||
|
||||
/**
|
||||
* Retrieves accounts that have been breached for a given username.
|
||||
* @param username The username to check for breaches.
|
||||
* @returns A promise that resolves to an array of BreachAccountResponse objects.
|
||||
*/
|
||||
abstract breachedAccounts: (username: string) => Promise<BreachAccountResponse[]>;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user