39 lines
1.0 KiB
JavaScript
39 lines
1.0 KiB
JavaScript
/*! @azure/msal-node-extensions v1.5.17 2025-07-08 */
|
|
'use strict';
|
|
import { createRequire } from 'module';
|
|
|
|
/*
|
|
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
* Licensed under the MIT License.
|
|
*/
|
|
class UnavailableDpapi {
|
|
constructor(errorMessage) {
|
|
this.errorMessage = errorMessage;
|
|
}
|
|
protectData() {
|
|
throw new Error(this.errorMessage);
|
|
}
|
|
unprotectData() {
|
|
throw new Error(this.errorMessage);
|
|
}
|
|
}
|
|
let Dpapi;
|
|
if (process.platform !== "win32") {
|
|
Dpapi = new UnavailableDpapi("Dpapi is not supported on this platform");
|
|
}
|
|
else {
|
|
// In .mjs files, require is not defined. We need to use createRequire to get a require function
|
|
const safeRequire = typeof require !== "undefined"
|
|
? require
|
|
: createRequire(import.meta.url);
|
|
try {
|
|
Dpapi = safeRequire(`../bin/${process.arch}/dpapi`);
|
|
}
|
|
catch (e) {
|
|
Dpapi = new UnavailableDpapi("Dpapi bindings unavailable");
|
|
}
|
|
}
|
|
|
|
export { Dpapi };
|
|
//# sourceMappingURL=Dpapi.mjs.map
|