wangzhibo
2026-05-09 53418655c061ac26f66058253f39200aced1ab1d
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License.
 */
 
export const PREFIX = "msal";
const BROWSER_PREFIX = "browser";
export const CACHE_KEY_SEPARATOR = "|";
export const CREDENTIAL_SCHEMA_VERSION = 2;
export const ACCOUNT_SCHEMA_VERSION = 2;
 
export const LOG_LEVEL_CACHE_KEY = `${PREFIX}.${BROWSER_PREFIX}.log.level`;
export const LOG_PII_CACHE_KEY = `${PREFIX}.${BROWSER_PREFIX}.log.pii`;
export const BROWSER_PERF_ENABLED_KEY = `${PREFIX}.${BROWSER_PREFIX}.performance.enabled`;
export const PLATFORM_AUTH_DOM_SUPPORT = `${PREFIX}.${BROWSER_PREFIX}.platform.auth.dom`;
export const VERSION_CACHE_KEY = `${PREFIX}.version`;
export const ACCOUNT_KEYS = "account.keys";
export const TOKEN_KEYS = "token.keys";
export const SSO_CAPABLE = `${PREFIX}.${BROWSER_PREFIX}.sso.capable`;
 
export function getAccountKeysCacheKey(
    schema: number = ACCOUNT_SCHEMA_VERSION
): string {
    if (schema < 1) {
        return `${PREFIX}.${ACCOUNT_KEYS}`;
    }
 
    return `${PREFIX}.${schema}.${ACCOUNT_KEYS}`;
}
 
export function getTokenKeysCacheKey(
    clientId: string,
    schema: number = CREDENTIAL_SCHEMA_VERSION
): string {
    if (schema < 1) {
        return `${PREFIX}.${TOKEN_KEYS}.${clientId}`;
    }
 
    return `${PREFIX}.${schema}.${TOKEN_KEYS}.${clientId}`;
}