Estructura inicial del proyecto
This commit is contained in:
49
backend/node_modules/@azure/msal-node/dist/cache/distributed/DistributedCachePlugin.mjs
generated
vendored
Normal file
49
backend/node_modules/@azure/msal-node/dist/cache/distributed/DistributedCachePlugin.mjs
generated
vendored
Normal file
@ -0,0 +1,49 @@
|
||||
/*! @azure/msal-node v5.2.2 2026-05-19 */
|
||||
'use strict';
|
||||
import { AccountEntityUtils } from '@azure/msal-common/node';
|
||||
|
||||
/*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License.
|
||||
*/
|
||||
/**
|
||||
* Cache plugin that serializes data to the cache and deserializes data from the cache
|
||||
* @public
|
||||
*/
|
||||
class DistributedCachePlugin {
|
||||
constructor(client, partitionManager) {
|
||||
this.client = client;
|
||||
this.partitionManager = partitionManager;
|
||||
}
|
||||
/**
|
||||
* Deserializes the cache before accessing it
|
||||
* @param cacheContext - TokenCacheContext
|
||||
*/
|
||||
async beforeCacheAccess(cacheContext) {
|
||||
const partitionKey = await this.partitionManager.getKey();
|
||||
const cacheData = await this.client.get(partitionKey);
|
||||
cacheContext.tokenCache.deserialize(cacheData);
|
||||
}
|
||||
/**
|
||||
* Serializes the cache after accessing it
|
||||
* @param cacheContext - TokenCacheContext
|
||||
*/
|
||||
async afterCacheAccess(cacheContext) {
|
||||
if (cacheContext.cacheHasChanged) {
|
||||
const kvStore = cacheContext.tokenCache.getKVStore();
|
||||
const accountEntities = Object.values(kvStore).filter((value) => AccountEntityUtils.isAccountEntity(value));
|
||||
let partitionKey;
|
||||
if (accountEntities.length > 0) {
|
||||
const accountEntity = accountEntities[0];
|
||||
partitionKey = await this.partitionManager.extractKey(accountEntity);
|
||||
}
|
||||
else {
|
||||
partitionKey = await this.partitionManager.getKey();
|
||||
}
|
||||
await this.client.set(partitionKey, cacheContext.tokenCache.serialize());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export { DistributedCachePlugin };
|
||||
//# sourceMappingURL=DistributedCachePlugin.mjs.map
|
||||
1
backend/node_modules/@azure/msal-node/dist/cache/distributed/DistributedCachePlugin.mjs.map
generated
vendored
Normal file
1
backend/node_modules/@azure/msal-node/dist/cache/distributed/DistributedCachePlugin.mjs.map
generated
vendored
Normal file
@ -0,0 +1 @@
|
||||
{"version":3,"file":"DistributedCachePlugin.mjs","sources":["../../../src/cache/distributed/DistributedCachePlugin.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;AAYH;;;AAGG;MACU,sBAAsB,CAAA;IAI/B,WAAY,CAAA,MAAoB,EAAE,gBAAmC,EAAA;AACjE,QAAA,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;AACrB,QAAA,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;KAC5C;AAED;;;AAGG;IACI,MAAM,iBAAiB,CAC1B,YAA+B,EAAA;QAE/B,MAAM,YAAY,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,MAAM,EAAE,CAAC;QAC1D,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,YAAY,CAAC,CAAC;AACtD,QAAA,YAAY,CAAC,UAAU,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC;KAClD;AAED;;;AAGG;IACI,MAAM,gBAAgB,CACzB,YAA+B,EAAA;QAE/B,IAAI,YAAY,CAAC,eAAe,EAAE;YAC9B,MAAM,OAAO,GACT,YAAY,CAAC,UAChB,CAAC,UAAU,EAAE,CAAC;YACf,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,MAAM,CAAC,CAAC,KAAK,KACxD,kBAAkB,CAAC,eAAe,CAAC,KAAe,CAAC,CACtD,CAAC;AAEF,YAAA,IAAI,YAAoB,CAAC;AACzB,YAAA,IAAI,eAAe,CAAC,MAAM,GAAG,CAAC,EAAE;AAC5B,gBAAA,MAAM,aAAa,GAAG,eAAe,CAAC,CAAC,CAAkB,CAAC;gBAC1D,YAAY,GAAG,MAAM,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