-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into PM-13938-exceptPasswordPermission
- Loading branch information
Showing
140 changed files
with
776 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletions
1
bitwarden_license/bit-common/src/tools/reports/risk-insights/services/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
export * from "./member-cipher-details-api.service"; | ||
export * from "./password-health.service"; | ||
export * from "./risk-insights-report.service"; | ||
export * from "./risk-insights-data.service"; |
60 changes: 60 additions & 0 deletions
60
...license/bit-common/src/tools/reports/risk-insights/services/risk-insights-data.service.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { BehaviorSubject } from "rxjs"; | ||
import { finalize } from "rxjs/operators"; | ||
|
||
import { ApplicationHealthReportDetail } from "../models/password-health"; | ||
|
||
import { RiskInsightsReportService } from "./risk-insights-report.service"; | ||
|
||
export class RiskInsightsDataService { | ||
private applicationsSubject = new BehaviorSubject<ApplicationHealthReportDetail[] | null>(null); | ||
|
||
applications$ = this.applicationsSubject.asObservable(); | ||
|
||
private isLoadingSubject = new BehaviorSubject<boolean>(false); | ||
isLoading$ = this.isLoadingSubject.asObservable(); | ||
|
||
private isRefreshingSubject = new BehaviorSubject<boolean>(false); | ||
isRefreshing$ = this.isRefreshingSubject.asObservable(); | ||
|
||
private errorSubject = new BehaviorSubject<string | null>(null); | ||
error$ = this.errorSubject.asObservable(); | ||
|
||
private dataLastUpdatedSubject = new BehaviorSubject<Date | null>(null); | ||
dataLastUpdated$ = this.dataLastUpdatedSubject.asObservable(); | ||
|
||
constructor(private reportService: RiskInsightsReportService) {} | ||
|
||
/** | ||
* Fetches the applications report and updates the applicationsSubject. | ||
* @param organizationId The ID of the organization. | ||
*/ | ||
fetchApplicationsReport(organizationId: string, isRefresh?: boolean): void { | ||
if (isRefresh) { | ||
this.isRefreshingSubject.next(true); | ||
} else { | ||
this.isLoadingSubject.next(true); | ||
} | ||
this.reportService | ||
.generateApplicationsReport$(organizationId) | ||
.pipe( | ||
finalize(() => { | ||
this.isLoadingSubject.next(false); | ||
this.isRefreshingSubject.next(false); | ||
this.dataLastUpdatedSubject.next(new Date()); | ||
}), | ||
) | ||
.subscribe({ | ||
next: (reports: ApplicationHealthReportDetail[]) => { | ||
this.applicationsSubject.next(reports); | ||
this.errorSubject.next(null); | ||
}, | ||
error: () => { | ||
this.applicationsSubject.next([]); | ||
}, | ||
}); | ||
} | ||
|
||
refreshApplicationsReport(organizationId: string): void { | ||
this.fetchApplicationsReport(organizationId, true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
bitwarden_license/bit-web/src/app/tools/access-intelligence/access-intelligence.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,38 @@ | ||
import { NgModule } from "@angular/core"; | ||
|
||
import { | ||
MemberCipherDetailsApiService, | ||
RiskInsightsDataService, | ||
RiskInsightsReportService, | ||
} from "@bitwarden/bit-common/tools/reports/risk-insights/services"; | ||
import { ApiService } from "@bitwarden/common/abstractions/api.service"; | ||
import { AuditService } from "@bitwarden/common/abstractions/audit.service"; | ||
import { PasswordStrengthServiceAbstraction } from "@bitwarden/common/tools/password-strength/password-strength.service.abstraction"; | ||
import { CipherService } from "@bitwarden/common/vault/abstractions/cipher.service"; | ||
|
||
import { AccessIntelligenceRoutingModule } from "./access-intelligence-routing.module"; | ||
import { RiskInsightsComponent } from "./risk-insights.component"; | ||
|
||
@NgModule({ | ||
imports: [RiskInsightsComponent, AccessIntelligenceRoutingModule], | ||
providers: [ | ||
{ | ||
provide: MemberCipherDetailsApiService, | ||
deps: [ApiService], | ||
}, | ||
{ | ||
provide: RiskInsightsReportService, | ||
deps: [ | ||
PasswordStrengthServiceAbstraction, | ||
AuditService, | ||
CipherService, | ||
MemberCipherDetailsApiService, | ||
], | ||
}, | ||
{ | ||
provide: RiskInsightsDataService, | ||
deps: [RiskInsightsReportService], | ||
}, | ||
], | ||
}) | ||
export class AccessIntelligenceModule {} |
Oops, something went wrong.