@azure/identity-cache-persistence
Version:
A secure, persistent token cache for Azure Identity credentials that uses the OS secret-management API
25 lines • 927 B
JavaScript
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
import { msalPersistencePlatforms } from "./platforms.js";
import { PersistenceCachePlugin } from "@azure/msal-node-extensions";
/**
* This is used to gain access to the underlying Persistence instance, which we use for testing
*
* @returns a raw persistence instance
* @internal
*/
export async function createPersistence(options) {
const persistence = await msalPersistencePlatforms[process.platform]?.(options);
if (persistence === undefined) {
throw new Error("no persistence providers are available on this platform");
}
return persistence;
}
export async function createPersistenceCachePlugin(options) {
const persistence = await createPersistence(options ?? {});
return new PersistenceCachePlugin(persistence, {
retryNumber: 100,
retryDelay: 50,
});
}
//# sourceMappingURL=provider.js.map