@azure/msal-common 14.16.0 → 15.0.0-alpha.0
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.
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/ClientInfo.mjs +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/authority/Authority.mjs +1 -1
- package/dist/authority/AuthorityFactory.mjs +1 -1
- package/dist/authority/AuthorityMetadata.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/RegionDiscovery.mjs +1 -1
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts +1 -0
- package/dist/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
- package/dist/cache/CacheManager.d.ts +8 -32
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +10 -74
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccountEntity.mjs +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +4 -4
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +1 -1
- package/dist/client/BaseClient.mjs +1 -1
- package/dist/client/RefreshTokenClient.mjs +1 -1
- package/dist/client/SilentFlowClient.mjs +1 -1
- package/dist/config/ClientConfiguration.mjs +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +1 -1
- package/dist/error/AuthError.mjs +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.mjs +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.mjs +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +1 -1
- package/dist/error/ClientConfigurationError.mjs +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.mjs +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/index-browser.mjs +1 -1
- package/dist/index-node.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/logger/Logger.mjs +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/ThrottlingUtils.mjs +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthenticationHeaderParser.mjs +1 -1
- package/dist/request/RequestParameterBuilder.mjs +1 -1
- package/dist/request/RequestValidator.mjs +1 -1
- package/dist/request/ScopeSet.mjs +1 -1
- package/dist/response/ResponseHandler.mjs +3 -3
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +1 -1
- package/dist/url/UrlString.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/Constants.d.ts +0 -6
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +1 -7
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +1 -1
- package/dist/utils/ProtocolUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/UrlUtils.mjs +1 -1
- package/lib/index-browser.cjs +2 -2
- package/lib/{index-node-C9XsExml.js → index-node-DDJMpU-A.js} +13 -83
- package/lib/index-node-DDJMpU-A.js.map +1 -0
- package/lib/index-node.cjs +2 -2
- package/lib/index.cjs +2 -2
- package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts +1 -0
- package/lib/types/broker/nativeBroker/INativeBrokerPlugin.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +8 -32
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +4 -4
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +0 -6
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/cache/CacheManager.ts +16 -122
- package/src/cache/interface/ICacheManager.ts +4 -4
- package/src/packageMetadata.ts +1 -1
- package/src/response/ResponseHandler.ts +2 -2
- package/src/utils/Constants.ts +0 -6
- package/lib/index-node-C9XsExml.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! @azure/msal-common
|
|
1
|
+
/*! @azure/msal-common v15.0.0-alpha.0 2024-12-18 */
|
|
2
2
|
'use strict';
|
|
3
3
|
'use strict';
|
|
4
4
|
|
|
@@ -108,12 +108,6 @@ const HeaderNames = {
|
|
|
108
108
|
* Persistent cache keys MSAL which stay while user is logged in.
|
|
109
109
|
*/
|
|
110
110
|
const PersistentCacheKeys = {
|
|
111
|
-
ID_TOKEN: "idtoken",
|
|
112
|
-
CLIENT_INFO: "client.info",
|
|
113
|
-
ADAL_ID_TOKEN: "adal.idtoken",
|
|
114
|
-
ERROR: "error",
|
|
115
|
-
ERROR_DESC: "error.description",
|
|
116
|
-
ACTIVE_ACCOUNT: "active-account",
|
|
117
111
|
ACTIVE_ACCOUNT_FILTERS: "active-account-filters", // new cache entry for active_account for a more robust version for browser
|
|
118
112
|
};
|
|
119
113
|
/**
|
|
@@ -3816,7 +3810,7 @@ class Logger {
|
|
|
3816
3810
|
|
|
3817
3811
|
/* eslint-disable header/header */
|
|
3818
3812
|
const name = "@azure/msal-common";
|
|
3819
|
-
const version = "
|
|
3813
|
+
const version = "15.0.0-alpha.0";
|
|
3820
3814
|
|
|
3821
3815
|
/*
|
|
3822
3816
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
@@ -4601,10 +4595,10 @@ class CacheManager {
|
|
|
4601
4595
|
}
|
|
4602
4596
|
try {
|
|
4603
4597
|
if (!!cacheRecord.account) {
|
|
4604
|
-
this.setAccount(cacheRecord.account);
|
|
4598
|
+
await this.setAccount(cacheRecord.account);
|
|
4605
4599
|
}
|
|
4606
4600
|
if (!!cacheRecord.idToken && storeInCache?.idToken !== false) {
|
|
4607
|
-
this.setIdTokenCredential(cacheRecord.idToken);
|
|
4601
|
+
await this.setIdTokenCredential(cacheRecord.idToken);
|
|
4608
4602
|
}
|
|
4609
4603
|
if (!!cacheRecord.accessToken &&
|
|
4610
4604
|
storeInCache?.accessToken !== false) {
|
|
@@ -4612,7 +4606,7 @@ class CacheManager {
|
|
|
4612
4606
|
}
|
|
4613
4607
|
if (!!cacheRecord.refreshToken &&
|
|
4614
4608
|
storeInCache?.refreshToken !== false) {
|
|
4615
|
-
this.setRefreshTokenCredential(cacheRecord.refreshToken);
|
|
4609
|
+
await this.setRefreshTokenCredential(cacheRecord.refreshToken);
|
|
4616
4610
|
}
|
|
4617
4611
|
if (!!cacheRecord.appMetadata) {
|
|
4618
4612
|
this.setAppMetadata(cacheRecord.appMetadata);
|
|
@@ -4669,7 +4663,7 @@ class CacheManager {
|
|
|
4669
4663
|
}
|
|
4670
4664
|
});
|
|
4671
4665
|
await Promise.all(removedAccessTokens);
|
|
4672
|
-
this.setAccessTokenCredential(credential);
|
|
4666
|
+
await this.setAccessTokenCredential(credential);
|
|
4673
4667
|
}
|
|
4674
4668
|
/**
|
|
4675
4669
|
* Retrieve account entities matching all provided tenant-agnostic filters; if no filter is set, get all account entities in the cache
|
|
@@ -4955,61 +4949,6 @@ class CacheManager {
|
|
|
4955
4949
|
});
|
|
4956
4950
|
await Promise.all(removedCredentials);
|
|
4957
4951
|
}
|
|
4958
|
-
/**
|
|
4959
|
-
* Migrates a single-tenant account and all it's associated alternate cross-tenant account objects in the
|
|
4960
|
-
* cache into a condensed multi-tenant account object with tenant profiles.
|
|
4961
|
-
* @param accountKey
|
|
4962
|
-
* @param accountEntity
|
|
4963
|
-
* @param logger
|
|
4964
|
-
* @returns
|
|
4965
|
-
*/
|
|
4966
|
-
updateOutdatedCachedAccount(accountKey, accountEntity, logger) {
|
|
4967
|
-
// Only update if account entity is defined and has no tenantProfiles object (is outdated)
|
|
4968
|
-
if (accountEntity && accountEntity.isSingleTenant()) {
|
|
4969
|
-
this.commonLogger?.verbose("updateOutdatedCachedAccount: Found a single-tenant (outdated) account entity in the cache, migrating to multi-tenant account entity");
|
|
4970
|
-
// Get keys of all accounts belonging to user
|
|
4971
|
-
const matchingAccountKeys = this.getAccountKeys().filter((key) => {
|
|
4972
|
-
return key.startsWith(accountEntity.homeAccountId);
|
|
4973
|
-
});
|
|
4974
|
-
// Get all account entities belonging to user
|
|
4975
|
-
const accountsToMerge = [];
|
|
4976
|
-
matchingAccountKeys.forEach((key) => {
|
|
4977
|
-
const account = this.getCachedAccountEntity(key);
|
|
4978
|
-
if (account) {
|
|
4979
|
-
accountsToMerge.push(account);
|
|
4980
|
-
}
|
|
4981
|
-
});
|
|
4982
|
-
// Set base account to home account if available, any account if not
|
|
4983
|
-
const baseAccount = accountsToMerge.find((account) => {
|
|
4984
|
-
return tenantIdMatchesHomeTenant(account.realm, account.homeAccountId);
|
|
4985
|
-
}) || accountsToMerge[0];
|
|
4986
|
-
// Populate tenant profiles built from each account entity belonging to the user
|
|
4987
|
-
baseAccount.tenantProfiles = accountsToMerge.map((account) => {
|
|
4988
|
-
return {
|
|
4989
|
-
tenantId: account.realm,
|
|
4990
|
-
localAccountId: account.localAccountId,
|
|
4991
|
-
name: account.name,
|
|
4992
|
-
isHomeTenant: tenantIdMatchesHomeTenant(account.realm, account.homeAccountId),
|
|
4993
|
-
};
|
|
4994
|
-
});
|
|
4995
|
-
const updatedAccount = CacheManager.toObject(new AccountEntity(), {
|
|
4996
|
-
...baseAccount,
|
|
4997
|
-
});
|
|
4998
|
-
const newAccountKey = updatedAccount.generateAccountKey();
|
|
4999
|
-
// Clear cache of legacy account objects that have been collpsed into tenant profiles
|
|
5000
|
-
matchingAccountKeys.forEach((key) => {
|
|
5001
|
-
if (key !== newAccountKey) {
|
|
5002
|
-
this.removeOutdatedAccount(accountKey);
|
|
5003
|
-
}
|
|
5004
|
-
});
|
|
5005
|
-
// Cache updated account object
|
|
5006
|
-
this.setAccount(updatedAccount);
|
|
5007
|
-
logger?.verbose("Updated an outdated account entity in the cache");
|
|
5008
|
-
return updatedAccount;
|
|
5009
|
-
}
|
|
5010
|
-
// No update is necessary
|
|
5011
|
-
return accountEntity;
|
|
5012
|
-
}
|
|
5013
4952
|
/**
|
|
5014
4953
|
* returns a boolean if the given credential is removed
|
|
5015
4954
|
* @param credential
|
|
@@ -5605,28 +5544,25 @@ class CacheManager {
|
|
|
5605
5544
|
}
|
|
5606
5545
|
/** @internal */
|
|
5607
5546
|
class DefaultStorageClass extends CacheManager {
|
|
5608
|
-
setAccount() {
|
|
5547
|
+
async setAccount() {
|
|
5609
5548
|
throw createClientAuthError(methodNotImplemented);
|
|
5610
5549
|
}
|
|
5611
5550
|
getAccount() {
|
|
5612
5551
|
throw createClientAuthError(methodNotImplemented);
|
|
5613
5552
|
}
|
|
5614
|
-
|
|
5615
|
-
throw createClientAuthError(methodNotImplemented);
|
|
5616
|
-
}
|
|
5617
|
-
setIdTokenCredential() {
|
|
5553
|
+
async setIdTokenCredential() {
|
|
5618
5554
|
throw createClientAuthError(methodNotImplemented);
|
|
5619
5555
|
}
|
|
5620
5556
|
getIdTokenCredential() {
|
|
5621
5557
|
throw createClientAuthError(methodNotImplemented);
|
|
5622
5558
|
}
|
|
5623
|
-
setAccessTokenCredential() {
|
|
5559
|
+
async setAccessTokenCredential() {
|
|
5624
5560
|
throw createClientAuthError(methodNotImplemented);
|
|
5625
5561
|
}
|
|
5626
5562
|
getAccessTokenCredential() {
|
|
5627
5563
|
throw createClientAuthError(methodNotImplemented);
|
|
5628
5564
|
}
|
|
5629
|
-
setRefreshTokenCredential() {
|
|
5565
|
+
async setRefreshTokenCredential() {
|
|
5630
5566
|
throw createClientAuthError(methodNotImplemented);
|
|
5631
5567
|
}
|
|
5632
5568
|
getRefreshTokenCredential() {
|
|
@@ -5671,12 +5607,6 @@ class DefaultStorageClass extends CacheManager {
|
|
|
5671
5607
|
getTokenKeys() {
|
|
5672
5608
|
throw createClientAuthError(methodNotImplemented);
|
|
5673
5609
|
}
|
|
5674
|
-
updateCredentialCacheKey() {
|
|
5675
|
-
throw createClientAuthError(methodNotImplemented);
|
|
5676
|
-
}
|
|
5677
|
-
removeOutdatedAccount() {
|
|
5678
|
-
throw createClientAuthError(methodNotImplemented);
|
|
5679
|
-
}
|
|
5680
5610
|
}
|
|
5681
5611
|
|
|
5682
5612
|
/*
|
|
@@ -6992,7 +6922,7 @@ class ResponseHandler {
|
|
|
6992
6922
|
!forceCacheRefreshTokenResponse &&
|
|
6993
6923
|
cacheRecord.account) {
|
|
6994
6924
|
const key = cacheRecord.account.generateAccountKey();
|
|
6995
|
-
const account = this.cacheStorage.getAccount(key
|
|
6925
|
+
const account = this.cacheStorage.getAccount(key);
|
|
6996
6926
|
if (!account) {
|
|
6997
6927
|
this.logger.warning("Account used to refresh tokens not in persistence, refreshed tokens will not be stored in the cache");
|
|
6998
6928
|
return await ResponseHandler.generateAuthenticationResult(this.cryptoObj, authority, cacheRecord, false, request, idTokenClaims, requestStateObj, undefined, serverRequestId);
|
|
@@ -7184,7 +7114,7 @@ function buildAccountToCache(cacheStorage, authority, homeAccountId, base64Decod
|
|
|
7184
7114
|
});
|
|
7185
7115
|
let cachedAccount = null;
|
|
7186
7116
|
if (baseAccountKey) {
|
|
7187
|
-
cachedAccount = cacheStorage.getAccount(baseAccountKey
|
|
7117
|
+
cachedAccount = cacheStorage.getAccount(baseAccountKey);
|
|
7188
7118
|
}
|
|
7189
7119
|
const baseAccount = cachedAccount ||
|
|
7190
7120
|
AccountEntity.createAccount({
|
|
@@ -8449,4 +8379,4 @@ exports.invokeAsync = invokeAsync;
|
|
|
8449
8379
|
exports.tenantIdMatchesHomeTenant = tenantIdMatchesHomeTenant;
|
|
8450
8380
|
exports.updateAccountTenantProfileData = updateAccountTenantProfileData;
|
|
8451
8381
|
exports.version = version;
|
|
8452
|
-
//# sourceMappingURL=index-node-
|
|
8382
|
+
//# sourceMappingURL=index-node-DDJMpU-A.js.map
|