1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

[PM-11450] Move organization-user domain to admin-console lib (#10785)

- move organization-user files from libs/common/src/admin-console into libs/admin-console/src/common
- add barrel files and update imports to use barrel files
- rename OrganizationUserService to OrganizationUserApiService
- rename OrganizationUserServiceImplementation to DefaultOrganizationUserApiService
This commit is contained in:
Thomas Rittson
2024-09-05 08:21:26 +10:00
committed by GitHub
parent 2f69228c21
commit 8344623185
83 changed files with 297 additions and 239 deletions

View File

@@ -1,6 +1,8 @@
import {
OrganizationUserApiService,
OrganizationUserConfirmRequest,
} from "@bitwarden/admin-console/common";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { OrganizationUserService } from "@bitwarden/common/admin-console/abstractions/organization-user/organization-user.service";
import { OrganizationUserConfirmRequest } from "@bitwarden/common/admin-console/abstractions/organization-user/requests";
import { CryptoService } from "@bitwarden/common/platform/abstractions/crypto.service";
import { Utils } from "@bitwarden/common/platform/misc/utils";
@@ -10,7 +12,7 @@ export class ConfirmCommand {
constructor(
private apiService: ApiService,
private cryptoService: CryptoService,
private organizationUserService: OrganizationUserService,
private organizationUserApiService: OrganizationUserApiService,
) {}
async run(object: string, id: string, cmdOptions: Record<string, any>): Promise<Response> {
@@ -42,7 +44,7 @@ export class ConfirmCommand {
if (orgKey == null) {
throw new Error("No encryption key for this organization.");
}
const orgUser = await this.organizationUserService.getOrganizationUser(
const orgUser = await this.organizationUserApiService.getOrganizationUser(
options.organizationId,
id,
);
@@ -54,7 +56,7 @@ export class ConfirmCommand {
const key = await this.cryptoService.rsaEncrypt(orgKey.key, publicKey);
const req = new OrganizationUserConfirmRequest();
req.key = key.encryptedString;
await this.organizationUserService.postOrganizationUserConfirm(
await this.organizationUserApiService.postOrganizationUserConfirm(
options.organizationId,
id,
req,