New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@azure/msal-node-extensions

Package Overview
Dependencies
Maintainers
3
Versions
71
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-node-extensions - npm Package Compare versions

Comparing version 1.0.0-alpha.32 to 1.0.0-alpha.34

6

dist/msal-node-extensions.cjs.development.js

@@ -791,3 +791,3 @@ 'use strict';

const name = "@azure/msal-node-extensions";
const version = "1.0.0-alpha.32";
const version = "1.0.0-alpha.34";

@@ -1088,3 +1088,3 @@ /*

this.logger.trace("NativeBrokerPlugin - getAuthenticationResult called", request.correlationId);
let fromCache;
let fromCache = false;
try {

@@ -1113,3 +1113,3 @@ const telemetryJSON = JSON.parse(authResult.telemetryData);

fromCache: fromCache,
expiresOn: new Date(authResult.expiresOn * 1000),
expiresOn: new Date(authResult.expiresOn),
tokenType: authResult.isPopAuthorization ? msalCommon.AuthenticationScheme.POP : msalCommon.AuthenticationScheme.BEARER,

@@ -1116,0 +1116,0 @@ correlationId: request.correlationId,

@@ -1,2 +0,2 @@

"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,r,i=require("fs"),a=require("process"),s=require("path"),o=(e=s)&&"object"==typeof e&&"default"in e?e.default:e,n=require("@azure/msal-common"),c=require("keytar"),l=require("@azure/msal-node-runtime");!function(e){e.WINDOWS="win32",e.LINUX="linux",e.MACOS="darwin"}(t||(t={})),function(e){e.INTERATION_REQUIRED_ERROR_CODE="interaction_required",e.SERVER_UNAVAILABLE="server_unavailable"}(r||(r={}));class h extends Error{constructor(e,t){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,h.prototype),this.errorCode=e,this.errorMessage=t,this.name="PersistenceError"}static createFileSystemError(e,t){return new h(e,t)}static createLibSecretError(e){return new h("GnomeKeyringError",e)}static createKeychainPersistenceError(e){return new h("KeychainError",e)}static createFilePersistenceWithDPAPIError(e){return new h("DPAPIEncryptedFileError",e)}static createCrossPlatformLockError(e){return new h("CrossPlatformLockError",e)}static createCachePersistenceError(e){return new h("CachePersistenceError",e)}static createNotSupportedError(e){return new h("NotSupportedError",e)}static createPersistenceNotVerifiedError(e){return new h("PersistenceNotVerifiedError",e)}static createPersistenceNotValidatedError(e){return new h("PersistenceNotValidatedError",e)}}class u{constructor(e,t,r){this.lockFilePath=e,this.retryNumber=r?r.retryNumber:500,this.retryDelay=r?r.retryDelay:100,this.logger=t}async lock(){for(let e=0;e<this.retryNumber;e++)try{return this.logger.info(`Pid ${a.pid} trying to acquire lock`),this.lockFileHandle=await i.promises.open(this.lockFilePath,"wx+"),this.logger.info(`Pid ${a.pid} acquired lock`),void await this.lockFileHandle.write(a.pid.toString())}catch(e){if("EEXIST"!==e.code&&"EPERM"!==e.code)throw this.logger.error(`${a.pid} was not able to acquire lock. Ran into error: ${e.message}`),h.createCrossPlatformLockError(e.message);this.logger.info(e),await this.sleep(this.retryDelay)}throw this.logger.error(a.pid+" was not able to acquire lock. Exceeded amount of retries set in the options"),h.createCrossPlatformLockError("Not able to acquire lock. Exceeded amount of retries set in options")}async unlock(){try{this.lockFileHandle?(await i.promises.unlink(this.lockFilePath),await this.lockFileHandle.close(),this.logger.info("lockfile deleted")):this.logger.warning("lockfile handle does not exist, so lockfile could not be deleted")}catch(e){if("ENOENT"!==e.code)throw this.logger.error(`${a.pid} was not able to release lock. Ran into error: ${e.message}`),h.createCrossPlatformLockError(e.message);this.logger.info("Tried to unlock but lockfile does not exist")}}sleep(e){return new Promise(t=>{setTimeout(t,e)})}}class g{async verifyPersistence(){const e=await this.createForPersistenceValidation();try{await e.save("Dummy data to verify underlying persistence mechanism");const t=await e.load();if(!t)throw h.createCachePersistenceError("Persistence check failed. Data was written but it could not be read. Possible cause: on Linux, LibSecret is installed but D-Bus isn't running because it cannot be started over SSH.");if("Dummy data to verify underlying persistence mechanism"!==t)throw h.createCachePersistenceError("Persistence check failed. Data written Dummy data to verify underlying persistence mechanism is different from data read "+t);return await e.delete(),!0}catch(e){throw h.createCachePersistenceError("Verifing persistence failed with the error: "+e)}}}class d extends g{static async create(e,t){const r=new d;return r.filePath=e,r.logger=new n.Logger(t||d.createDefaultLoggerOptions()),await r.createCacheFile(),r}async save(e){try{await i.promises.writeFile(this.getFilePath(),e,"utf-8")}catch(e){throw h.createFileSystemError(e.code,e.message)}}async saveBuffer(e){try{await i.promises.writeFile(this.getFilePath(),e)}catch(e){throw h.createFileSystemError(e.code,e.message)}}async load(){try{return await i.promises.readFile(this.getFilePath(),"utf-8")}catch(e){throw h.createFileSystemError(e.code,e.message)}}async loadBuffer(){try{return await i.promises.readFile(this.getFilePath())}catch(e){throw h.createFileSystemError(e.code,e.message)}}async delete(){try{return await i.promises.unlink(this.getFilePath()),!0}catch(e){if("ENOENT"===e.code)return this.logger.warning("Cache file does not exist, so it could not be deleted"),!1;throw h.createFileSystemError(e.code,e.message)}}getFilePath(){return this.filePath}async reloadNecessary(e){return e<await this.timeLastModified()}getLogger(){return this.logger}createForPersistenceValidation(){const e=s.dirname(this.filePath)+"/test.cache";return d.create(e)}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.LogLevel.Info}}async timeLastModified(){try{return(await i.promises.stat(this.filePath)).mtime.getTime()}catch(e){if("ENOENT"===e.code)return this.logger.verbose("Cache file does not exist"),0;throw h.createFileSystemError(e.code,e.message)}}async createCacheFile(){await this.createFileDirectory();const e=await i.promises.open(this.filePath,"a");await e.close(),this.logger.info("File created at "+this.filePath)}async createFileDirectory(){try{await i.promises.mkdir(s.dirname(this.filePath),{recursive:!0})}catch(e){if("EEXIST"!==e.code)throw h.createFileSystemError(e.code,e.message);this.logger.info(`Directory ${s.dirname(this.filePath)} already exists`)}}}var m,P=require("../build/Release/dpapi.node");(m=exports.DataProtectionScope||(exports.DataProtectionScope={})).CurrentUser="CurrentUser",m.LocalMachine="LocalMachine";class f extends g{constructor(e,t){super(),this.scope=e,this.optionalEntropy=t?Buffer.from(t,"utf-8"):null}static async create(e,t,r,i){const a=new f(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{const t=P.protectData(Buffer.from(e,"utf-8"),this.optionalEntropy,this.scope.toString());await this.filePersistence.saveBuffer(t)}catch(e){throw h.createFilePersistenceWithDPAPIError(e.message)}}async load(){try{const e=await this.filePersistence.loadBuffer();return void 0!==e&&e&&0!==e.length?P.unprotectData(e,this.optionalEntropy,this.scope.toString()).toString():(this.filePersistence.getLogger().info("Encrypted contents loaded from file were null or empty"),null)}catch(e){throw h.createFilePersistenceWithDPAPIError(e.message)}}async delete(){return this.filePersistence.delete()}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return f.create(e,exports.DataProtectionScope.CurrentUser)}}class y extends g{constructor(e,t){super(),this.serviceName=e,this.accountName=t}static async create(e,t,r,i){const a=new y(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{await c.setPassword(this.serviceName,this.accountName,e)}catch(e){throw h.createKeychainPersistenceError(e.message)}await this.filePersistence.save("{}")}async load(){try{return await c.getPassword(this.serviceName,this.accountName)}catch(e){throw h.createKeychainPersistenceError(e.message)}}async delete(){try{return await this.filePersistence.delete(),await c.deletePassword(this.serviceName,this.accountName)}catch(e){throw h.createKeychainPersistenceError(e.message)}}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return y.create(e,"persistenceValidationServiceName","persistencValidationAccountName")}}class p extends g{constructor(e,t){super(),this.serviceName=e,this.accountName=t}static async create(e,t,r,i){const a=new p(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{await c.setPassword(this.serviceName,this.accountName,e)}catch(e){throw h.createLibSecretError(e.message)}await this.filePersistence.save("{}")}async load(){try{return await c.getPassword(this.serviceName,this.accountName)}catch(e){throw h.createLibSecretError(e.message)}}async delete(){try{return await this.filePersistence.delete(),await c.deletePassword(this.serviceName,this.accountName)}catch(e){throw h.createLibSecretError(e.message)}}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return p.create(e,"persistenceValidationServiceName","persistencValidationAccountName")}}class E{static get homeEnvVar(){return this.getEnvironmentVariable("HOME")}static get lognameEnvVar(){return this.getEnvironmentVariable("LOGNAME")}static get userEnvVar(){return this.getEnvironmentVariable("USER")}static get lnameEnvVar(){return this.getEnvironmentVariable("LNAME")}static get usernameEnvVar(){return this.getEnvironmentVariable("USERNAME")}static getEnvironmentVariable(e){return process.env[e]}static getEnvironmentPlatform(){return process.platform}static isWindowsPlatform(){return this.getEnvironmentPlatform()===t.WINDOWS}static isLinuxPlatform(){return this.getEnvironmentPlatform()===t.LINUX}static isMacPlatform(){return this.getEnvironmentPlatform()===t.MACOS}static isLinuxRootUser(){return 0===process.getuid()}static getUserRootDirectory(){return this.isWindowsPlatform?this.getUserHomeDirOnWindows():this.getUserHomeDirOnUnix()}static getUserHomeDirOnWindows(){return this.getEnvironmentVariable("LOCALAPPDATA")}static getUserHomeDirOnUnix(){if(this.isWindowsPlatform())throw h.createNotSupportedError("Getting the user home directory for unix is not supported in windows");if(!n.StringUtils.isEmpty(this.homeEnvVar))return this.homeEnvVar;let e=null;if(n.StringUtils.isEmpty(this.lognameEnvVar)?n.StringUtils.isEmpty(this.userEnvVar)?n.StringUtils.isEmpty(this.lnameEnvVar)?n.StringUtils.isEmpty(this.usernameEnvVar)||(e=this.usernameEnvVar):e=this.lnameEnvVar:e=this.userEnvVar:e=this.lognameEnvVar,this.isMacPlatform())return n.StringUtils.isEmpty(e)?null:o.join("/Users",e);if(this.isLinuxPlatform())return this.isLinuxRootUser()?"/root":n.StringUtils.isEmpty(e)?null:o.join("/home",e);throw h.createNotSupportedError("Getting the user home directory for unix is not supported in windows")}}class w extends n.AuthError{constructor(e,t,r,i){super(e,t),this.name="NativeAuthError",this.statusCode=r,this.tag=i,Object.setPrototypeOf(this,w.prototype)}}const v="@azure/msal-node-extensions";exports.Environment=E,exports.FilePersistence=d,exports.FilePersistenceWithDataProtection=f,exports.KeychainPersistence=y,exports.LibSecretPersistence=p,exports.NativeBrokerPlugin=class{constructor(){this.logger=new n.Logger({loggerCallback:()=>{},piiLoggingEnabled:!1},v,"1.0.0-alpha.32"),this.isBrokerAvailable=!l.msalNodeRuntime.StartupError}setLogger(e){this.logger=new n.Logger(e,v,"1.0.0-alpha.32");const t=(e,t,r)=>{switch(t){case l.LogLevel.Trace:case l.LogLevel.Debug:r?this.logger.tracePii(e):this.logger.trace(e);break;case l.LogLevel.Info:r?this.logger.infoPii(e):this.logger.info(e);break;case l.LogLevel.Warning:r?this.logger.warningPii(e):this.logger.warning(e);break;case l.LogLevel.Error:case l.LogLevel.Fatal:r?this.logger.errorPii(e):this.logger.error(e);break;default:r?this.logger.infoPii(e):this.logger.info(e)}};try{l.msalNodeRuntime.RegisterLogger(t,e.piiLoggingEnabled)}catch(e){const t=this.wrapError(e);if(t)throw t}}async getAccountById(e,t){this.logger.trace("NativeBrokerPlugin - getAccountById called",t);const r=await this.readAccountById(e,t);return this.generateAccountInfo(r.account)}async getAllAccounts(e,t){return this.logger.trace("NativeBrokerPlugin - getAllAccounts called",t),new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}const t=[];e.accounts.forEach(e=>{t.push(this.generateAccountInfo(e))}),r(t)};try{l.msalNodeRuntime.DiscoverAccountsAsync(e,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}async acquireTokenSilent(e){this.logger.trace("NativeBrokerPlugin - acquireTokenSilent called",e.correlationId);const t=this.generateRequestParameters(e),r=await this.getAccount(e);return new Promise((i,a)=>{const s=t=>{try{t.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void a(t)}const r=this.getAuthenticationResult(e,t);i(r)};try{r?l.msalNodeRuntime.AcquireTokenSilentlyAsync(t,e.correlationId,r,s):l.msalNodeRuntime.SignInSilentlyAsync(t,e.correlationId,s)}catch(e){const t=this.wrapError(e);t&&a(t)}})}async acquireTokenInteractive(e,t){this.logger.trace("NativeBrokerPlugin - acquireTokenInteractive called",e.correlationId);const r=this.generateRequestParameters(e),i=await this.getAccount(e),a=t||Buffer.from([0]);return new Promise((t,s)=>{const o=r=>{try{r.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void s(t)}const i=this.getAuthenticationResult(e,r);t(i)};try{switch(e.prompt){case n.PromptValue.LOGIN:case n.PromptValue.SELECT_ACCOUNT:case n.PromptValue.CREATE:this.logger.info("Calling native interop SignInInteractively API",e.correlationId),l.msalNodeRuntime.SignInInteractivelyAsync(a,r,e.correlationId,e.loginHint||n.Constants.EMPTY_STRING,o);break;case n.PromptValue.NONE:i?(this.logger.info("Calling native interop AcquireTokenSilently API",e.correlationId),l.msalNodeRuntime.AcquireTokenSilentlyAsync(r,e.correlationId,i,o)):(this.logger.info("Calling native interop SignInSilently API",e.correlationId),l.msalNodeRuntime.SignInSilentlyAsync(r,e.correlationId,o));break;default:i?(this.logger.info("Calling native interop AcquireTokenInteractively API",e.correlationId),l.msalNodeRuntime.AcquireTokenInteractivelyAsync(a,r,e.correlationId,i,o)):(this.logger.info("Calling native interop SignIn API",e.correlationId),l.msalNodeRuntime.SignInAsync(a,r,e.correlationId,e.loginHint||n.Constants.EMPTY_STRING,o))}}catch(e){const t=this.wrapError(e);t&&s(t)}})}async signOut(e){this.logger.trace("NativeBrokerPlugin - signOut called",e.correlationId);const t=await this.getAccount(e);if(!t)throw n.ClientAuthError.createNoAccountFoundError();return new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}r()};try{l.msalNodeRuntime.SignOutSilentlyAsync(e.clientId,e.correlationId,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}async getAccount(e){return e.accountId?(await this.readAccountById(e.accountId,e.correlationId)).account:null}async readAccountById(e,t){return this.logger.trace("NativeBrokerPlugin - readAccountById called",t),new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}r(e)};try{l.msalNodeRuntime.ReadAccountByIdAsync(e,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}generateRequestParameters(e){this.logger.trace("NativeBrokerPlugin - generateRequestParameters called",e.correlationId);const t=new l.msalNodeRuntime.AuthParameters;try{if(t.CreateAuthParameters(e.clientId,e.authority),t.SetRedirectUri(e.redirectUri),t.SetRequestedScopes(e.scopes.join(" ")),e.claims&&t.SetDecodedClaims(e.claims),e.authenticationScheme===n.AuthenticationScheme.POP){if(!e.resourceRequestMethod||!e.resourceRequestUri||!e.shrNonce)throw new Error("Authentication Scheme set to POP but one or more of the following parameters are missing: resourceRequestMethod, resourceRequestUri, shrNonce");const r=new URL(e.resourceRequestUri);t.SetPopParams(e.resourceRequestMethod,r.host,r.pathname,e.shrNonce)}e.extraParameters&&Object.keys(e.extraParameters).forEach(r=>{t.SetAdditionalParameter(r,e.extraParameters[r])})}catch(e){const t=this.wrapError(e);if(t)throw t}return t}getAuthenticationResult(e,t){let r,i;this.logger.trace("NativeBrokerPlugin - getAuthenticationResult called",e.correlationId);try{r=!!JSON.parse(t.telemetryData).is_cache}catch(t){this.logger.error("NativeBrokerPlugin: getAuthenticationResult - Error parsing telemetry data. Could not determine if response came from cache.",e.correlationId)}try{i=JSON.parse(t.idToken)}catch(e){throw new Error("Unable to parse idToken claims")}const a=this.generateAccountInfo(t.account,i);return{authority:e.authority,uniqueId:i.oid||i.sub||"",tenantId:i.tid||"",scopes:t.grantedScopes.split(" "),account:a,idToken:t.rawIdToken,idTokenClaims:i,accessToken:t.accessToken,fromCache:r,expiresOn:new Date(1e3*t.expiresOn),tokenType:t.isPopAuthorization?n.AuthenticationScheme.POP:n.AuthenticationScheme.BEARER,correlationId:e.correlationId,fromNativeBroker:!0}}generateAccountInfo(e,t){return this.logger.trace("NativeBrokerPlugin - generateAccountInfo called"),{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,name:e.displayName,idTokenClaims:t,nativeAccountId:e.accountId}}isMsalRuntimeError(e){return e.hasOwnProperty("errorCode")||e.hasOwnProperty("errorStatus")||e.hasOwnProperty("errorContext")||e.hasOwnProperty("errorTag")}wrapError(e){if(this.isMsalRuntimeError(e)){const{errorCode:t,errorStatus:i,errorContext:a,errorTag:s}=e;switch(i){case l.ErrorStatus.InteractionRequired:case l.ErrorStatus.AccountUnusable:return new n.InteractionRequiredAuthError(r.INTERATION_REQUIRED_ERROR_CODE,a);case l.ErrorStatus.NoNetwork:case l.ErrorStatus.NetworkTemporarilyUnavailable:return n.ClientAuthError.createNoNetworkConnectivityError();case l.ErrorStatus.ServerTemporarilyUnavailable:return new n.ServerError(r.SERVER_UNAVAILABLE,a);case l.ErrorStatus.UserCanceled:return n.ClientAuthError.createUserCanceledError();case l.ErrorStatus.AuthorityUntrusted:return n.ClientConfigurationError.createUntrustedAuthorityError();case l.ErrorStatus.UserSwitched:return null;case l.ErrorStatus.AccountNotFound:return n.ClientAuthError.createNoAccountFoundError();default:return new w(l.ErrorStatus[i],a,t,s)}}return e}},exports.PersistenceCachePlugin=class{constructor(e,t){this.persistence=e,this.logger=e.getLogger(),this.lockFilePath=this.persistence.getFilePath()+".lockfile",this.crossPlatformLock=new u(this.lockFilePath,this.logger,t),this.lastSync=0,this.currentCache=null}async beforeCacheAccess(e){if(this.logger.info("Executing before cache access"),await this.persistence.reloadNecessary(this.lastSync)||null===this.currentCache)try{this.logger.info("Reload necessary. Last sync time: "+this.lastSync),await this.crossPlatformLock.lock(),this.currentCache=await this.persistence.load(),this.lastSync=(new Date).getTime(),e.tokenCache.deserialize(this.currentCache),this.logger.info("Last sync time updated to: "+this.lastSync)}finally{e.cacheHasChanged?this.logger.info(`Pid ${a.pid} beforeCacheAccess did not release lock`):(await this.crossPlatformLock.unlock(),this.logger.info(`Pid ${a.pid} released lock`))}else e.cacheHasChanged&&(this.logger.verbose("Cache context has changed"),await this.crossPlatformLock.lock())}async afterCacheAccess(e){this.logger.info("Executing after cache access");try{e.cacheHasChanged?(this.logger.info("Msal in-memory cache has changed. Writing changes to persistence"),this.currentCache=e.tokenCache.serialize(),await this.persistence.save(this.currentCache)):this.logger.info("Msal in-memory cache has not changed. Did not write to persistence")}finally{await this.crossPlatformLock.unlock(),this.logger.info(`Pid ${a.pid} afterCacheAccess released lock`)}}},exports.PersistenceCreator=class{static async createPersistence(e){let t;if(E.isWindowsPlatform()){if(!e.cachePath||!e.dataProtectionScope)throw h.createPersistenceNotValidatedError("Cache path and/or data protection scope not provided for the FilePersistenceWithDataProtection cache plugin");t=await f.create(e.cachePath,exports.DataProtectionScope.CurrentUser,void 0,e.loggerOptions)}else if(E.isMacPlatform()){if(!e.cachePath||!e.serviceName||!e.accountName)throw h.createPersistenceNotValidatedError("Cache path, service name and/or account name not provided for the KeychainPersistence cache plugin");t=await y.create(e.cachePath,e.serviceName,e.accountName,e.loggerOptions)}else{if(!E.isLinuxPlatform())throw h.createNotSupportedError("The current environment is not supported by msal-node-extensions yet.");if(!e.cachePath||!e.serviceName||!e.accountName)throw h.createPersistenceNotValidatedError("Cache path, service name and/or account name not provided for the LibSecretPersistence cache plugin");t=await p.create(e.cachePath,e.serviceName,e.accountName,e.loggerOptions)}if(!await t.verifyPersistence().catch(()=>!1)){if(E.isLinuxPlatform()&&e.usePlaintextFileOnLinux){if(!e.cachePath)throw h.createPersistenceNotValidatedError("Cache path not provided for the FilePersistence cache plugin");if(t=await d.create(e.cachePath,e.loggerOptions),await t.verifyPersistence())return t}throw h.createPersistenceNotVerifiedError("Persistence could not be verified")}return t}};
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e,t,r,i=require("fs"),a=require("process"),s=require("path"),o=(e=s)&&"object"==typeof e&&"default"in e?e.default:e,n=require("@azure/msal-common"),c=require("keytar"),l=require("@azure/msal-node-runtime");!function(e){e.WINDOWS="win32",e.LINUX="linux",e.MACOS="darwin"}(t||(t={})),function(e){e.INTERATION_REQUIRED_ERROR_CODE="interaction_required",e.SERVER_UNAVAILABLE="server_unavailable"}(r||(r={}));class h extends Error{constructor(e,t){super(t?`${e}: ${t}`:e),Object.setPrototypeOf(this,h.prototype),this.errorCode=e,this.errorMessage=t,this.name="PersistenceError"}static createFileSystemError(e,t){return new h(e,t)}static createLibSecretError(e){return new h("GnomeKeyringError",e)}static createKeychainPersistenceError(e){return new h("KeychainError",e)}static createFilePersistenceWithDPAPIError(e){return new h("DPAPIEncryptedFileError",e)}static createCrossPlatformLockError(e){return new h("CrossPlatformLockError",e)}static createCachePersistenceError(e){return new h("CachePersistenceError",e)}static createNotSupportedError(e){return new h("NotSupportedError",e)}static createPersistenceNotVerifiedError(e){return new h("PersistenceNotVerifiedError",e)}static createPersistenceNotValidatedError(e){return new h("PersistenceNotValidatedError",e)}}class u{constructor(e,t,r){this.lockFilePath=e,this.retryNumber=r?r.retryNumber:500,this.retryDelay=r?r.retryDelay:100,this.logger=t}async lock(){for(let e=0;e<this.retryNumber;e++)try{return this.logger.info(`Pid ${a.pid} trying to acquire lock`),this.lockFileHandle=await i.promises.open(this.lockFilePath,"wx+"),this.logger.info(`Pid ${a.pid} acquired lock`),void await this.lockFileHandle.write(a.pid.toString())}catch(e){if("EEXIST"!==e.code&&"EPERM"!==e.code)throw this.logger.error(`${a.pid} was not able to acquire lock. Ran into error: ${e.message}`),h.createCrossPlatformLockError(e.message);this.logger.info(e),await this.sleep(this.retryDelay)}throw this.logger.error(a.pid+" was not able to acquire lock. Exceeded amount of retries set in the options"),h.createCrossPlatformLockError("Not able to acquire lock. Exceeded amount of retries set in options")}async unlock(){try{this.lockFileHandle?(await i.promises.unlink(this.lockFilePath),await this.lockFileHandle.close(),this.logger.info("lockfile deleted")):this.logger.warning("lockfile handle does not exist, so lockfile could not be deleted")}catch(e){if("ENOENT"!==e.code)throw this.logger.error(`${a.pid} was not able to release lock. Ran into error: ${e.message}`),h.createCrossPlatformLockError(e.message);this.logger.info("Tried to unlock but lockfile does not exist")}}sleep(e){return new Promise(t=>{setTimeout(t,e)})}}class g{async verifyPersistence(){const e=await this.createForPersistenceValidation();try{await e.save("Dummy data to verify underlying persistence mechanism");const t=await e.load();if(!t)throw h.createCachePersistenceError("Persistence check failed. Data was written but it could not be read. Possible cause: on Linux, LibSecret is installed but D-Bus isn't running because it cannot be started over SSH.");if("Dummy data to verify underlying persistence mechanism"!==t)throw h.createCachePersistenceError("Persistence check failed. Data written Dummy data to verify underlying persistence mechanism is different from data read "+t);return await e.delete(),!0}catch(e){throw h.createCachePersistenceError("Verifing persistence failed with the error: "+e)}}}class d extends g{static async create(e,t){const r=new d;return r.filePath=e,r.logger=new n.Logger(t||d.createDefaultLoggerOptions()),await r.createCacheFile(),r}async save(e){try{await i.promises.writeFile(this.getFilePath(),e,"utf-8")}catch(e){throw h.createFileSystemError(e.code,e.message)}}async saveBuffer(e){try{await i.promises.writeFile(this.getFilePath(),e)}catch(e){throw h.createFileSystemError(e.code,e.message)}}async load(){try{return await i.promises.readFile(this.getFilePath(),"utf-8")}catch(e){throw h.createFileSystemError(e.code,e.message)}}async loadBuffer(){try{return await i.promises.readFile(this.getFilePath())}catch(e){throw h.createFileSystemError(e.code,e.message)}}async delete(){try{return await i.promises.unlink(this.getFilePath()),!0}catch(e){if("ENOENT"===e.code)return this.logger.warning("Cache file does not exist, so it could not be deleted"),!1;throw h.createFileSystemError(e.code,e.message)}}getFilePath(){return this.filePath}async reloadNecessary(e){return e<await this.timeLastModified()}getLogger(){return this.logger}createForPersistenceValidation(){const e=s.dirname(this.filePath)+"/test.cache";return d.create(e)}static createDefaultLoggerOptions(){return{loggerCallback:()=>{},piiLoggingEnabled:!1,logLevel:n.LogLevel.Info}}async timeLastModified(){try{return(await i.promises.stat(this.filePath)).mtime.getTime()}catch(e){if("ENOENT"===e.code)return this.logger.verbose("Cache file does not exist"),0;throw h.createFileSystemError(e.code,e.message)}}async createCacheFile(){await this.createFileDirectory();const e=await i.promises.open(this.filePath,"a");await e.close(),this.logger.info("File created at "+this.filePath)}async createFileDirectory(){try{await i.promises.mkdir(s.dirname(this.filePath),{recursive:!0})}catch(e){if("EEXIST"!==e.code)throw h.createFileSystemError(e.code,e.message);this.logger.info(`Directory ${s.dirname(this.filePath)} already exists`)}}}var m,P=require("../build/Release/dpapi.node");(m=exports.DataProtectionScope||(exports.DataProtectionScope={})).CurrentUser="CurrentUser",m.LocalMachine="LocalMachine";class f extends g{constructor(e,t){super(),this.scope=e,this.optionalEntropy=t?Buffer.from(t,"utf-8"):null}static async create(e,t,r,i){const a=new f(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{const t=P.protectData(Buffer.from(e,"utf-8"),this.optionalEntropy,this.scope.toString());await this.filePersistence.saveBuffer(t)}catch(e){throw h.createFilePersistenceWithDPAPIError(e.message)}}async load(){try{const e=await this.filePersistence.loadBuffer();return void 0!==e&&e&&0!==e.length?P.unprotectData(e,this.optionalEntropy,this.scope.toString()).toString():(this.filePersistence.getLogger().info("Encrypted contents loaded from file were null or empty"),null)}catch(e){throw h.createFilePersistenceWithDPAPIError(e.message)}}async delete(){return this.filePersistence.delete()}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return f.create(e,exports.DataProtectionScope.CurrentUser)}}class y extends g{constructor(e,t){super(),this.serviceName=e,this.accountName=t}static async create(e,t,r,i){const a=new y(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{await c.setPassword(this.serviceName,this.accountName,e)}catch(e){throw h.createKeychainPersistenceError(e.message)}await this.filePersistence.save("{}")}async load(){try{return await c.getPassword(this.serviceName,this.accountName)}catch(e){throw h.createKeychainPersistenceError(e.message)}}async delete(){try{return await this.filePersistence.delete(),await c.deletePassword(this.serviceName,this.accountName)}catch(e){throw h.createKeychainPersistenceError(e.message)}}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return y.create(e,"persistenceValidationServiceName","persistencValidationAccountName")}}class p extends g{constructor(e,t){super(),this.serviceName=e,this.accountName=t}static async create(e,t,r,i){const a=new p(t,r);return a.filePersistence=await d.create(e,i),a}async save(e){try{await c.setPassword(this.serviceName,this.accountName,e)}catch(e){throw h.createLibSecretError(e.message)}await this.filePersistence.save("{}")}async load(){try{return await c.getPassword(this.serviceName,this.accountName)}catch(e){throw h.createLibSecretError(e.message)}}async delete(){try{return await this.filePersistence.delete(),await c.deletePassword(this.serviceName,this.accountName)}catch(e){throw h.createLibSecretError(e.message)}}async reloadNecessary(e){return this.filePersistence.reloadNecessary(e)}getFilePath(){return this.filePersistence.getFilePath()}getLogger(){return this.filePersistence.getLogger()}createForPersistenceValidation(){const e=s.dirname(this.filePersistence.getFilePath())+"/test.cache";return p.create(e,"persistenceValidationServiceName","persistencValidationAccountName")}}class E{static get homeEnvVar(){return this.getEnvironmentVariable("HOME")}static get lognameEnvVar(){return this.getEnvironmentVariable("LOGNAME")}static get userEnvVar(){return this.getEnvironmentVariable("USER")}static get lnameEnvVar(){return this.getEnvironmentVariable("LNAME")}static get usernameEnvVar(){return this.getEnvironmentVariable("USERNAME")}static getEnvironmentVariable(e){return process.env[e]}static getEnvironmentPlatform(){return process.platform}static isWindowsPlatform(){return this.getEnvironmentPlatform()===t.WINDOWS}static isLinuxPlatform(){return this.getEnvironmentPlatform()===t.LINUX}static isMacPlatform(){return this.getEnvironmentPlatform()===t.MACOS}static isLinuxRootUser(){return 0===process.getuid()}static getUserRootDirectory(){return this.isWindowsPlatform?this.getUserHomeDirOnWindows():this.getUserHomeDirOnUnix()}static getUserHomeDirOnWindows(){return this.getEnvironmentVariable("LOCALAPPDATA")}static getUserHomeDirOnUnix(){if(this.isWindowsPlatform())throw h.createNotSupportedError("Getting the user home directory for unix is not supported in windows");if(!n.StringUtils.isEmpty(this.homeEnvVar))return this.homeEnvVar;let e=null;if(n.StringUtils.isEmpty(this.lognameEnvVar)?n.StringUtils.isEmpty(this.userEnvVar)?n.StringUtils.isEmpty(this.lnameEnvVar)?n.StringUtils.isEmpty(this.usernameEnvVar)||(e=this.usernameEnvVar):e=this.lnameEnvVar:e=this.userEnvVar:e=this.lognameEnvVar,this.isMacPlatform())return n.StringUtils.isEmpty(e)?null:o.join("/Users",e);if(this.isLinuxPlatform())return this.isLinuxRootUser()?"/root":n.StringUtils.isEmpty(e)?null:o.join("/home",e);throw h.createNotSupportedError("Getting the user home directory for unix is not supported in windows")}}class w extends n.AuthError{constructor(e,t,r,i){super(e,t),this.name="NativeAuthError",this.statusCode=r,this.tag=i,Object.setPrototypeOf(this,w.prototype)}}const v="@azure/msal-node-extensions";exports.Environment=E,exports.FilePersistence=d,exports.FilePersistenceWithDataProtection=f,exports.KeychainPersistence=y,exports.LibSecretPersistence=p,exports.NativeBrokerPlugin=class{constructor(){this.logger=new n.Logger({loggerCallback:()=>{},piiLoggingEnabled:!1},v,"1.0.0-alpha.34"),this.isBrokerAvailable=!l.msalNodeRuntime.StartupError}setLogger(e){this.logger=new n.Logger(e,v,"1.0.0-alpha.34");const t=(e,t,r)=>{switch(t){case l.LogLevel.Trace:case l.LogLevel.Debug:r?this.logger.tracePii(e):this.logger.trace(e);break;case l.LogLevel.Info:r?this.logger.infoPii(e):this.logger.info(e);break;case l.LogLevel.Warning:r?this.logger.warningPii(e):this.logger.warning(e);break;case l.LogLevel.Error:case l.LogLevel.Fatal:r?this.logger.errorPii(e):this.logger.error(e);break;default:r?this.logger.infoPii(e):this.logger.info(e)}};try{l.msalNodeRuntime.RegisterLogger(t,e.piiLoggingEnabled)}catch(e){const t=this.wrapError(e);if(t)throw t}}async getAccountById(e,t){this.logger.trace("NativeBrokerPlugin - getAccountById called",t);const r=await this.readAccountById(e,t);return this.generateAccountInfo(r.account)}async getAllAccounts(e,t){return this.logger.trace("NativeBrokerPlugin - getAllAccounts called",t),new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}const t=[];e.accounts.forEach(e=>{t.push(this.generateAccountInfo(e))}),r(t)};try{l.msalNodeRuntime.DiscoverAccountsAsync(e,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}async acquireTokenSilent(e){this.logger.trace("NativeBrokerPlugin - acquireTokenSilent called",e.correlationId);const t=this.generateRequestParameters(e),r=await this.getAccount(e);return new Promise((i,a)=>{const s=t=>{try{t.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void a(t)}const r=this.getAuthenticationResult(e,t);i(r)};try{r?l.msalNodeRuntime.AcquireTokenSilentlyAsync(t,e.correlationId,r,s):l.msalNodeRuntime.SignInSilentlyAsync(t,e.correlationId,s)}catch(e){const t=this.wrapError(e);t&&a(t)}})}async acquireTokenInteractive(e,t){this.logger.trace("NativeBrokerPlugin - acquireTokenInteractive called",e.correlationId);const r=this.generateRequestParameters(e),i=await this.getAccount(e),a=t||Buffer.from([0]);return new Promise((t,s)=>{const o=r=>{try{r.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void s(t)}const i=this.getAuthenticationResult(e,r);t(i)};try{switch(e.prompt){case n.PromptValue.LOGIN:case n.PromptValue.SELECT_ACCOUNT:case n.PromptValue.CREATE:this.logger.info("Calling native interop SignInInteractively API",e.correlationId),l.msalNodeRuntime.SignInInteractivelyAsync(a,r,e.correlationId,e.loginHint||n.Constants.EMPTY_STRING,o);break;case n.PromptValue.NONE:i?(this.logger.info("Calling native interop AcquireTokenSilently API",e.correlationId),l.msalNodeRuntime.AcquireTokenSilentlyAsync(r,e.correlationId,i,o)):(this.logger.info("Calling native interop SignInSilently API",e.correlationId),l.msalNodeRuntime.SignInSilentlyAsync(r,e.correlationId,o));break;default:i?(this.logger.info("Calling native interop AcquireTokenInteractively API",e.correlationId),l.msalNodeRuntime.AcquireTokenInteractivelyAsync(a,r,e.correlationId,i,o)):(this.logger.info("Calling native interop SignIn API",e.correlationId),l.msalNodeRuntime.SignInAsync(a,r,e.correlationId,e.loginHint||n.Constants.EMPTY_STRING,o))}}catch(e){const t=this.wrapError(e);t&&s(t)}})}async signOut(e){this.logger.trace("NativeBrokerPlugin - signOut called",e.correlationId);const t=await this.getAccount(e);if(!t)throw n.ClientAuthError.createNoAccountFoundError();return new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}r()};try{l.msalNodeRuntime.SignOutSilentlyAsync(e.clientId,e.correlationId,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}async getAccount(e){return e.accountId?(await this.readAccountById(e.accountId,e.correlationId)).account:null}async readAccountById(e,t){return this.logger.trace("NativeBrokerPlugin - readAccountById called",t),new Promise((r,i)=>{const a=e=>{try{e.CheckError()}catch(e){const t=this.wrapError(e);if(t)return void i(t)}r(e)};try{l.msalNodeRuntime.ReadAccountByIdAsync(e,t,a)}catch(e){const t=this.wrapError(e);t&&i(t)}})}generateRequestParameters(e){this.logger.trace("NativeBrokerPlugin - generateRequestParameters called",e.correlationId);const t=new l.msalNodeRuntime.AuthParameters;try{if(t.CreateAuthParameters(e.clientId,e.authority),t.SetRedirectUri(e.redirectUri),t.SetRequestedScopes(e.scopes.join(" ")),e.claims&&t.SetDecodedClaims(e.claims),e.authenticationScheme===n.AuthenticationScheme.POP){if(!e.resourceRequestMethod||!e.resourceRequestUri||!e.shrNonce)throw new Error("Authentication Scheme set to POP but one or more of the following parameters are missing: resourceRequestMethod, resourceRequestUri, shrNonce");const r=new URL(e.resourceRequestUri);t.SetPopParams(e.resourceRequestMethod,r.host,r.pathname,e.shrNonce)}e.extraParameters&&Object.keys(e.extraParameters).forEach(r=>{t.SetAdditionalParameter(r,e.extraParameters[r])})}catch(e){const t=this.wrapError(e);if(t)throw t}return t}getAuthenticationResult(e,t){this.logger.trace("NativeBrokerPlugin - getAuthenticationResult called",e.correlationId);let r,i=!1;try{i=!!JSON.parse(t.telemetryData).is_cache}catch(t){this.logger.error("NativeBrokerPlugin: getAuthenticationResult - Error parsing telemetry data. Could not determine if response came from cache.",e.correlationId)}try{r=JSON.parse(t.idToken)}catch(e){throw new Error("Unable to parse idToken claims")}const a=this.generateAccountInfo(t.account,r);return{authority:e.authority,uniqueId:r.oid||r.sub||"",tenantId:r.tid||"",scopes:t.grantedScopes.split(" "),account:a,idToken:t.rawIdToken,idTokenClaims:r,accessToken:t.accessToken,fromCache:i,expiresOn:new Date(t.expiresOn),tokenType:t.isPopAuthorization?n.AuthenticationScheme.POP:n.AuthenticationScheme.BEARER,correlationId:e.correlationId,fromNativeBroker:!0}}generateAccountInfo(e,t){return this.logger.trace("NativeBrokerPlugin - generateAccountInfo called"),{homeAccountId:e.homeAccountId,environment:e.environment,tenantId:e.realm,username:e.username,localAccountId:e.localAccountId,name:e.displayName,idTokenClaims:t,nativeAccountId:e.accountId}}isMsalRuntimeError(e){return e.hasOwnProperty("errorCode")||e.hasOwnProperty("errorStatus")||e.hasOwnProperty("errorContext")||e.hasOwnProperty("errorTag")}wrapError(e){if(this.isMsalRuntimeError(e)){const{errorCode:t,errorStatus:i,errorContext:a,errorTag:s}=e;switch(i){case l.ErrorStatus.InteractionRequired:case l.ErrorStatus.AccountUnusable:return new n.InteractionRequiredAuthError(r.INTERATION_REQUIRED_ERROR_CODE,a);case l.ErrorStatus.NoNetwork:case l.ErrorStatus.NetworkTemporarilyUnavailable:return n.ClientAuthError.createNoNetworkConnectivityError();case l.ErrorStatus.ServerTemporarilyUnavailable:return new n.ServerError(r.SERVER_UNAVAILABLE,a);case l.ErrorStatus.UserCanceled:return n.ClientAuthError.createUserCanceledError();case l.ErrorStatus.AuthorityUntrusted:return n.ClientConfigurationError.createUntrustedAuthorityError();case l.ErrorStatus.UserSwitched:return null;case l.ErrorStatus.AccountNotFound:return n.ClientAuthError.createNoAccountFoundError();default:return new w(l.ErrorStatus[i],a,t,s)}}return e}},exports.PersistenceCachePlugin=class{constructor(e,t){this.persistence=e,this.logger=e.getLogger(),this.lockFilePath=this.persistence.getFilePath()+".lockfile",this.crossPlatformLock=new u(this.lockFilePath,this.logger,t),this.lastSync=0,this.currentCache=null}async beforeCacheAccess(e){if(this.logger.info("Executing before cache access"),await this.persistence.reloadNecessary(this.lastSync)||null===this.currentCache)try{this.logger.info("Reload necessary. Last sync time: "+this.lastSync),await this.crossPlatformLock.lock(),this.currentCache=await this.persistence.load(),this.lastSync=(new Date).getTime(),e.tokenCache.deserialize(this.currentCache),this.logger.info("Last sync time updated to: "+this.lastSync)}finally{e.cacheHasChanged?this.logger.info(`Pid ${a.pid} beforeCacheAccess did not release lock`):(await this.crossPlatformLock.unlock(),this.logger.info(`Pid ${a.pid} released lock`))}else e.cacheHasChanged&&(this.logger.verbose("Cache context has changed"),await this.crossPlatformLock.lock())}async afterCacheAccess(e){this.logger.info("Executing after cache access");try{e.cacheHasChanged?(this.logger.info("Msal in-memory cache has changed. Writing changes to persistence"),this.currentCache=e.tokenCache.serialize(),await this.persistence.save(this.currentCache)):this.logger.info("Msal in-memory cache has not changed. Did not write to persistence")}finally{await this.crossPlatformLock.unlock(),this.logger.info(`Pid ${a.pid} afterCacheAccess released lock`)}}},exports.PersistenceCreator=class{static async createPersistence(e){let t;if(E.isWindowsPlatform()){if(!e.cachePath||!e.dataProtectionScope)throw h.createPersistenceNotValidatedError("Cache path and/or data protection scope not provided for the FilePersistenceWithDataProtection cache plugin");t=await f.create(e.cachePath,exports.DataProtectionScope.CurrentUser,void 0,e.loggerOptions)}else if(E.isMacPlatform()){if(!e.cachePath||!e.serviceName||!e.accountName)throw h.createPersistenceNotValidatedError("Cache path, service name and/or account name not provided for the KeychainPersistence cache plugin");t=await y.create(e.cachePath,e.serviceName,e.accountName,e.loggerOptions)}else{if(!E.isLinuxPlatform())throw h.createNotSupportedError("The current environment is not supported by msal-node-extensions yet.");if(!e.cachePath||!e.serviceName||!e.accountName)throw h.createPersistenceNotValidatedError("Cache path, service name and/or account name not provided for the LibSecretPersistence cache plugin");t=await p.create(e.cachePath,e.serviceName,e.accountName,e.loggerOptions)}if(!await t.verifyPersistence().catch(()=>!1)){if(E.isLinuxPlatform()&&e.usePlaintextFileOnLinux){if(!e.cachePath)throw h.createPersistenceNotValidatedError("Cache path not provided for the FilePersistence cache plugin");if(t=await d.create(e.cachePath,e.loggerOptions),await t.verifyPersistence())return t}throw h.createPersistenceNotVerifiedError("Persistence could not be verified")}return t}};
//# sourceMappingURL=msal-node-extensions.cjs.production.min.js.map

@@ -796,3 +796,3 @@ import { promises } from 'fs';

const name = "@azure/msal-node-extensions";
const version = "1.0.0-alpha.32";
const version = "1.0.0-alpha.34";

@@ -1093,3 +1093,3 @@ /*

this.logger.trace("NativeBrokerPlugin - getAuthenticationResult called", request.correlationId);
let fromCache;
let fromCache = false;
try {

@@ -1118,3 +1118,3 @@ const telemetryJSON = JSON.parse(authResult.telemetryData);

fromCache: fromCache,
expiresOn: new Date(authResult.expiresOn * 1000),
expiresOn: new Date(authResult.expiresOn),
tokenType: authResult.isPopAuthorization ? AuthenticationScheme.POP : AuthenticationScheme.BEARER,

@@ -1121,0 +1121,0 @@ correlationId: request.correlationId,

export declare const name = "@azure/msal-node-extensions";
export declare const version = "1.0.0-alpha.32";
export declare const version = "1.0.0-alpha.34";
{
"name": "@azure/msal-node-extensions",
"version": "1.0.0-alpha.32",
"version": "1.0.0-alpha.34",
"repository": {

@@ -33,4 +33,4 @@ "type": "git",

"build:all": "npm run build:common && npm run build",
"test": "tsdx test",
"test:coverage": "tsdx test --coverage",
"test": "jest",
"test:coverage": "jest --coverage",
"lint": "cd ../../ && npm run lint:node:extensions",

@@ -55,3 +55,3 @@ "lint:fix": "npm run lint -- -- --fix",

"dependencies": {
"@azure/msal-common": "^12.0.0",
"@azure/msal-common": "13.0.0",
"@azure/msal-node-runtime": "^0.13.6-alpha.0",

@@ -62,8 +62,11 @@ "keytar": "^7.8.0",

"devDependencies": {
"@types/jest": "^29.5.0",
"@types/node": "^18.8.3",
"husky": "^4.2.5",
"jest": "^29.5.0",
"ts-jest": "^29.0.5",
"tsdx": "^0.14.1",
"tslib": "^2.0.0",
"typescript": "^3.9.3"
"typescript": "~4.8.4"
}
}

@@ -0,0 +0,0 @@ # Microsoft Authentication Extensions for Node

@@ -332,3 +332,3 @@ /*

let fromCache: boolean;
let fromCache: boolean = false;
try {

@@ -360,3 +360,3 @@ const telemetryJSON = JSON.parse(authResult.telemetryData);

fromCache: fromCache,
expiresOn: new Date(authResult.expiresOn * 1000),
expiresOn: new Date(authResult.expiresOn),
tokenType: authResult.isPopAuthorization ? AuthenticationScheme.POP : AuthenticationScheme.BEARER,

@@ -363,0 +363,0 @@ correlationId: request.correlationId,

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

/* eslint-disable header/header */
export const name = "@azure/msal-node-extensions";
export const version = "1.0.0-alpha.32";
export const version = "1.0.0-alpha.34";

@@ -0,0 +0,0 @@ /*

@@ -0,0 +0,0 @@ /*

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc