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
/*
 * Copyright (c) Microsoft Corporation. All rights reserved.
 * Licensed under the MIT License.
 */
 
import { AccountEntity } from "@azure/msal-common/node";
 
/**
 * Interface that defines getter methods to get keys used to identity data in the cache
 * @public
 */
export interface IPartitionManager {
    /**
     * This function should return the correct key from which to read
     * the specific user's information from cache.
     *
     * Example: Your application may be partitioning the user's cache
     * information for each user using the homeAccountId and thus
     * this function would return the homeAccountId for
     * the user in question
     *
     * @returns Promise<string>
     */
    getKey(): Promise<string>;
 
    /**
     * This function should return the correct key being used to save each
     * user's cache information to cache - given an AccountEntity
     *
     * Example: Your application may be partitioning the user's cache
     * information for each user using the homeAccountId thus
     * this function would return the homeAccountId from
     * the provided AccountEntity
     *
     * @param accountEntity - AccountEntity
     * @returns Promise<string>
     */
    extractKey(accountEntity: AccountEntity): Promise<string>;
}