1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-11 22:13:32 +00:00

PM-14927 changed DI for critical apps service

This commit is contained in:
voommen-livefront
2024-12-06 13:18:46 -06:00
parent 1fa0560da1
commit 665e7307e7
2 changed files with 21 additions and 4 deletions

View File

@@ -1,4 +1,3 @@
import { Injectable } from "@angular/core";
import {
BehaviorSubject,
first,
@@ -22,9 +21,6 @@ import { OrganizationId } from "@bitwarden/common/types/guid";
import { OrgKey } from "@bitwarden/common/types/key";
import { KeyService } from "@bitwarden/key-management";
@Injectable({
providedIn: "root",
})
/* Retrieves and decrypts critical apps for a given organization
* Encrypts and saves data for a given organization
*/
@@ -176,3 +172,9 @@ export interface PasswordHealthReportApplicationsResponse {
}
export type PasswordHealthReportApplicationId = Opaque<string, "PasswordHealthReportApplicationId">;
export const criticalServiceFactoryProvider = (
apiService: ApiService,
keyService: KeyService,
encryptService: EncryptService,
) => new CriticalAppsApiService(apiService, keyService, encryptService);

View File

@@ -1,9 +1,24 @@
import { NgModule } from "@angular/core";
import {
CriticalAppsApiService,
criticalServiceFactoryProvider,
} from "@bitwarden/bit-common/tools/reports/risk-insights";
import { ApiService } from "@bitwarden/common/abstractions/api.service";
import { EncryptService } from "@bitwarden/common/platform/abstractions/encrypt.service";
import { KeyService } from "@bitwarden/key-management";
import { AccessIntelligenceRoutingModule } from "./access-intelligence-routing.module";
import { RiskInsightsComponent } from "./risk-insights.component";
@NgModule({
imports: [RiskInsightsComponent, AccessIntelligenceRoutingModule],
providers: [
{
provide: CriticalAppsApiService,
useFactory: criticalServiceFactoryProvider,
deps: [ApiService, KeyService, EncryptService],
},
],
})
export class AccessIntelligenceModule {}