Skip to content

Commit

Permalink
Add decrypt event
Browse files Browse the repository at this point in the history
  • Loading branch information
tnorling committed Jan 9, 2025
1 parent 42a61f8 commit 4cb696f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
6 changes: 1 addition & 5 deletions lib/msal-browser/src/cache/LocalStorage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ export class LocalStorage implements IWindowStorage<string> {
return null;
}

return decrypt(
return invokeAsync(decrypt, PerformanceEvents.Decrypt, this.logger, this.performanceClient, correlationId)(
this.encryptionCookie.key,
encObj.nonce,
this.getContext(key),
Expand All @@ -322,10 +322,6 @@ export class LocalStorage implements IWindowStorage<string> {
if (value) {
this.memoryStorage.setItem(key, value);
}
this.performanceClient.incrementFields(
{ decryptedCacheCount: 1 },
correlationId
);
});
promiseArr.push(promise);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ export const PerformanceEvents = {
Base64Decode: "base64Decode",
UrlEncodeArr: "urlEncodeArr",
Encrypt: "encrypt",
Decrypt: "decrypt"
} as const;
export type PerformanceEvents =
(typeof PerformanceEvents)[keyof typeof PerformanceEvents];
Expand Down Expand Up @@ -548,6 +549,7 @@ export const PerformanceEventAbbreviations: ReadonlyMap<string, string> =
[PerformanceEvents.Base64Decode, "b64Decode"],
[PerformanceEvents.UrlEncodeArr, "urlEncArr"],
[PerformanceEvents.Encrypt, "encrypt"],
[PerformanceEvents.Decrypt, "decrypt"]
]);

/**
Expand Down Expand Up @@ -895,5 +897,4 @@ export const IntFields: ReadonlySet<string> = new Set([
"multiMatchedRT",
"unencryptedCacheCount",
"encryptedCacheExpiredCount",
"decryptedCacheCount",
]);

0 comments on commit 4cb696f

Please sign in to comment.