mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 08:13:42 +00:00
Auth/PM-5099 Ensure consistent casing of email used for fingerprint generation in Auth Requests (#8571)
* Created method for handilng email-address-based fingerprint. * Added test for new method. * Added returns to annotation
This commit is contained in:
@@ -27,6 +27,7 @@ describe("AuthRequestService", () => {
|
||||
const apiService = mock<ApiService>();
|
||||
|
||||
let mockPrivateKey: Uint8Array;
|
||||
let mockPublicKey: Uint8Array;
|
||||
const mockUserId = Utils.newGuid() as UserId;
|
||||
|
||||
beforeEach(() => {
|
||||
@@ -44,6 +45,7 @@ describe("AuthRequestService", () => {
|
||||
);
|
||||
|
||||
mockPrivateKey = new Uint8Array(64);
|
||||
mockPublicKey = new Uint8Array(64);
|
||||
});
|
||||
|
||||
describe("authRequestPushNotification$", () => {
|
||||
@@ -262,4 +264,14 @@ describe("AuthRequestService", () => {
|
||||
expect(result.masterKeyHash).toEqual(mockDecryptedMasterKeyHash);
|
||||
});
|
||||
});
|
||||
|
||||
describe("getFingerprintPhrase", () => {
|
||||
it("returns the same fingerprint regardless of email casing", () => {
|
||||
const email = "test@email.com";
|
||||
const emailUpperCase = email.toUpperCase();
|
||||
const phrase = sut.getFingerprintPhrase(email, mockPublicKey);
|
||||
const phraseUpperCase = sut.getFingerprintPhrase(emailUpperCase, mockPublicKey);
|
||||
expect(phrase).toEqual(phraseUpperCase);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user