diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts index 62eb0122dca..8a7a27494f8 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/models/password-health.ts @@ -166,5 +166,31 @@ export enum DrawerType { OrgAtRiskMembers = 2, OrgAtRiskApps = 3, } +export interface RiskInsightsReport { + organizationId: OrganizationId; + date: string; + reportData: string; + totalMembers: number; + totalAtRiskMembers: number; + totalApplications: number; + totalAtRiskApplications: number; + totalCriticalApplications: number; +} + +// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented. +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface ReportInsightsReportData {} + +// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented. +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface SaveRiskInsightsReportRequest {} + +// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented. +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface SaveRiskInsightsReportResponse {} + +// [FIX-ME] This interface is not implemented yet. Remove this eslint-disable when implemented. +// eslint-disable-next-line @typescript-eslint/no-empty-object-type +export interface GetRiskInsightsReportResponse {} export type PasswordHealthReportApplicationId = Opaque; diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/index.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/index.ts index f547df31f41..0c972081b7b 100644 --- a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/index.ts +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/index.ts @@ -4,3 +4,4 @@ export * from "./critical-apps.service"; export * from "./critical-apps-api.service"; export * from "./risk-insights-report.service"; export * from "./risk-insights-data.service"; +export * from "./risk-insights-api.service"; diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-api.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-api.service.ts new file mode 100644 index 00000000000..26bcbda5155 --- /dev/null +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-api.service.ts @@ -0,0 +1,26 @@ +import { Observable } from "rxjs"; + +import { ApiService } from "@bitwarden/common/abstractions/api.service"; +import { OrganizationId } from "@bitwarden/common/types/guid"; + +import { + GetRiskInsightsReportResponse, + SaveRiskInsightsReportRequest, + SaveRiskInsightsReportResponse, +} from "../models/password-health"; + +export class RiskInsightsApiService { + constructor(private apiService: ApiService) {} + + // [FIX-ME] This method is not implemented yet. + saveRiskInsightsReport( + request: SaveRiskInsightsReportRequest, + ): Observable { + return; + } + + // [FIX-ME] This method is not implemented yet. + getRiskInsightsReport(orgId: OrganizationId): Observable { + return; + } +} diff --git a/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-encryption.service.ts b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-encryption.service.ts new file mode 100644 index 00000000000..09a422bda80 --- /dev/null +++ b/bitwarden_license/bit-common/src/dirt/reports/risk-insights/services/risk-insights-encryption.service.ts @@ -0,0 +1,38 @@ +// FIXME: Update this file to be type safe +// @ts-strict-ignore +import { EncryptService } from "@bitwarden/common/key-management/crypto/abstractions/encrypt.service"; +import { KeyGenerationService } from "@bitwarden/common/platform/abstractions/key-generation.service"; +import { OrganizationId } from "@bitwarden/common/types/guid"; +import { KeyService } from "@bitwarden/key-management"; + +import { + ApplicationHealthReportDetail, + ApplicationHealthReportSummary, + RiskInsightsReport, + GetRiskInsightsReportResponse, +} from "../models/password-health"; + +export class RiskInsightsEncryptionService { + constructor( + private keyService: KeyService, + private encryptService: EncryptService, + private keyGeneratorService: KeyGenerationService, + ) {} + + // [FIX-ME] This method is not implemented yet. + async encryptRiskInsightsReport( + organizationId: OrganizationId, + details: ApplicationHealthReportDetail[], + summary: ApplicationHealthReportSummary, + ): Promise { + return; + } + + // [FIX-ME] This method is not implemented yet. + async decryptRiskInsightsReport( + organizationId: OrganizationId, + riskInsightsReportResponse: GetRiskInsightsReportResponse, + ): Promise<[ApplicationHealthReportDetail[], ApplicationHealthReportSummary]> { + return [null, null]; + } +}