-
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 ps/dynamically-load-macos-passkey
- Loading branch information
Showing
48 changed files
with
2,077 additions
and
522 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -2,7 +2,7 @@ | |
"name": "@bitwarden/desktop", | ||
"productName": "Bitwarden", | ||
"description": "A secure and free password manager for all of your devices.", | ||
"version": "2025.1.2", | ||
"version": "2025.1.3", | ||
"author": "Bitwarden Inc. <[email protected]> (https://bitwarden.com)", | ||
"homepage": "https://bitwarden.com", | ||
"license": "GPL-3.0", | ||
|
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
79 changes: 79 additions & 0 deletions
79
...nse/bit-common/src/tools/reports/risk-insights/services/critical-apps-api.service.spec.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,79 @@ | ||
import { mock } from "jest-mock-extended"; | ||
|
||
import { ApiService } from "@bitwarden/common/abstractions/api.service"; | ||
import { OrganizationId } from "@bitwarden/common/types/guid"; | ||
|
||
import { CriticalAppsApiService } from "./critical-apps-api.service"; | ||
import { | ||
PasswordHealthReportApplicationId, | ||
PasswordHealthReportApplicationsRequest, | ||
PasswordHealthReportApplicationsResponse, | ||
} from "./critical-apps.service"; | ||
|
||
describe("CriticalAppsApiService", () => { | ||
let service: CriticalAppsApiService; | ||
const apiService = mock<ApiService>(); | ||
|
||
beforeEach(() => { | ||
service = new CriticalAppsApiService(apiService); | ||
}); | ||
|
||
it("should be created", () => { | ||
expect(service).toBeTruthy(); | ||
}); | ||
|
||
it("should call apiService.send with correct parameters for SaveCriticalApps", (done) => { | ||
const requests: PasswordHealthReportApplicationsRequest[] = [ | ||
{ organizationId: "org1" as OrganizationId, url: "test one" }, | ||
{ organizationId: "org1" as OrganizationId, url: "test two" }, | ||
]; | ||
const response: PasswordHealthReportApplicationsResponse[] = [ | ||
{ | ||
id: "1" as PasswordHealthReportApplicationId, | ||
organizationId: "org1" as OrganizationId, | ||
uri: "test one", | ||
}, | ||
{ | ||
id: "2" as PasswordHealthReportApplicationId, | ||
organizationId: "org1" as OrganizationId, | ||
uri: "test two", | ||
}, | ||
]; | ||
|
||
apiService.send.mockReturnValue(Promise.resolve(response)); | ||
|
||
service.saveCriticalApps(requests).subscribe((result) => { | ||
expect(result).toEqual(response); | ||
expect(apiService.send).toHaveBeenCalledWith( | ||
"POST", | ||
"/reports/password-health-report-applications/", | ||
requests, | ||
true, | ||
true, | ||
); | ||
done(); | ||
}); | ||
}); | ||
|
||
it("should call apiService.send with correct parameters for GetCriticalApps", (done) => { | ||
const orgId: OrganizationId = "org1" as OrganizationId; | ||
const response: PasswordHealthReportApplicationsResponse[] = [ | ||
{ id: "1" as PasswordHealthReportApplicationId, organizationId: orgId, uri: "test one" }, | ||
{ id: "2" as PasswordHealthReportApplicationId, organizationId: orgId, uri: "test two" }, | ||
]; | ||
|
||
apiService.send.mockReturnValue(Promise.resolve(response)); | ||
|
||
service.getCriticalApps(orgId).subscribe((result) => { | ||
expect(result).toEqual(response); | ||
expect(apiService.send).toHaveBeenCalledWith( | ||
"GET", | ||
`/reports/password-health-report-applications/${orgId.toString()}`, | ||
null, | ||
true, | ||
true, | ||
); | ||
done(); | ||
}); | ||
}); | ||
}); |
39 changes: 39 additions & 0 deletions
39
..._license/bit-common/src/tools/reports/risk-insights/services/critical-apps-api.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,39 @@ | ||
import { from, Observable } from "rxjs"; | ||
|
||
import { ApiService } from "@bitwarden/common/abstractions/api.service"; | ||
import { OrganizationId } from "@bitwarden/common/types/guid"; | ||
|
||
import { | ||
PasswordHealthReportApplicationsRequest, | ||
PasswordHealthReportApplicationsResponse, | ||
} from "./critical-apps.service"; | ||
|
||
export class CriticalAppsApiService { | ||
constructor(private apiService: ApiService) {} | ||
|
||
saveCriticalApps( | ||
requests: PasswordHealthReportApplicationsRequest[], | ||
): Observable<PasswordHealthReportApplicationsResponse[]> { | ||
const dbResponse = this.apiService.send( | ||
"POST", | ||
"/reports/password-health-report-applications/", | ||
requests, | ||
true, | ||
true, | ||
); | ||
|
||
return from(dbResponse as Promise<PasswordHealthReportApplicationsResponse[]>); | ||
} | ||
|
||
getCriticalApps(orgId: OrganizationId): Observable<PasswordHealthReportApplicationsResponse[]> { | ||
const dbResponse = this.apiService.send( | ||
"GET", | ||
`/reports/password-health-report-applications/${orgId.toString()}`, | ||
null, | ||
true, | ||
true, | ||
); | ||
|
||
return from(dbResponse as Promise<PasswordHealthReportApplicationsResponse[]>); | ||
} | ||
} |
Oops, something went wrong.