mirror of
https://github.com/bitwarden/browser
synced 2025-12-20 10:13:31 +00:00
* add state definition for auto confirm * typo * refactor organziation user service * WIP create auto confirm service * add POST method, finish implementation * add missing userId param, jsdoc * fix DI * refactor organziation user service * WIP create auto confirm service * add POST method, finish implementation * add missing userId param, jsdoc * clean up, more DI fixes * remove @Injectable from service, fix tests * remove from libs/common, fix dir structure, add tests
46 lines
1.6 KiB
TypeScript
46 lines
1.6 KiB
TypeScript
import { Observable } from "rxjs";
|
|
|
|
import {
|
|
OrganizationUserConfirmRequest,
|
|
OrganizationUserBulkResponse,
|
|
} from "@bitwarden/admin-console/common";
|
|
import { Organization } from "@bitwarden/common/admin-console/models/domain/organization";
|
|
import { ListResponse } from "@bitwarden/common/models/response/list.response";
|
|
|
|
export abstract class OrganizationUserService {
|
|
/**
|
|
* Builds a confirmation request for an organization user.
|
|
* @param organization - The organization the user belongs to
|
|
* @param publicKey - The user's public key
|
|
* @returns An observable that emits the confirmation request
|
|
*/
|
|
abstract buildConfirmRequest(
|
|
organization: Organization,
|
|
publicKey: Uint8Array,
|
|
): Observable<OrganizationUserConfirmRequest>;
|
|
|
|
/**
|
|
* Confirms a user in an organization.
|
|
* @param organization - The organization the user belongs to
|
|
* @param userId - The ID of the user to confirm
|
|
* @param publicKey - The user's public key
|
|
* @returns An observable that completes when the user is confirmed
|
|
*/
|
|
abstract confirmUser(
|
|
organization: Organization,
|
|
userId: string,
|
|
publicKey: Uint8Array,
|
|
): Observable<void>;
|
|
|
|
/**
|
|
* Confirms multiple users in an organization.
|
|
* @param organization - The organization the users belong to
|
|
* @param userIdsWithKeys - Array of user IDs with their encrypted keys
|
|
* @returns An observable that emits the bulk confirmation response
|
|
*/
|
|
abstract bulkConfirmUsers(
|
|
organization: Organization,
|
|
userIdsWithKeys: { id: string; key: string }[],
|
|
): Observable<ListResponse<OrganizationUserBulkResponse>>;
|
|
}
|