@azure/msal-common 14.13.1 → 14.14.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (193) hide show
  1. package/dist/account/AccountInfo.d.ts +66 -66
  2. package/dist/account/AccountInfo.mjs +77 -77
  3. package/dist/account/AuthToken.d.ts +17 -17
  4. package/dist/account/AuthToken.mjs +58 -58
  5. package/dist/account/CcsCredential.d.ts +9 -9
  6. package/dist/account/CcsCredential.mjs +8 -8
  7. package/dist/account/ClientCredentials.d.ts +19 -19
  8. package/dist/account/ClientInfo.d.ts +18 -18
  9. package/dist/account/ClientInfo.mjs +37 -37
  10. package/dist/account/TokenClaims.d.ts +83 -83
  11. package/dist/account/TokenClaims.mjs +20 -20
  12. package/dist/authority/Authority.d.ts +254 -254
  13. package/dist/authority/Authority.mjs +836 -836
  14. package/dist/authority/AuthorityFactory.d.ts +18 -18
  15. package/dist/authority/AuthorityFactory.mjs +28 -28
  16. package/dist/authority/AuthorityMetadata.d.ts +43 -43
  17. package/dist/authority/AuthorityMetadata.mjs +137 -137
  18. package/dist/authority/AuthorityOptions.d.ts +27 -27
  19. package/dist/authority/AuthorityOptions.mjs +18 -18
  20. package/dist/authority/AuthorityType.d.ts +10 -10
  21. package/dist/authority/AuthorityType.mjs +13 -13
  22. package/dist/authority/AzureRegion.d.ts +1 -1
  23. package/dist/authority/AzureRegionConfiguration.d.ts +5 -5
  24. package/dist/authority/CloudDiscoveryMetadata.d.ts +5 -5
  25. package/dist/authority/CloudInstanceDiscoveryErrorResponse.d.ts +13 -13
  26. package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +8 -8
  27. package/dist/authority/CloudInstanceDiscoveryResponse.d.ts +9 -9
  28. package/dist/authority/CloudInstanceDiscoveryResponse.mjs +8 -8
  29. package/dist/authority/ImdsOptions.d.ts +5 -5
  30. package/dist/authority/OIDCOptions.d.ts +8 -8
  31. package/dist/authority/OpenIdConfigResponse.d.ts +11 -11
  32. package/dist/authority/OpenIdConfigResponse.mjs +10 -10
  33. package/dist/authority/ProtocolMode.d.ts +8 -8
  34. package/dist/authority/ProtocolMode.mjs +11 -11
  35. package/dist/authority/RegionDiscovery.d.ts +32 -32
  36. package/dist/authority/RegionDiscovery.mjs +106 -106
  37. package/dist/authority/RegionDiscoveryMetadata.d.ts +6 -6
  38. package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +15 -15
  39. package/dist/cache/CacheManager.d.ts +497 -497
  40. package/dist/cache/CacheManager.mjs +1249 -1249
  41. package/dist/cache/entities/AccessTokenEntity.d.ts +25 -25
  42. package/dist/cache/entities/AccountEntity.d.ts +106 -106
  43. package/dist/cache/entities/AccountEntity.mjs +240 -240
  44. package/dist/cache/entities/AppMetadataEntity.d.ts +11 -11
  45. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +15 -15
  46. package/dist/cache/entities/CacheRecord.d.ts +13 -13
  47. package/dist/cache/entities/CredentialEntity.d.ts +30 -30
  48. package/dist/cache/entities/IdTokenEntity.d.ts +8 -8
  49. package/dist/cache/entities/RefreshTokenEntity.d.ts +7 -7
  50. package/dist/cache/entities/ServerTelemetryEntity.d.ts +6 -5
  51. package/dist/cache/entities/ServerTelemetryEntity.d.ts.map +1 -1
  52. package/dist/cache/entities/ThrottlingEntity.d.ts +7 -7
  53. package/dist/cache/interface/ICacheManager.d.ts +166 -166
  54. package/dist/cache/interface/ICachePlugin.d.ts +5 -5
  55. package/dist/cache/interface/ISerializableTokenCache.d.ts +4 -4
  56. package/dist/cache/persistence/TokenCacheContext.d.ts +23 -23
  57. package/dist/cache/persistence/TokenCacheContext.mjs +25 -25
  58. package/dist/cache/utils/CacheHelpers.d.ts +94 -94
  59. package/dist/cache/utils/CacheHelpers.mjs +324 -324
  60. package/dist/cache/utils/CacheTypes.d.ts +69 -69
  61. package/dist/client/AuthorizationCodeClient.d.ts +74 -74
  62. package/dist/client/AuthorizationCodeClient.mjs +420 -420
  63. package/dist/client/BaseClient.d.ts +51 -51
  64. package/dist/client/BaseClient.mjs +100 -100
  65. package/dist/client/RefreshTokenClient.d.ts +35 -35
  66. package/dist/client/RefreshTokenClient.mjs +211 -211
  67. package/dist/client/SilentFlowClient.d.ts +27 -27
  68. package/dist/client/SilentFlowClient.mjs +133 -133
  69. package/dist/config/AppTokenProvider.d.ts +38 -38
  70. package/dist/config/ClientConfiguration.d.ts +150 -150
  71. package/dist/config/ClientConfiguration.mjs +95 -95
  72. package/dist/constants/AADServerParamKeys.d.ts +53 -52
  73. package/dist/constants/AADServerParamKeys.d.ts.map +1 -1
  74. package/dist/constants/AADServerParamKeys.mjs +59 -58
  75. package/dist/constants/AADServerParamKeys.mjs.map +1 -1
  76. package/dist/crypto/ICrypto.d.ts +68 -68
  77. package/dist/crypto/ICrypto.mjs +36 -36
  78. package/dist/crypto/IGuidGenerator.d.ts +4 -4
  79. package/dist/crypto/JoseHeader.d.ts +22 -22
  80. package/dist/crypto/JoseHeader.mjs +37 -37
  81. package/dist/crypto/PopTokenGenerator.d.ts +59 -59
  82. package/dist/crypto/PopTokenGenerator.mjs +81 -81
  83. package/dist/crypto/SignedHttpRequest.d.ts +15 -15
  84. package/dist/error/AuthError.d.ts +44 -44
  85. package/dist/error/AuthError.mjs +46 -46
  86. package/dist/error/AuthErrorCodes.d.ts +5 -5
  87. package/dist/error/AuthErrorCodes.mjs +9 -9
  88. package/dist/error/CacheError.d.ts +20 -20
  89. package/dist/error/CacheError.mjs +24 -24
  90. package/dist/error/CacheErrorCodes.d.ts +2 -2
  91. package/dist/error/CacheErrorCodes.mjs +6 -6
  92. package/dist/error/ClientAuthError.d.ts +237 -237
  93. package/dist/error/ClientAuthError.mjs +249 -249
  94. package/dist/error/ClientAuthErrorCodes.d.ts +44 -44
  95. package/dist/error/ClientAuthErrorCodes.mjs +48 -48
  96. package/dist/error/ClientConfigurationError.d.ts +128 -128
  97. package/dist/error/ClientConfigurationError.mjs +135 -135
  98. package/dist/error/ClientConfigurationErrorCodes.d.ts +22 -22
  99. package/dist/error/ClientConfigurationErrorCodes.mjs +26 -26
  100. package/dist/error/InteractionRequiredAuthError.d.ts +65 -65
  101. package/dist/error/InteractionRequiredAuthError.mjs +85 -85
  102. package/dist/error/InteractionRequiredAuthErrorCodes.d.ts +7 -7
  103. package/dist/error/InteractionRequiredAuthErrorCodes.mjs +13 -13
  104. package/dist/error/JoseHeaderError.d.ts +15 -15
  105. package/dist/error/JoseHeaderError.mjs +22 -22
  106. package/dist/error/JoseHeaderErrorCodes.d.ts +2 -2
  107. package/dist/error/JoseHeaderErrorCodes.mjs +6 -6
  108. package/dist/error/ServerError.d.ts +15 -15
  109. package/dist/error/ServerError.mjs +16 -16
  110. package/dist/index.cjs +8664 -8599
  111. package/dist/index.cjs.map +1 -1
  112. package/dist/index.d.ts +107 -107
  113. package/dist/index.mjs +1 -1
  114. package/dist/logger/Logger.d.ts +95 -95
  115. package/dist/logger/Logger.mjs +188 -188
  116. package/dist/network/INetworkModule.d.ts +29 -29
  117. package/dist/network/INetworkModule.mjs +12 -12
  118. package/dist/network/NetworkManager.d.ts +33 -33
  119. package/dist/network/NetworkManager.mjs +34 -34
  120. package/dist/network/RequestThumbprint.d.ts +18 -18
  121. package/dist/network/ThrottlingUtils.d.ts +42 -42
  122. package/dist/network/ThrottlingUtils.mjs +95 -95
  123. package/dist/packageMetadata.d.ts +2 -2
  124. package/dist/packageMetadata.mjs +4 -4
  125. package/dist/request/AuthenticationHeaderParser.d.ts +19 -19
  126. package/dist/request/AuthenticationHeaderParser.mjs +55 -55
  127. package/dist/request/BaseAuthRequest.d.ts +47 -47
  128. package/dist/request/CommonAuthorizationCodeRequest.d.ts +27 -27
  129. package/dist/request/CommonAuthorizationUrlRequest.d.ts +50 -50
  130. package/dist/request/CommonClientCredentialRequest.d.ts +17 -17
  131. package/dist/request/CommonDeviceCodeRequest.d.ts +21 -21
  132. package/dist/request/CommonEndSessionRequest.d.ts +21 -21
  133. package/dist/request/CommonOnBehalfOfRequest.d.ts +13 -13
  134. package/dist/request/CommonRefreshTokenRequest.d.ts +22 -22
  135. package/dist/request/CommonSilentFlowRequest.d.ts +27 -27
  136. package/dist/request/CommonUsernamePasswordRequest.d.ts +17 -17
  137. package/dist/request/NativeRequest.d.ts +19 -19
  138. package/dist/request/NativeSignOutRequest.d.ts +5 -5
  139. package/dist/request/RequestParameterBuilder.d.ts +217 -217
  140. package/dist/request/RequestParameterBuilder.mjs +382 -382
  141. package/dist/request/RequestValidator.d.ts +27 -27
  142. package/dist/request/RequestValidator.mjs +64 -64
  143. package/dist/request/ScopeSet.d.ts +88 -88
  144. package/dist/request/ScopeSet.mjs +197 -197
  145. package/dist/request/StoreInCache.d.ts +8 -8
  146. package/dist/response/AuthenticationResult.d.ts +41 -41
  147. package/dist/response/AuthorizationCodePayload.d.ts +13 -13
  148. package/dist/response/DeviceCodeResponse.d.ts +25 -25
  149. package/dist/response/ExternalTokenResponse.d.ts +15 -15
  150. package/dist/response/IMDSBadResponse.d.ts +4 -4
  151. package/dist/response/ResponseHandler.d.ts +69 -69
  152. package/dist/response/ResponseHandler.mjs +374 -374
  153. package/dist/response/ServerAuthorizationCodeResponse.d.ts +26 -26
  154. package/dist/response/ServerAuthorizationTokenResponse.d.ts +47 -47
  155. package/dist/telemetry/performance/IPerformanceClient.d.ts +57 -57
  156. package/dist/telemetry/performance/IPerformanceMeasurement.d.ts +5 -5
  157. package/dist/telemetry/performance/PerformanceClient.d.ts +242 -242
  158. package/dist/telemetry/performance/PerformanceClient.mjs +587 -587
  159. package/dist/telemetry/performance/PerformanceEvent.d.ts +515 -505
  160. package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
  161. package/dist/telemetry/performance/PerformanceEvent.mjs +484 -480
  162. package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
  163. package/dist/telemetry/performance/StubPerformanceClient.d.ts +24 -24
  164. package/dist/telemetry/performance/StubPerformanceClient.mjs +76 -76
  165. package/dist/telemetry/server/ServerTelemetryManager.d.ts +78 -66
  166. package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
  167. package/dist/telemetry/server/ServerTelemetryManager.mjs +260 -201
  168. package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
  169. package/dist/telemetry/server/ServerTelemetryRequest.d.ts +8 -8
  170. package/dist/url/IUri.d.ts +12 -12
  171. package/dist/url/UrlString.d.ts +48 -48
  172. package/dist/url/UrlString.mjs +161 -161
  173. package/dist/utils/ClientAssertionUtils.d.ts +2 -2
  174. package/dist/utils/ClientAssertionUtils.mjs +16 -16
  175. package/dist/utils/Constants.d.ts +309 -309
  176. package/dist/utils/Constants.mjs +322 -322
  177. package/dist/utils/FunctionWrappers.d.ts +27 -27
  178. package/dist/utils/FunctionWrappers.mjs +94 -94
  179. package/dist/utils/MsalTypes.d.ts +6 -6
  180. package/dist/utils/ProtocolUtils.d.ts +42 -42
  181. package/dist/utils/ProtocolUtils.mjs +69 -69
  182. package/dist/utils/StringUtils.d.ts +40 -40
  183. package/dist/utils/StringUtils.mjs +95 -95
  184. package/dist/utils/TimeUtils.d.ts +25 -25
  185. package/dist/utils/TimeUtils.mjs +43 -43
  186. package/dist/utils/UrlUtils.d.ts +10 -10
  187. package/dist/utils/UrlUtils.mjs +44 -44
  188. package/package.json +1 -1
  189. package/src/cache/entities/ServerTelemetryEntity.ts +1 -0
  190. package/src/constants/AADServerParamKeys.ts +1 -0
  191. package/src/packageMetadata.ts +1 -1
  192. package/src/telemetry/performance/PerformanceEvent.ts +12 -0
  193. package/src/telemetry/server/ServerTelemetryManager.ts +95 -1
@@ -1,498 +1,498 @@
1
- import { AccountFilter, CredentialFilter, ValidCredentialType, AppMetadataFilter, AppMetadataCache, TokenKeys } from "./utils/CacheTypes";
2
- import { CacheRecord } from "./entities/CacheRecord";
3
- import { AccountEntity } from "./entities/AccountEntity";
4
- import { AccessTokenEntity } from "./entities/AccessTokenEntity";
5
- import { IdTokenEntity } from "./entities/IdTokenEntity";
6
- import { RefreshTokenEntity } from "./entities/RefreshTokenEntity";
7
- import { ICacheManager } from "./interface/ICacheManager";
8
- import { AccountInfo } from "../account/AccountInfo";
9
- import { AppMetadataEntity } from "./entities/AppMetadataEntity";
10
- import { ServerTelemetryEntity } from "./entities/ServerTelemetryEntity";
11
- import { ThrottlingEntity } from "./entities/ThrottlingEntity";
12
- import { ICrypto } from "../crypto/ICrypto";
13
- import { AuthorityMetadataEntity } from "./entities/AuthorityMetadataEntity";
14
- import { BaseAuthRequest } from "../request/BaseAuthRequest";
15
- import { Logger } from "../logger/Logger";
16
- import { StoreInCache } from "../request/StoreInCache";
17
- import { StaticAuthorityOptions } from "../authority/AuthorityOptions";
18
- import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
19
- /**
20
- * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
21
- * @internal
22
- */
23
- export declare abstract class CacheManager implements ICacheManager {
24
- protected clientId: string;
25
- protected cryptoImpl: ICrypto;
26
- private commonLogger;
27
- private staticAuthorityOptions?;
28
- constructor(clientId: string, cryptoImpl: ICrypto, logger: Logger, staticAuthorityOptions?: StaticAuthorityOptions);
29
- /**
30
- * fetch the account entity from the platform cache
31
- * @param accountKey
32
- */
33
- abstract getAccount(accountKey: string, logger?: Logger): AccountEntity | null;
34
- /**
35
- * Returns deserialized account if found in the cache, otherwiser returns null
36
- */
37
- abstract getCachedAccountEntity(accountKey: string): AccountEntity | null;
38
- /**
39
- * set account entity in the platform cache
40
- * @param account
41
- */
42
- abstract setAccount(account: AccountEntity): void;
43
- /**
44
- * remove account entity from the platform cache if it's outdated
45
- */
46
- abstract removeOutdatedAccount(accountKey: string): void;
47
- /**
48
- * fetch the idToken entity from the platform cache
49
- * @param idTokenKey
50
- */
51
- abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
52
- /**
53
- * set idToken entity to the platform cache
54
- * @param idToken
55
- */
56
- abstract setIdTokenCredential(idToken: IdTokenEntity): void;
57
- /**
58
- * fetch the idToken entity from the platform cache
59
- * @param accessTokenKey
60
- */
61
- abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
62
- /**
63
- * set idToken entity to the platform cache
64
- * @param accessToken
65
- */
66
- abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;
67
- /**
68
- * fetch the idToken entity from the platform cache
69
- * @param refreshTokenKey
70
- */
71
- abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
72
- /**
73
- * set idToken entity to the platform cache
74
- * @param refreshToken
75
- */
76
- abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
77
- /**
78
- * fetch appMetadata entity from the platform cache
79
- * @param appMetadataKey
80
- */
81
- abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
82
- /**
83
- * set appMetadata entity to the platform cache
84
- * @param appMetadata
85
- */
86
- abstract setAppMetadata(appMetadata: AppMetadataEntity): void;
87
- /**
88
- * fetch server telemetry entity from the platform cache
89
- * @param serverTelemetryKey
90
- */
91
- abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
92
- /**
93
- * set server telemetry entity to the platform cache
94
- * @param serverTelemetryKey
95
- * @param serverTelemetry
96
- */
97
- abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
98
- /**
99
- * fetch cloud discovery metadata entity from the platform cache
100
- * @param key
101
- */
102
- abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
103
- /**
104
- *
105
- */
106
- abstract getAuthorityMetadataKeys(): Array<string>;
107
- /**
108
- * set cloud discovery metadata entity to the platform cache
109
- * @param key
110
- * @param value
111
- */
112
- abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;
113
- /**
114
- * fetch throttling entity from the platform cache
115
- * @param throttlingCacheKey
116
- */
117
- abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
118
- /**
119
- * set throttling entity to the platform cache
120
- * @param throttlingCacheKey
121
- * @param throttlingCache
122
- */
123
- abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
124
- /**
125
- * Function to remove an item from cache given its key.
126
- * @param key
127
- */
128
- abstract removeItem(key: string): void;
129
- /**
130
- * Function which retrieves all current keys from the cache.
131
- */
132
- abstract getKeys(): string[];
133
- /**
134
- * Function which retrieves all account keys from the cache
135
- */
136
- abstract getAccountKeys(): string[];
137
- /**
138
- * Function which retrieves all token keys from the cache
139
- */
140
- abstract getTokenKeys(): TokenKeys;
141
- /**
142
- * Function which clears cache.
143
- */
144
- abstract clear(): Promise<void>;
145
- /**
146
- * Function which updates an outdated credential cache key
147
- */
148
- abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
149
- /**
150
- * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
151
- * @param accountFilter - (Optional) filter to narrow down the accounts returned
152
- * @returns Array of AccountInfo objects in cache
153
- */
154
- getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
155
- /**
156
- * Gets first tenanted AccountInfo object found based on provided filters
157
- */
158
- getAccountInfoFilteredBy(accountFilter: AccountFilter): AccountInfo | null;
159
- /**
160
- * Returns a single matching
161
- * @param accountFilter
162
- * @returns
163
- */
164
- getBaseAccountInfo(accountFilter: AccountFilter): AccountInfo | null;
165
- /**
166
- * Matches filtered account entities with cached ID tokens that match the tenant profile-specific account filters
167
- * and builds the account info objects from the matching ID token's claims
168
- * @param cachedAccounts
169
- * @param accountFilter
170
- * @returns Array of AccountInfo objects that match account and tenant profile filters
171
- */
172
- private buildTenantProfiles;
173
- private getTenantedAccountInfoByFilter;
174
- private getTenantProfilesFromAccountEntity;
175
- private tenantProfileMatchesFilter;
176
- private idTokenClaimsMatchTenantProfileFilter;
177
- /**
178
- * saves a cache record
179
- * @param cacheRecord {CacheRecord}
180
- * @param storeInCache {?StoreInCache}
181
- * @param correlationId {?string} correlation id
182
- */
183
- saveCacheRecord(cacheRecord: CacheRecord, storeInCache?: StoreInCache, correlationId?: string): Promise<void>;
184
- /**
185
- * saves access token credential
186
- * @param credential
187
- */
188
- private saveAccessToken;
189
- /**
190
- * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
191
- * Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
192
- * @param accountFilter - An object containing Account properties to filter by
193
- */
194
- getAccountsFilteredBy(accountFilter: AccountFilter): AccountEntity[];
195
- /**
196
- * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided
197
- * @param key
198
- * @param homeAccountId
199
- * @param tenantId
200
- * @returns
201
- */
202
- isAccountKey(key: string, homeAccountId?: string, tenantId?: string): boolean;
203
- /**
204
- * Returns true if the given key matches our credential key schema.
205
- * @param key
206
- */
207
- isCredentialKey(key: string): boolean;
208
- /**
209
- * Returns whether or not the given credential entity matches the filter
210
- * @param entity
211
- * @param filter
212
- * @returns
213
- */
214
- credentialMatchesFilter(entity: ValidCredentialType, filter: CredentialFilter): boolean;
215
- /**
216
- * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata
217
- * @param filter
218
- */
219
- getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache;
220
- /**
221
- * retrieve authorityMetadata that contains a matching alias
222
- * @param filter
223
- */
224
- getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null;
225
- /**
226
- * Removes all accounts and related tokens from cache.
227
- */
228
- removeAllAccounts(): Promise<void>;
229
- /**
230
- * Removes the account and related tokens for a given account key
231
- * @param account
232
- */
233
- removeAccount(accountKey: string): Promise<void>;
234
- /**
235
- * Removes credentials associated with the provided account
236
- * @param account
237
- */
238
- removeAccountContext(account: AccountEntity): Promise<void>;
239
- /**
240
- * Migrates a single-tenant account and all it's associated alternate cross-tenant account objects in the
241
- * cache into a condensed multi-tenant account object with tenant profiles.
242
- * @param accountKey
243
- * @param accountEntity
244
- * @param logger
245
- * @returns
246
- */
247
- protected updateOutdatedCachedAccount(accountKey: string, accountEntity: AccountEntity | null, logger?: Logger): AccountEntity | null;
248
- /**
249
- * returns a boolean if the given credential is removed
250
- * @param credential
251
- */
252
- removeAccessToken(key: string): Promise<void>;
253
- /**
254
- * Removes all app metadata objects from cache.
255
- */
256
- removeAppMetadata(): boolean;
257
- /**
258
- * Retrieve AccountEntity from cache
259
- * @param account
260
- */
261
- readAccountFromCache(account: AccountInfo): AccountEntity | null;
262
- /**
263
- * Retrieve IdTokenEntity from cache
264
- * @param account {AccountInfo}
265
- * @param tokenKeys {?TokenKeys}
266
- * @param targetRealm {?string}
267
- * @param performanceClient {?IPerformanceClient}
268
- * @param correlationId {?string}
269
- */
270
- getIdToken(account: AccountInfo, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): IdTokenEntity | null;
271
- /**
272
- * Gets all idTokens matching the given filter
273
- * @param filter
274
- * @returns
275
- */
276
- getIdTokensByFilter(filter: CredentialFilter, tokenKeys?: TokenKeys): Map<string, IdTokenEntity>;
277
- /**
278
- * Validate the cache key against filter before retrieving and parsing cache value
279
- * @param key
280
- * @param filter
281
- * @returns
282
- */
283
- idTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
284
- /**
285
- * Removes idToken from the cache
286
- * @param key
287
- */
288
- removeIdToken(key: string): void;
289
- /**
290
- * Removes refresh token from the cache
291
- * @param key
292
- */
293
- removeRefreshToken(key: string): void;
294
- /**
295
- * Retrieve AccessTokenEntity from cache
296
- * @param account {AccountInfo}
297
- * @param request {BaseAuthRequest}
298
- * @param tokenKeys {?TokenKeys}
299
- * @param performanceClient {?IPerformanceClient}
300
- * @param correlationId {?string}
301
- */
302
- getAccessToken(account: AccountInfo, request: BaseAuthRequest, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): AccessTokenEntity | null;
303
- /**
304
- * Validate the cache key against filter before retrieving and parsing cache value
305
- * @param key
306
- * @param filter
307
- * @param keyMustContainAllScopes
308
- * @returns
309
- */
310
- accessTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter, keyMustContainAllScopes: boolean): boolean;
311
- /**
312
- * Gets all access tokens matching the filter
313
- * @param filter
314
- * @returns
315
- */
316
- getAccessTokensByFilter(filter: CredentialFilter): AccessTokenEntity[];
317
- /**
318
- * Helper to retrieve the appropriate refresh token from cache
319
- * @param account {AccountInfo}
320
- * @param familyRT {boolean}
321
- * @param tokenKeys {?TokenKeys}
322
- * @param performanceClient {?IPerformanceClient}
323
- * @param correlationId {?string}
324
- */
325
- getRefreshToken(account: AccountInfo, familyRT: boolean, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): RefreshTokenEntity | null;
326
- /**
327
- * Validate the cache key against filter before retrieving and parsing cache value
328
- * @param key
329
- * @param filter
330
- */
331
- refreshTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
332
- /**
333
- * Retrieve AppMetadataEntity from cache
334
- */
335
- readAppMetadataFromCache(environment: string): AppMetadataEntity | null;
336
- /**
337
- * Return the family_id value associated with FOCI
338
- * @param environment
339
- * @param clientId
340
- */
341
- isAppMetadataFOCI(environment: string): boolean;
342
- /**
343
- * helper to match account ids
344
- * @param value
345
- * @param homeAccountId
346
- */
347
- private matchHomeAccountId;
348
- /**
349
- * helper to match account ids
350
- * @param entity
351
- * @param localAccountId
352
- * @returns
353
- */
354
- private matchLocalAccountIdFromTokenClaims;
355
- private matchLocalAccountIdFromTenantProfile;
356
- /**
357
- * helper to match names
358
- * @param entity
359
- * @param name
360
- * @returns true if the downcased name properties are present and match in the filter and the entity
361
- */
362
- private matchName;
363
- /**
364
- * helper to match usernames
365
- * @param entity
366
- * @param username
367
- * @returns
368
- */
369
- private matchUsername;
370
- /**
371
- * helper to match assertion
372
- * @param value
373
- * @param oboAssertion
374
- */
375
- private matchUserAssertionHash;
376
- /**
377
- * helper to match environment
378
- * @param value
379
- * @param environment
380
- */
381
- private matchEnvironment;
382
- /**
383
- * helper to match credential type
384
- * @param entity
385
- * @param credentialType
386
- */
387
- private matchCredentialType;
388
- /**
389
- * helper to match client ids
390
- * @param entity
391
- * @param clientId
392
- */
393
- private matchClientId;
394
- /**
395
- * helper to match family ids
396
- * @param entity
397
- * @param familyId
398
- */
399
- private matchFamilyId;
400
- /**
401
- * helper to match realm
402
- * @param entity
403
- * @param realm
404
- */
405
- private matchRealm;
406
- /**
407
- * helper to match nativeAccountId
408
- * @param entity
409
- * @param nativeAccountId
410
- * @returns boolean indicating the match result
411
- */
412
- private matchNativeAccountId;
413
- /**
414
- * helper to match loginHint which can be either:
415
- * 1. login_hint ID token claim
416
- * 2. username in cached account object
417
- * 3. upn in ID token claims
418
- * @param entity
419
- * @param loginHint
420
- * @returns
421
- */
422
- private matchLoginHintFromTokenClaims;
423
- /**
424
- * Helper to match sid
425
- * @param entity
426
- * @param sid
427
- * @returns true if the sid claim is present and matches the filter
428
- */
429
- private matchSid;
430
- private matchAuthorityType;
431
- /**
432
- * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.
433
- * @param entity
434
- * @param target
435
- */
436
- private matchTarget;
437
- /**
438
- * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise
439
- * @param entity
440
- * @param tokenType
441
- */
442
- private matchTokenType;
443
- /**
444
- * Returns true if the credential's keyId matches the one in the request, false otherwise
445
- * @param entity
446
- * @param keyId
447
- */
448
- private matchKeyId;
449
- /**
450
- * returns if a given cache entity is of the type appmetadata
451
- * @param key
452
- */
453
- private isAppMetadata;
454
- /**
455
- * returns if a given cache entity is of the type authoritymetadata
456
- * @param key
457
- */
458
- protected isAuthorityMetadata(key: string): boolean;
459
- /**
460
- * returns cache key used for cloud instance metadata
461
- */
462
- generateAuthorityMetadataCacheKey(authority: string): string;
463
- /**
464
- * Helper to convert serialized data to object
465
- * @param obj
466
- * @param json
467
- */
468
- static toObject<T>(obj: T, json: object): T;
469
- }
470
- /** @internal */
471
- export declare class DefaultStorageClass extends CacheManager {
472
- setAccount(): void;
473
- getAccount(): AccountEntity;
474
- getCachedAccountEntity(): AccountEntity | null;
475
- setIdTokenCredential(): void;
476
- getIdTokenCredential(): IdTokenEntity;
477
- setAccessTokenCredential(): void;
478
- getAccessTokenCredential(): AccessTokenEntity;
479
- setRefreshTokenCredential(): void;
480
- getRefreshTokenCredential(): RefreshTokenEntity;
481
- setAppMetadata(): void;
482
- getAppMetadata(): AppMetadataEntity;
483
- setServerTelemetry(): void;
484
- getServerTelemetry(): ServerTelemetryEntity;
485
- setAuthorityMetadata(): void;
486
- getAuthorityMetadata(): AuthorityMetadataEntity | null;
487
- getAuthorityMetadataKeys(): Array<string>;
488
- setThrottlingCache(): void;
489
- getThrottlingCache(): ThrottlingEntity;
490
- removeItem(): boolean;
491
- getKeys(): string[];
492
- getAccountKeys(): string[];
493
- getTokenKeys(): TokenKeys;
494
- clear(): Promise<void>;
495
- updateCredentialCacheKey(): string;
496
- removeOutdatedAccount(): void;
497
- }
1
+ import { AccountFilter, CredentialFilter, ValidCredentialType, AppMetadataFilter, AppMetadataCache, TokenKeys } from "./utils/CacheTypes";
2
+ import { CacheRecord } from "./entities/CacheRecord";
3
+ import { AccountEntity } from "./entities/AccountEntity";
4
+ import { AccessTokenEntity } from "./entities/AccessTokenEntity";
5
+ import { IdTokenEntity } from "./entities/IdTokenEntity";
6
+ import { RefreshTokenEntity } from "./entities/RefreshTokenEntity";
7
+ import { ICacheManager } from "./interface/ICacheManager";
8
+ import { AccountInfo } from "../account/AccountInfo";
9
+ import { AppMetadataEntity } from "./entities/AppMetadataEntity";
10
+ import { ServerTelemetryEntity } from "./entities/ServerTelemetryEntity";
11
+ import { ThrottlingEntity } from "./entities/ThrottlingEntity";
12
+ import { ICrypto } from "../crypto/ICrypto";
13
+ import { AuthorityMetadataEntity } from "./entities/AuthorityMetadataEntity";
14
+ import { BaseAuthRequest } from "../request/BaseAuthRequest";
15
+ import { Logger } from "../logger/Logger";
16
+ import { StoreInCache } from "../request/StoreInCache";
17
+ import { StaticAuthorityOptions } from "../authority/AuthorityOptions";
18
+ import { IPerformanceClient } from "../telemetry/performance/IPerformanceClient";
19
+ /**
20
+ * Interface class which implement cache storage functions used by MSAL to perform validity checks, and store tokens.
21
+ * @internal
22
+ */
23
+ export declare abstract class CacheManager implements ICacheManager {
24
+ protected clientId: string;
25
+ protected cryptoImpl: ICrypto;
26
+ private commonLogger;
27
+ private staticAuthorityOptions?;
28
+ constructor(clientId: string, cryptoImpl: ICrypto, logger: Logger, staticAuthorityOptions?: StaticAuthorityOptions);
29
+ /**
30
+ * fetch the account entity from the platform cache
31
+ * @param accountKey
32
+ */
33
+ abstract getAccount(accountKey: string, logger?: Logger): AccountEntity | null;
34
+ /**
35
+ * Returns deserialized account if found in the cache, otherwiser returns null
36
+ */
37
+ abstract getCachedAccountEntity(accountKey: string): AccountEntity | null;
38
+ /**
39
+ * set account entity in the platform cache
40
+ * @param account
41
+ */
42
+ abstract setAccount(account: AccountEntity): void;
43
+ /**
44
+ * remove account entity from the platform cache if it's outdated
45
+ */
46
+ abstract removeOutdatedAccount(accountKey: string): void;
47
+ /**
48
+ * fetch the idToken entity from the platform cache
49
+ * @param idTokenKey
50
+ */
51
+ abstract getIdTokenCredential(idTokenKey: string): IdTokenEntity | null;
52
+ /**
53
+ * set idToken entity to the platform cache
54
+ * @param idToken
55
+ */
56
+ abstract setIdTokenCredential(idToken: IdTokenEntity): void;
57
+ /**
58
+ * fetch the idToken entity from the platform cache
59
+ * @param accessTokenKey
60
+ */
61
+ abstract getAccessTokenCredential(accessTokenKey: string): AccessTokenEntity | null;
62
+ /**
63
+ * set idToken entity to the platform cache
64
+ * @param accessToken
65
+ */
66
+ abstract setAccessTokenCredential(accessToken: AccessTokenEntity): void;
67
+ /**
68
+ * fetch the idToken entity from the platform cache
69
+ * @param refreshTokenKey
70
+ */
71
+ abstract getRefreshTokenCredential(refreshTokenKey: string): RefreshTokenEntity | null;
72
+ /**
73
+ * set idToken entity to the platform cache
74
+ * @param refreshToken
75
+ */
76
+ abstract setRefreshTokenCredential(refreshToken: RefreshTokenEntity): void;
77
+ /**
78
+ * fetch appMetadata entity from the platform cache
79
+ * @param appMetadataKey
80
+ */
81
+ abstract getAppMetadata(appMetadataKey: string): AppMetadataEntity | null;
82
+ /**
83
+ * set appMetadata entity to the platform cache
84
+ * @param appMetadata
85
+ */
86
+ abstract setAppMetadata(appMetadata: AppMetadataEntity): void;
87
+ /**
88
+ * fetch server telemetry entity from the platform cache
89
+ * @param serverTelemetryKey
90
+ */
91
+ abstract getServerTelemetry(serverTelemetryKey: string): ServerTelemetryEntity | null;
92
+ /**
93
+ * set server telemetry entity to the platform cache
94
+ * @param serverTelemetryKey
95
+ * @param serverTelemetry
96
+ */
97
+ abstract setServerTelemetry(serverTelemetryKey: string, serverTelemetry: ServerTelemetryEntity): void;
98
+ /**
99
+ * fetch cloud discovery metadata entity from the platform cache
100
+ * @param key
101
+ */
102
+ abstract getAuthorityMetadata(key: string): AuthorityMetadataEntity | null;
103
+ /**
104
+ *
105
+ */
106
+ abstract getAuthorityMetadataKeys(): Array<string>;
107
+ /**
108
+ * set cloud discovery metadata entity to the platform cache
109
+ * @param key
110
+ * @param value
111
+ */
112
+ abstract setAuthorityMetadata(key: string, value: AuthorityMetadataEntity): void;
113
+ /**
114
+ * fetch throttling entity from the platform cache
115
+ * @param throttlingCacheKey
116
+ */
117
+ abstract getThrottlingCache(throttlingCacheKey: string): ThrottlingEntity | null;
118
+ /**
119
+ * set throttling entity to the platform cache
120
+ * @param throttlingCacheKey
121
+ * @param throttlingCache
122
+ */
123
+ abstract setThrottlingCache(throttlingCacheKey: string, throttlingCache: ThrottlingEntity): void;
124
+ /**
125
+ * Function to remove an item from cache given its key.
126
+ * @param key
127
+ */
128
+ abstract removeItem(key: string): void;
129
+ /**
130
+ * Function which retrieves all current keys from the cache.
131
+ */
132
+ abstract getKeys(): string[];
133
+ /**
134
+ * Function which retrieves all account keys from the cache
135
+ */
136
+ abstract getAccountKeys(): string[];
137
+ /**
138
+ * Function which retrieves all token keys from the cache
139
+ */
140
+ abstract getTokenKeys(): TokenKeys;
141
+ /**
142
+ * Function which clears cache.
143
+ */
144
+ abstract clear(): Promise<void>;
145
+ /**
146
+ * Function which updates an outdated credential cache key
147
+ */
148
+ abstract updateCredentialCacheKey(currentCacheKey: string, credential: ValidCredentialType): string;
149
+ /**
150
+ * Returns all the accounts in the cache that match the optional filter. If no filter is provided, all accounts are returned.
151
+ * @param accountFilter - (Optional) filter to narrow down the accounts returned
152
+ * @returns Array of AccountInfo objects in cache
153
+ */
154
+ getAllAccounts(accountFilter?: AccountFilter): AccountInfo[];
155
+ /**
156
+ * Gets first tenanted AccountInfo object found based on provided filters
157
+ */
158
+ getAccountInfoFilteredBy(accountFilter: AccountFilter): AccountInfo | null;
159
+ /**
160
+ * Returns a single matching
161
+ * @param accountFilter
162
+ * @returns
163
+ */
164
+ getBaseAccountInfo(accountFilter: AccountFilter): AccountInfo | null;
165
+ /**
166
+ * Matches filtered account entities with cached ID tokens that match the tenant profile-specific account filters
167
+ * and builds the account info objects from the matching ID token's claims
168
+ * @param cachedAccounts
169
+ * @param accountFilter
170
+ * @returns Array of AccountInfo objects that match account and tenant profile filters
171
+ */
172
+ private buildTenantProfiles;
173
+ private getTenantedAccountInfoByFilter;
174
+ private getTenantProfilesFromAccountEntity;
175
+ private tenantProfileMatchesFilter;
176
+ private idTokenClaimsMatchTenantProfileFilter;
177
+ /**
178
+ * saves a cache record
179
+ * @param cacheRecord {CacheRecord}
180
+ * @param storeInCache {?StoreInCache}
181
+ * @param correlationId {?string} correlation id
182
+ */
183
+ saveCacheRecord(cacheRecord: CacheRecord, storeInCache?: StoreInCache, correlationId?: string): Promise<void>;
184
+ /**
185
+ * saves access token credential
186
+ * @param credential
187
+ */
188
+ private saveAccessToken;
189
+ /**
190
+ * Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
191
+ * Not checking for casing as keys are all generated in lower case, remember to convert to lower case if object properties are compared
192
+ * @param accountFilter - An object containing Account properties to filter by
193
+ */
194
+ getAccountsFilteredBy(accountFilter: AccountFilter): AccountEntity[];
195
+ /**
196
+ * Returns true if the given key matches our account key schema. Also matches homeAccountId and/or tenantId if provided
197
+ * @param key
198
+ * @param homeAccountId
199
+ * @param tenantId
200
+ * @returns
201
+ */
202
+ isAccountKey(key: string, homeAccountId?: string, tenantId?: string): boolean;
203
+ /**
204
+ * Returns true if the given key matches our credential key schema.
205
+ * @param key
206
+ */
207
+ isCredentialKey(key: string): boolean;
208
+ /**
209
+ * Returns whether or not the given credential entity matches the filter
210
+ * @param entity
211
+ * @param filter
212
+ * @returns
213
+ */
214
+ credentialMatchesFilter(entity: ValidCredentialType, filter: CredentialFilter): boolean;
215
+ /**
216
+ * retrieve appMetadata matching all provided filters; if no filter is set, get all appMetadata
217
+ * @param filter
218
+ */
219
+ getAppMetadataFilteredBy(filter: AppMetadataFilter): AppMetadataCache;
220
+ /**
221
+ * retrieve authorityMetadata that contains a matching alias
222
+ * @param filter
223
+ */
224
+ getAuthorityMetadataByAlias(host: string): AuthorityMetadataEntity | null;
225
+ /**
226
+ * Removes all accounts and related tokens from cache.
227
+ */
228
+ removeAllAccounts(): Promise<void>;
229
+ /**
230
+ * Removes the account and related tokens for a given account key
231
+ * @param account
232
+ */
233
+ removeAccount(accountKey: string): Promise<void>;
234
+ /**
235
+ * Removes credentials associated with the provided account
236
+ * @param account
237
+ */
238
+ removeAccountContext(account: AccountEntity): Promise<void>;
239
+ /**
240
+ * Migrates a single-tenant account and all it's associated alternate cross-tenant account objects in the
241
+ * cache into a condensed multi-tenant account object with tenant profiles.
242
+ * @param accountKey
243
+ * @param accountEntity
244
+ * @param logger
245
+ * @returns
246
+ */
247
+ protected updateOutdatedCachedAccount(accountKey: string, accountEntity: AccountEntity | null, logger?: Logger): AccountEntity | null;
248
+ /**
249
+ * returns a boolean if the given credential is removed
250
+ * @param credential
251
+ */
252
+ removeAccessToken(key: string): Promise<void>;
253
+ /**
254
+ * Removes all app metadata objects from cache.
255
+ */
256
+ removeAppMetadata(): boolean;
257
+ /**
258
+ * Retrieve AccountEntity from cache
259
+ * @param account
260
+ */
261
+ readAccountFromCache(account: AccountInfo): AccountEntity | null;
262
+ /**
263
+ * Retrieve IdTokenEntity from cache
264
+ * @param account {AccountInfo}
265
+ * @param tokenKeys {?TokenKeys}
266
+ * @param targetRealm {?string}
267
+ * @param performanceClient {?IPerformanceClient}
268
+ * @param correlationId {?string}
269
+ */
270
+ getIdToken(account: AccountInfo, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): IdTokenEntity | null;
271
+ /**
272
+ * Gets all idTokens matching the given filter
273
+ * @param filter
274
+ * @returns
275
+ */
276
+ getIdTokensByFilter(filter: CredentialFilter, tokenKeys?: TokenKeys): Map<string, IdTokenEntity>;
277
+ /**
278
+ * Validate the cache key against filter before retrieving and parsing cache value
279
+ * @param key
280
+ * @param filter
281
+ * @returns
282
+ */
283
+ idTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
284
+ /**
285
+ * Removes idToken from the cache
286
+ * @param key
287
+ */
288
+ removeIdToken(key: string): void;
289
+ /**
290
+ * Removes refresh token from the cache
291
+ * @param key
292
+ */
293
+ removeRefreshToken(key: string): void;
294
+ /**
295
+ * Retrieve AccessTokenEntity from cache
296
+ * @param account {AccountInfo}
297
+ * @param request {BaseAuthRequest}
298
+ * @param tokenKeys {?TokenKeys}
299
+ * @param performanceClient {?IPerformanceClient}
300
+ * @param correlationId {?string}
301
+ */
302
+ getAccessToken(account: AccountInfo, request: BaseAuthRequest, tokenKeys?: TokenKeys, targetRealm?: string, performanceClient?: IPerformanceClient, correlationId?: string): AccessTokenEntity | null;
303
+ /**
304
+ * Validate the cache key against filter before retrieving and parsing cache value
305
+ * @param key
306
+ * @param filter
307
+ * @param keyMustContainAllScopes
308
+ * @returns
309
+ */
310
+ accessTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter, keyMustContainAllScopes: boolean): boolean;
311
+ /**
312
+ * Gets all access tokens matching the filter
313
+ * @param filter
314
+ * @returns
315
+ */
316
+ getAccessTokensByFilter(filter: CredentialFilter): AccessTokenEntity[];
317
+ /**
318
+ * Helper to retrieve the appropriate refresh token from cache
319
+ * @param account {AccountInfo}
320
+ * @param familyRT {boolean}
321
+ * @param tokenKeys {?TokenKeys}
322
+ * @param performanceClient {?IPerformanceClient}
323
+ * @param correlationId {?string}
324
+ */
325
+ getRefreshToken(account: AccountInfo, familyRT: boolean, tokenKeys?: TokenKeys, performanceClient?: IPerformanceClient, correlationId?: string): RefreshTokenEntity | null;
326
+ /**
327
+ * Validate the cache key against filter before retrieving and parsing cache value
328
+ * @param key
329
+ * @param filter
330
+ */
331
+ refreshTokenKeyMatchesFilter(inputKey: string, filter: CredentialFilter): boolean;
332
+ /**
333
+ * Retrieve AppMetadataEntity from cache
334
+ */
335
+ readAppMetadataFromCache(environment: string): AppMetadataEntity | null;
336
+ /**
337
+ * Return the family_id value associated with FOCI
338
+ * @param environment
339
+ * @param clientId
340
+ */
341
+ isAppMetadataFOCI(environment: string): boolean;
342
+ /**
343
+ * helper to match account ids
344
+ * @param value
345
+ * @param homeAccountId
346
+ */
347
+ private matchHomeAccountId;
348
+ /**
349
+ * helper to match account ids
350
+ * @param entity
351
+ * @param localAccountId
352
+ * @returns
353
+ */
354
+ private matchLocalAccountIdFromTokenClaims;
355
+ private matchLocalAccountIdFromTenantProfile;
356
+ /**
357
+ * helper to match names
358
+ * @param entity
359
+ * @param name
360
+ * @returns true if the downcased name properties are present and match in the filter and the entity
361
+ */
362
+ private matchName;
363
+ /**
364
+ * helper to match usernames
365
+ * @param entity
366
+ * @param username
367
+ * @returns
368
+ */
369
+ private matchUsername;
370
+ /**
371
+ * helper to match assertion
372
+ * @param value
373
+ * @param oboAssertion
374
+ */
375
+ private matchUserAssertionHash;
376
+ /**
377
+ * helper to match environment
378
+ * @param value
379
+ * @param environment
380
+ */
381
+ private matchEnvironment;
382
+ /**
383
+ * helper to match credential type
384
+ * @param entity
385
+ * @param credentialType
386
+ */
387
+ private matchCredentialType;
388
+ /**
389
+ * helper to match client ids
390
+ * @param entity
391
+ * @param clientId
392
+ */
393
+ private matchClientId;
394
+ /**
395
+ * helper to match family ids
396
+ * @param entity
397
+ * @param familyId
398
+ */
399
+ private matchFamilyId;
400
+ /**
401
+ * helper to match realm
402
+ * @param entity
403
+ * @param realm
404
+ */
405
+ private matchRealm;
406
+ /**
407
+ * helper to match nativeAccountId
408
+ * @param entity
409
+ * @param nativeAccountId
410
+ * @returns boolean indicating the match result
411
+ */
412
+ private matchNativeAccountId;
413
+ /**
414
+ * helper to match loginHint which can be either:
415
+ * 1. login_hint ID token claim
416
+ * 2. username in cached account object
417
+ * 3. upn in ID token claims
418
+ * @param entity
419
+ * @param loginHint
420
+ * @returns
421
+ */
422
+ private matchLoginHintFromTokenClaims;
423
+ /**
424
+ * Helper to match sid
425
+ * @param entity
426
+ * @param sid
427
+ * @returns true if the sid claim is present and matches the filter
428
+ */
429
+ private matchSid;
430
+ private matchAuthorityType;
431
+ /**
432
+ * Returns true if the target scopes are a subset of the current entity's scopes, false otherwise.
433
+ * @param entity
434
+ * @param target
435
+ */
436
+ private matchTarget;
437
+ /**
438
+ * Returns true if the credential's tokenType or Authentication Scheme matches the one in the request, false otherwise
439
+ * @param entity
440
+ * @param tokenType
441
+ */
442
+ private matchTokenType;
443
+ /**
444
+ * Returns true if the credential's keyId matches the one in the request, false otherwise
445
+ * @param entity
446
+ * @param keyId
447
+ */
448
+ private matchKeyId;
449
+ /**
450
+ * returns if a given cache entity is of the type appmetadata
451
+ * @param key
452
+ */
453
+ private isAppMetadata;
454
+ /**
455
+ * returns if a given cache entity is of the type authoritymetadata
456
+ * @param key
457
+ */
458
+ protected isAuthorityMetadata(key: string): boolean;
459
+ /**
460
+ * returns cache key used for cloud instance metadata
461
+ */
462
+ generateAuthorityMetadataCacheKey(authority: string): string;
463
+ /**
464
+ * Helper to convert serialized data to object
465
+ * @param obj
466
+ * @param json
467
+ */
468
+ static toObject<T>(obj: T, json: object): T;
469
+ }
470
+ /** @internal */
471
+ export declare class DefaultStorageClass extends CacheManager {
472
+ setAccount(): void;
473
+ getAccount(): AccountEntity;
474
+ getCachedAccountEntity(): AccountEntity | null;
475
+ setIdTokenCredential(): void;
476
+ getIdTokenCredential(): IdTokenEntity;
477
+ setAccessTokenCredential(): void;
478
+ getAccessTokenCredential(): AccessTokenEntity;
479
+ setRefreshTokenCredential(): void;
480
+ getRefreshTokenCredential(): RefreshTokenEntity;
481
+ setAppMetadata(): void;
482
+ getAppMetadata(): AppMetadataEntity;
483
+ setServerTelemetry(): void;
484
+ getServerTelemetry(): ServerTelemetryEntity;
485
+ setAuthorityMetadata(): void;
486
+ getAuthorityMetadata(): AuthorityMetadataEntity | null;
487
+ getAuthorityMetadataKeys(): Array<string>;
488
+ setThrottlingCache(): void;
489
+ getThrottlingCache(): ThrottlingEntity;
490
+ removeItem(): boolean;
491
+ getKeys(): string[];
492
+ getAccountKeys(): string[];
493
+ getTokenKeys(): TokenKeys;
494
+ clear(): Promise<void>;
495
+ updateCredentialCacheKey(): string;
496
+ removeOutdatedAccount(): void;
497
+ }
498
498
  //# sourceMappingURL=CacheManager.d.ts.map