Socket
Socket
Sign inDemoInstall

@azure/msal-common

Package Overview
Dependencies
Maintainers
3
Versions
121
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@azure/msal-common - npm Package Compare versions

Comparing version 14.7.2-alpha.0 to 14.8.0

5

dist/authority/Authority.d.ts

@@ -30,5 +30,4 @@ import { AuthorityType } from "./AuthorityType";

protected correlationId: string;
private managedIdentity;
private static reservedTenantDomains;
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, correlationId: string, performanceClient?: IPerformanceClient, managedIdentity?: boolean);
constructor(authority: string, networkInterface: INetworkModule, cacheManager: ICacheManager, authorityOptions: AuthorityOptions, logger: Logger, correlationId: string, performanceClient?: IPerformanceClient);
/**

@@ -111,3 +110,3 @@ * Get {@link AuthorityType}

/**
* Boolean that returns whether or not tenant discovery has been completed.
* Boolean that returns whethr or not tenant discovery has been completed.
*/

@@ -114,0 +113,0 @@ discoveryComplete(): boolean;

2

dist/index.d.ts

@@ -83,3 +83,3 @@ /**

export { ClientConfigurationError, ClientConfigurationErrorMessage, ClientConfigurationErrorCodes, createClientConfigurationError, } from "./error/ClientConfigurationError";
export { Constants, OIDC_DEFAULT_SCOPES, PromptValue, PersistentCacheKeys, ServerResponseType, ResponseMode, CacheOutcome, CredentialType, CacheType, CacheAccountType, AuthenticationScheme, CodeChallengeMethodValues, PasswordGrantConstants, ThrottlingConstants, ClaimsRequestKeys, HeaderNames, Errors, THE_FAMILY_ID, ONE_DAY_IN_MS, GrantType, AADAuthorityConstants, HttpStatus, DEFAULT_TOKEN_RENEWAL_OFFSET_SEC, JsonWebTokenTypes, } from "./utils/Constants";
export { Constants, OIDC_DEFAULT_SCOPES, PromptValue, PersistentCacheKeys, ServerResponseType, ResponseMode, CacheOutcome, CredentialType, CacheType, CacheAccountType, AuthenticationScheme, CodeChallengeMethodValues, PasswordGrantConstants, ThrottlingConstants, ClaimsRequestKeys, HeaderNames, Errors, THE_FAMILY_ID, ONE_DAY_IN_MS, GrantType, AADAuthorityConstants, HttpStatus, JsonWebTokenTypes, } from "./utils/Constants";
export * as AADServerParamKeys from "./constants/AADServerParamKeys";

@@ -86,0 +86,0 @@ export { StringUtils } from "./utils/StringUtils";

export declare const name = "@azure/msal-common";
export declare const version = "14.7.2-alpha.0";
export declare const version = "14.8.0";
//# sourceMappingURL=packageMetadata.d.ts.map

@@ -5,3 +5,3 @@ import { PerformanceEvent } from "./PerformanceEvent";

export type InProgressPerformanceEvent = {
end: (event?: Partial<PerformanceEvent>) => PerformanceEvent | null;
end: (event?: Partial<PerformanceEvent>, error?: unknown) => PerformanceEvent | null;
discard: () => void;

@@ -8,0 +8,0 @@ add: (fields: {

import { ApplicationTelemetry } from "../../config/ClientConfiguration";
import { Logger } from "../../logger/Logger";
import { InProgressPerformanceEvent, IPerformanceClient, PerformanceCallbackFunction, QueueMeasurement } from "./IPerformanceClient";
import { PerformanceEvent, PerformanceEvents } from "./PerformanceEvent";
import { PerformanceEvent, PerformanceEventContext, PerformanceEvents, PerformanceEventStackedContext } from "./PerformanceEvent";
import { IPerformanceMeasurement } from "./IPerformanceMeasurement";

@@ -10,2 +10,40 @@ export interface PreQueueEvent {

}
/**
* Starts context by adding payload to the stack
* @param event {PerformanceEvent}
* @param abbreviations {Map<string, string>} event name abbreviations
* @param stack {?PerformanceEventStackedContext[]} stack
*/
export declare function startContext(event: PerformanceEvent, abbreviations: Map<string, string>, stack?: PerformanceEventStackedContext[]): void;
/**
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
*
* @param event {PerformanceEvent}
* @param abbreviations {Map<string, string>} event name abbreviations
* @param stack {?PerformanceEventStackedContext[]} stack
* @param error {?unknown} error
*/
export declare function endContext(event: PerformanceEvent, abbreviations: Map<string, string>, stack?: PerformanceEventStackedContext[], error?: unknown): PerformanceEventContext | undefined;
/**
* Adds error name and stack trace to the telemetry event
* @param error {Error}
* @param logger {Logger}
* @param event {PerformanceEvent}
* @param stackMaxSize {number} max error stack size to capture
*/
export declare function addError(error: unknown, logger: Logger, event: PerformanceEvent, stackMaxSize?: number): void;
/**
* Compacts error stack into array by fetching N first entries
* @param stack {string} error stack
* @param stackMaxSize {number} max error stack size to capture
* @returns {string[]}
*/
export declare function compactStack(stack: string, stackMaxSize: number): string[];
/**
* Compacts error stack line by shortening file path
* Example: https://localhost/msal-common/src/authority/Authority.js:100:1 -> Authority.js:100:1
* @param line {string} stack line
* @returns {string}
*/
export declare function compactStackLine(line: string): string;
export declare abstract class PerformanceClient implements IPerformanceClient {

@@ -41,2 +79,14 @@ protected authority: string;

/**
* Map of stacked events by correlation id.
*
* @protected
*/
protected eventStack: Map<string, PerformanceEventStackedContext[]>;
/**
* Event name abbreviations
*
* @protected
*/
protected abbreviations: Map<string, string>;
/**
* Creates an instance of PerformanceClient,

@@ -53,4 +103,5 @@ * an abstract class containing core performance telemetry logic.

* @param {Set<String>} intFields integer fields to be truncated
* @param {Map<string, string>} abbreviations event name abbreviations
*/
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, intFields?: Set<string>);
constructor(clientId: string, authority: string, logger: Logger, libraryName: string, libraryVersion: string, applicationTelemetry: ApplicationTelemetry, intFields?: Set<string>, abbreviations?: Map<string, string>);
/**

@@ -125,6 +176,6 @@ * Generates and returns a unique id, typically a guid.

* @param {PerformanceEvent} event
* @param {IPerformanceMeasurement} measurement
* @param {unknown} error
* @returns {(PerformanceEvent | null)}
*/
endMeasurement(event: PerformanceEvent): PerformanceEvent | null;
endMeasurement(event: PerformanceEvent, error?: unknown): PerformanceEvent | null;
/**

@@ -193,3 +244,2 @@ * Saves extra information to be emitted when the measurements are flushed

* @param {PerformanceEvent} event performance event to update.
* @param {Set<string>} intFields integral fields.
*/

@@ -196,0 +246,0 @@ private truncateIntegralFields;

@@ -232,2 +232,3 @@ /**

export type PerformanceEvents = (typeof PerformanceEvents)[keyof typeof PerformanceEvents];
export declare const PerformanceEventAbbreviations: ReadonlyMap<string, string>;
/**

@@ -470,4 +471,17 @@ * State of the performance event.

multiMatchedRT?: number;
errorName?: string;
errorStack?: string[];
context?: object;
};
export type PerformanceEventContext = {
dur?: number;
err?: string;
subErr?: string;
fail?: number;
};
export type PerformanceEventStackedContext = PerformanceEventContext & {
name?: string;
childErr?: string;
};
export declare const IntFields: ReadonlySet<string>;
//# sourceMappingURL=PerformanceEvent.d.ts.map

@@ -45,16 +45,7 @@ export declare const Constants: {

readonly SUCCESS_RANGE_START: 200;
readonly SUCCESS: 200;
readonly SUCCESS_RANGE_END: 299;
readonly REDIRECT: 302;
readonly CLIENT_ERROR_RANGE_START: 400;
readonly BAD_REQUEST: 400;
readonly UNAUTHORIZED: 401;
readonly NOT_FOUND: 404;
readonly REQUEST_TIMEOUT: 408;
readonly TOO_MANY_REQUESTS: 429;
readonly CLIENT_ERROR_RANGE_END: 499;
readonly SERVER_ERROR_RANGE_START: 500;
readonly INTERNAL_SERVER_ERROR: 500;
readonly SERVICE_UNAVAILABLE: 503;
readonly GATEWAY_TIMEOUT: 504;
readonly SERVER_ERROR_RANGE_END: 599;

@@ -307,3 +298,2 @@ };

export declare const ONE_DAY_IN_MS = 86400000;
export declare const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
//# sourceMappingURL=Constants.d.ts.map

@@ -13,3 +13,3 @@ {

},
"version": "14.7.2-alpha.0",
"version": "14.8.0",
"description": "Microsoft Authentication Library for js",

@@ -16,0 +16,0 @@ "keywords": [

@@ -90,4 +90,2 @@ /*

protected correlationId: string;
// Indicates if the authority is fake, for the purpose of a Managed Identity Application
private managedIdentity: boolean;
// Reserved tenant domain names that will not be replaced with tenant id

@@ -109,4 +107,3 @@ private static reservedTenantDomains: Set<string> = new Set([

correlationId: string,
performanceClient?: IPerformanceClient,
managedIdentity?: boolean
performanceClient?: IPerformanceClient
) {

@@ -126,3 +123,2 @@ this.canonicalAuthority = authority;

this.correlationId = correlationId;
this.managedIdentity = managedIdentity || false;
this.regionDiscovery = new RegionDiscovery(

@@ -393,3 +389,3 @@ networkInterface,

/**
* Boolean that returns whether or not tenant discovery has been completed.
* Boolean that returns whethr or not tenant discovery has been completed.
*/

@@ -1176,5 +1172,3 @@ discoveryComplete(): boolean {

getPreferredCache(): string {
if (this.managedIdentity) {
return Constants.DEFAULT_AUTHORITY_HOST;
} else if (this.discoveryComplete()) {
if (this.discoveryComplete()) {
return this.metadata.preferred_cache;

@@ -1181,0 +1175,0 @@ } else {

@@ -9,6 +9,3 @@ /*

import { ILoggerCallback, Logger, LogLevel } from "../logger/Logger";
import {
Constants,
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
} from "../utils/Constants";
import { Constants } from "../utils/Constants";
import { version } from "../packageMetadata";

@@ -28,2 +25,5 @@ import { Authority } from "../authority/Authority";

// Token renewal offset default in seconds
const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;
/**

@@ -30,0 +30,0 @@ * Use the configuration object to configure MSAL Modules and initialize the base interfaces for MSAL.

@@ -207,3 +207,2 @@ /*

HttpStatus,
DEFAULT_TOKEN_RENEWAL_OFFSET_SEC,
JsonWebTokenTypes,

@@ -210,0 +209,0 @@ } from "./utils/Constants";

/* eslint-disable header/header */
export const name = "@azure/msal-common";
export const version = "14.7.2-alpha.0";
export const version = "14.8.0";

@@ -12,3 +12,6 @@ /*

export type InProgressPerformanceEvent = {
end: (event?: Partial<PerformanceEvent>) => PerformanceEvent | null;
end: (
event?: Partial<PerformanceEvent>,
error?: unknown
) => PerformanceEvent | null;
discard: () => void;

@@ -15,0 +18,0 @@ add: (fields: { [key: string]: {} | undefined }) => void;

@@ -17,3 +17,6 @@ /*

PerformanceEvent,
PerformanceEventAbbreviations,
PerformanceEventContext,
PerformanceEvents,
PerformanceEventStackedContext,
PerformanceEventStatus,

@@ -23,2 +26,3 @@ } from "./PerformanceEvent";

import { StubPerformanceMeasurement } from "./StubPerformanceClient";
import { AuthError } from "../../error/AuthError";

@@ -30,2 +34,208 @@ export interface PreQueueEvent {

/**
* Starts context by adding payload to the stack
* @param event {PerformanceEvent}
* @param abbreviations {Map<string, string>} event name abbreviations
* @param stack {?PerformanceEventStackedContext[]} stack
*/
export function startContext(
event: PerformanceEvent,
abbreviations: Map<string, string>,
stack?: PerformanceEventStackedContext[]
): void {
if (!stack) {
return;
}
stack.push({
name: abbreviations.get(event.name) || event.name,
});
}
/**
* Ends context by removing payload from the stack and returning parent or self, if stack is empty, payload
*
* @param event {PerformanceEvent}
* @param abbreviations {Map<string, string>} event name abbreviations
* @param stack {?PerformanceEventStackedContext[]} stack
* @param error {?unknown} error
*/
export function endContext(
event: PerformanceEvent,
abbreviations: Map<string, string>,
stack?: PerformanceEventStackedContext[],
error?: unknown
): PerformanceEventContext | undefined {
if (!stack?.length) {
return;
}
const peek = (stack: PerformanceEventStackedContext[]) => {
return stack.length ? stack[stack.length - 1] : undefined;
};
const abbrEventName = abbreviations.get(event.name) || event.name;
const top = peek(stack);
if (top?.name !== abbrEventName) {
return;
}
const current = stack?.pop();
if (!current) {
return;
}
const errorCode =
error instanceof AuthError
? error.errorCode
: error instanceof Error
? error.name
: undefined;
const subErr = error instanceof AuthError ? error.subError : undefined;
if (errorCode && current.childErr !== errorCode) {
current.err = errorCode;
if (subErr) {
current.subErr = subErr;
}
}
delete current.name;
delete current.childErr;
const context: PerformanceEventContext = {
...current,
dur: event.durationMs,
};
if (!event.success) {
context.fail = 1;
}
const parent = peek(stack);
if (!parent) {
return { [abbrEventName]: context };
}
if (errorCode) {
parent.childErr = errorCode;
}
let childName: string;
if (!parent[abbrEventName]) {
childName = abbrEventName;
} else {
const siblings = Object.keys(parent).filter((key) =>
key.startsWith(abbrEventName)
).length;
childName = `${abbrEventName}_${siblings + 1}`;
}
parent[childName] = context;
return parent;
}
/**
* Adds error name and stack trace to the telemetry event
* @param error {Error}
* @param logger {Logger}
* @param event {PerformanceEvent}
* @param stackMaxSize {number} max error stack size to capture
*/
export function addError(
error: unknown,
logger: Logger,
event: PerformanceEvent,
stackMaxSize: number = 5
): void {
if (!(error instanceof Error)) {
logger.trace(
"PerformanceClient.addErrorStack: Input error is not instance of Error",
event.correlationId
);
return;
} else if (error instanceof AuthError) {
event.errorCode = error.errorCode;
event.subErrorCode = error.subError;
return;
} else if (event.errorStack?.length) {
logger.trace(
"PerformanceClient.addErrorStack: Stack already exist",
event.correlationId
);
return;
} else if (!error.stack?.length) {
logger.trace(
"PerformanceClient.addErrorStack: Input stack is empty",
event.correlationId
);
return;
}
if (error.stack) {
event.errorStack = compactStack(error.stack, stackMaxSize);
}
event.errorName = error.name;
}
/**
* Compacts error stack into array by fetching N first entries
* @param stack {string} error stack
* @param stackMaxSize {number} max error stack size to capture
* @returns {string[]}
*/
export function compactStack(stack: string, stackMaxSize: number): string[] {
if (stackMaxSize < 0) {
return [];
}
const stackArr = stack.split("\n") || [];
if (stackArr.length < 2) {
return [];
}
const res = [];
// Get top N stack lines
for (
// Skip first line as it may contain PII data
let ix = Math.max(stackArr.length - stackMaxSize - 1, 1);
ix < stackArr.length;
ix++
) {
const line = stackArr[ix];
if (res.length >= stackMaxSize) {
break;
}
res.push(compactStackLine(line));
}
return res;
}
/**
* Compacts error stack line by shortening file path
* Example: https://localhost/msal-common/src/authority/Authority.js:100:1 -> Authority.js:100:1
* @param line {string} stack line
* @returns {string}
*/
export function compactStackLine(line: string): string {
const filePathIx = line.lastIndexOf(" ") + 1;
if (filePathIx < 1) {
return line;
}
const filePath = line.substring(filePathIx);
let fileNameIx = filePath.lastIndexOf("/");
fileNameIx = fileNameIx < 0 ? filePath.lastIndexOf("\\") : fileNameIx;
if (fileNameIx >= 0) {
return (
line.substring(0, filePathIx) +
"(" +
filePath.substring(fileNameIx + 1) +
(filePath.charAt(filePath.length - 1) === ")" ? "" : ")")
).trimStart();
}
return line.trimStart();
}
export abstract class PerformanceClient implements IPerformanceClient {

@@ -66,2 +276,16 @@ protected authority: string;

/**
* Map of stacked events by correlation id.
*
* @protected
*/
protected eventStack: Map<string, PerformanceEventStackedContext[]>;
/**
* Event name abbreviations
*
* @protected
*/
protected abbreviations: Map<string, string>;
/**
* Creates an instance of PerformanceClient,

@@ -78,2 +302,3 @@ * an abstract class containing core performance telemetry logic.

* @param {Set<String>} intFields integer fields to be truncated
* @param {Map<string, string>} abbreviations event name abbreviations
*/

@@ -87,3 +312,4 @@ constructor(

applicationTelemetry: ApplicationTelemetry,
intFields?: Set<string>
intFields?: Set<string>,
abbreviations?: Map<string, string>
) {

@@ -98,2 +324,3 @@ this.authority = authority;

this.eventsByCorrelationId = new Map();
this.eventStack = new Map();
this.queueMeasurements = new Map();

@@ -105,2 +332,6 @@ this.preQueueTimeByCorrelationId = new Map();

}
this.abbreviations = abbreviations || new Map();
for (const [key, value] of PerformanceEventAbbreviations) {
this.abbreviations.set(key, value);
}
}

@@ -303,2 +534,7 @@

this.cacheEventByCorrelationId(inProgressEvent);
startContext(
inProgressEvent,
this.abbreviations,
this.eventStack.get(eventCorrelationId)
);

@@ -308,10 +544,14 @@ // Return the event and functions the caller can use to properly end/flush the measurement

end: (
event?: Partial<PerformanceEvent>
event?: Partial<PerformanceEvent>,
error?: unknown
): PerformanceEvent | null => {
return this.endMeasurement({
// Initial set of event properties
...inProgressEvent,
// Properties set when event ends
...event,
});
return this.endMeasurement(
{
// Initial set of event properties
...inProgressEvent,
// Properties set when event ends
...event,
},
error
);
},

@@ -342,6 +582,9 @@ discard: () => {

* @param {PerformanceEvent} event
* @param {IPerformanceMeasurement} measurement
* @param {unknown} error
* @returns {(PerformanceEvent | null)}
*/
endMeasurement(event: PerformanceEvent): PerformanceEvent | null {
endMeasurement(
event: PerformanceEvent,
error?: unknown
): PerformanceEvent | null {
const rootEvent: PerformanceEvent | undefined =

@@ -363,2 +606,14 @@ this.eventsByCorrelationId.get(event.correlationId);

};
event.durationMs = Math.round(
event.durationMs || this.getDurationMs(event.startTimeMs)
);
const context = endContext(
event,
this.abbreviations,
this.eventStack.get(rootEvent.correlationId),
error
);
if (isRoot) {

@@ -371,6 +626,4 @@ queueInfo = this.getQueueInfo(event.correlationId);

const durationMs =
event.durationMs || this.getDurationMs(event.startTimeMs);
this.logger.trace(
`PerformanceClient: Performance measurement ended for ${event.name}: ${durationMs} ms`,
`PerformanceClient: Performance measurement ended for ${event.name}: ${event.durationMs} ms`,
event.correlationId

@@ -381,6 +634,10 @@ );

if (!isRoot) {
rootEvent[event.name + "DurationMs"] = Math.floor(durationMs);
rootEvent[event.name + "DurationMs"] = Math.floor(event.durationMs);
return { ...rootEvent };
}
if (error) {
addError(error, this.logger, rootEvent);
}
let finalEvent: PerformanceEvent = { ...rootEvent, ...event };

@@ -400,3 +657,2 @@ let incompleteSubsCount: number = 0;

...finalEvent,
durationMs: Math.round(durationMs),
queuedTimeMs: queueInfo.totalQueueTime,

@@ -407,2 +663,3 @@ queuedCount: queueInfo.totalQueueCount,

incompleteSubsCount,
context,
};

@@ -495,2 +752,3 @@ this.truncateIntegralFields(finalEvent);

this.eventsByCorrelationId.set(event.correlationId, { ...event });
this.eventStack.set(event.correlationId, []);
}

@@ -560,2 +818,8 @@ }

this.preQueueTimeByCorrelationId.delete(correlationId);
this.logger.trace(
"PerformanceClient: Event stack discarded",
correlationId
);
this.eventStack.delete(correlationId);
}

@@ -627,3 +891,2 @@

* @param {PerformanceEvent} event performance event to update.
* @param {Set<string>} intFields integral fields.
*/

@@ -630,0 +893,0 @@ private truncateIntegralFields(event: PerformanceEvent): void {

@@ -303,2 +303,221 @@ /*

export const PerformanceEventAbbreviations: ReadonlyMap<string, string> =
new Map([
[PerformanceEvents.AcquireTokenByCode, "ATByCode"],
[PerformanceEvents.AcquireTokenByRefreshToken, "ATByRT"],
[PerformanceEvents.AcquireTokenSilent, "ATS"],
[PerformanceEvents.AcquireTokenSilentAsync, "ATSAsync"],
[PerformanceEvents.AcquireTokenPopup, "ATPopup"],
[PerformanceEvents.AcquireTokenRedirect, "ATRedirect"],
[
PerformanceEvents.CryptoOptsGetPublicKeyThumbprint,
"CryptoGetPKThumb",
],
[PerformanceEvents.CryptoOptsSignJwt, "CryptoSignJwt"],
[PerformanceEvents.SilentCacheClientAcquireToken, "SltCacheClientAT"],
[PerformanceEvents.SilentIframeClientAcquireToken, "SltIframeClientAT"],
[PerformanceEvents.SilentRefreshClientAcquireToken, "SltRClientAT"],
[PerformanceEvents.SsoSilent, "SsoSlt"],
[
PerformanceEvents.StandardInteractionClientGetDiscoveredAuthority,
"StdIntClientGetDiscAuth",
],
[
PerformanceEvents.FetchAccountIdWithNativeBroker,
"FetchAccIdWithNtvBroker",
],
[
PerformanceEvents.NativeInteractionClientAcquireToken,
"NtvIntClientAT",
],
[
PerformanceEvents.BaseClientCreateTokenRequestHeaders,
"BaseClientCreateTReqHead",
],
[
PerformanceEvents.RefreshTokenClientExecutePostToTokenEndpoint,
"RTClientExecPost",
],
[
PerformanceEvents.AuthorizationCodeClientExecutePostToTokenEndpoint,
"AuthCodeClientExecPost",
],
[PerformanceEvents.BrokerHandhshake, "BrokerHandshake"],
[
PerformanceEvents.AcquireTokenByRefreshTokenInBroker,
"ATByRTInBroker",
],
[PerformanceEvents.AcquireTokenByBroker, "ATByBroker"],
[
PerformanceEvents.RefreshTokenClientExecuteTokenRequest,
"RTClientExecTReq",
],
[PerformanceEvents.RefreshTokenClientAcquireToken, "RTClientAT"],
[
PerformanceEvents.RefreshTokenClientAcquireTokenWithCachedRefreshToken,
"RTClientATWithCachedRT",
],
[
PerformanceEvents.RefreshTokenClientAcquireTokenByRefreshToken,
"RTClientATByRT",
],
[
PerformanceEvents.RefreshTokenClientCreateTokenRequestBody,
"RTClientCreateTReqBody",
],
[PerformanceEvents.AcquireTokenFromCache, "ATFromCache"],
[
PerformanceEvents.SilentFlowClientAcquireCachedToken,
"SltFlowClientATCached",
],
[
PerformanceEvents.SilentFlowClientGenerateResultFromCacheRecord,
"SltFlowClientGenResFromCache",
],
[PerformanceEvents.AcquireTokenBySilentIframe, "ATBySltIframe"],
[PerformanceEvents.InitializeBaseRequest, "InitBaseReq"],
[PerformanceEvents.InitializeSilentRequest, "InitSltReq"],
[
PerformanceEvents.InitializeClientApplication,
"InitClientApplication",
],
[PerformanceEvents.SilentIframeClientTokenHelper, "SIClientTHelper"],
[
PerformanceEvents.SilentHandlerInitiateAuthRequest,
"SHandlerInitAuthReq",
],
[
PerformanceEvents.SilentHandlerMonitorIframeForHash,
"SltHandlerMonitorIframeForHash",
],
[PerformanceEvents.SilentHandlerLoadFrame, "SHandlerLoadFrame"],
[PerformanceEvents.SilentHandlerLoadFrameSync, "SHandlerLoadFrameSync"],
[
PerformanceEvents.StandardInteractionClientCreateAuthCodeClient,
"StdIntClientCreateAuthCodeClient",
],
[
PerformanceEvents.StandardInteractionClientGetClientConfiguration,
"StdIntClientGetClientConf",
],
[
PerformanceEvents.StandardInteractionClientInitializeAuthorizationRequest,
"StdIntClientInitAuthReq",
],
[
PerformanceEvents.StandardInteractionClientInitializeAuthorizationCodeRequest,
"StdIntClientInitAuthCodeReq",
],
[PerformanceEvents.GetAuthCodeUrl, "GetAuthCodeUrl"],
[
PerformanceEvents.HandleCodeResponseFromServer,
"HandleCodeResFromServer",
],
[PerformanceEvents.HandleCodeResponse, "HandleCodeResp"],
[PerformanceEvents.UpdateTokenEndpointAuthority, "UpdTEndpointAuth"],
[PerformanceEvents.AuthClientAcquireToken, "AuthClientAT"],
[PerformanceEvents.AuthClientExecuteTokenRequest, "AuthClientExecTReq"],
[
PerformanceEvents.AuthClientCreateTokenRequestBody,
"AuthClientCreateTReqBody",
],
[
PerformanceEvents.AuthClientCreateQueryString,
"AuthClientCreateQueryStr",
],
[PerformanceEvents.PopTokenGenerateCnf, "PopTGenCnf"],
[PerformanceEvents.PopTokenGenerateKid, "PopTGenKid"],
[PerformanceEvents.HandleServerTokenResponse, "HandleServerTRes"],
[PerformanceEvents.DeserializeResponse, "DeserializeRes"],
[
PerformanceEvents.AuthorityFactoryCreateDiscoveredInstance,
"AuthFactCreateDiscInst",
],
[
PerformanceEvents.AuthorityResolveEndpointsAsync,
"AuthResolveEndpointsAsync",
],
[
PerformanceEvents.AuthorityResolveEndpointsFromLocalSources,
"AuthResolveEndpointsFromLocal",
],
[
PerformanceEvents.AuthorityGetCloudDiscoveryMetadataFromNetwork,
"AuthGetCDMetaFromNet",
],
[
PerformanceEvents.AuthorityUpdateCloudDiscoveryMetadata,
"AuthUpdCDMeta",
],
[
PerformanceEvents.AuthorityGetEndpointMetadataFromNetwork,
"AuthUpdCDMetaFromNet",
],
[
PerformanceEvents.AuthorityUpdateEndpointMetadata,
"AuthUpdEndpointMeta",
],
[
PerformanceEvents.AuthorityUpdateMetadataWithRegionalInformation,
"AuthUpdMetaWithRegInfo",
],
[PerformanceEvents.RegionDiscoveryDetectRegion, "RegDiscDetectReg"],
[
PerformanceEvents.RegionDiscoveryGetRegionFromIMDS,
"RegDiscGetRegFromIMDS",
],
[
PerformanceEvents.RegionDiscoveryGetCurrentVersion,
"RegDiscGetCurrentVer",
],
[PerformanceEvents.AcquireTokenByCodeAsync, "ATByCodeAsync"],
[
PerformanceEvents.GetEndpointMetadataFromNetwork,
"GetEndpointMetaFromNet",
],
[
PerformanceEvents.GetCloudDiscoveryMetadataFromNetworkMeasurement,
"GetCDMetaFromNet",
],
[
PerformanceEvents.HandleRedirectPromiseMeasurement,
"HandleRedirectPromise",
],
[
PerformanceEvents.HandleNativeRedirectPromiseMeasurement,
"HandleNtvRedirectPromise",
],
[
PerformanceEvents.UpdateCloudDiscoveryMetadataMeasurement,
"UpdateCDMeta",
],
[
PerformanceEvents.UsernamePasswordClientAcquireToken,
"UserPassClientAT",
],
[
PerformanceEvents.NativeMessageHandlerHandshake,
"NtvMsgHandlerHandshake",
],
[PerformanceEvents.NativeGenerateAuthResult, "NtvGenAuthRes"],
[PerformanceEvents.RemoveHiddenIframe, "RemoveHiddenIframe"],
[
PerformanceEvents.ClearTokensAndKeysWithClaims,
"ClearTAndKeysWithClaims",
],
[PerformanceEvents.CacheManagerGetRefreshToken, "CacheManagerGetRT"],
[PerformanceEvents.GeneratePkceCodes, "GenPkceCodes"],
[PerformanceEvents.GenerateCodeVerifier, "GenCodeVerifier"],
[
PerformanceEvents.GenerateCodeChallengeFromVerifier,
"GenCodeChallengeFromVerifier",
],
[PerformanceEvents.Sha256Digest, "Sha256Digest"],
[PerformanceEvents.GetRandomValues, "GetRandomValues"],
]);
/**

@@ -577,4 +796,22 @@ * State of the performance event.

multiMatchedRT?: number;
errorName?: string;
errorStack?: string[];
//
context?: object;
};
export type PerformanceEventContext = {
dur?: number;
err?: string;
subErr?: string;
fail?: number;
};
export type PerformanceEventStackedContext = PerformanceEventContext & {
name?: string;
childErr?: string;
};
export const IntFields: ReadonlySet<string> = new Set([

@@ -581,0 +818,0 @@ "accessTokenSize",

@@ -68,16 +68,7 @@ /*

SUCCESS_RANGE_START: 200,
SUCCESS: 200,
SUCCESS_RANGE_END: 299,
REDIRECT: 302,
CLIENT_ERROR_RANGE_START: 400,
BAD_REQUEST: 400,
UNAUTHORIZED: 401,
NOT_FOUND: 404,
REQUEST_TIMEOUT: 408,
TOO_MANY_REQUESTS: 429,
CLIENT_ERROR_RANGE_END: 499,
SERVER_ERROR_RANGE_START: 500,
INTERNAL_SERVER_ERROR: 500,
SERVICE_UNAVAILABLE: 503,
GATEWAY_TIMEOUT: 504,
SERVER_ERROR_RANGE_END: 599,

@@ -383,4 +374,1 @@ } as const;

export const ONE_DAY_IN_MS = 86400000;
// Token renewal offset default in seconds
export const DEFAULT_TOKEN_RENEWAL_OFFSET_SEC = 300;

@@ -56,5 +56,8 @@ /*

}
inProgressEvent?.end({
success: false,
});
inProgressEvent?.end(
{
success: false,
},
e
);
throw e;

@@ -115,5 +118,8 @@ }

}
inProgressEvent?.end({
success: false,
});
inProgressEvent?.end(
{
success: false,
},
e
);
throw e;

@@ -120,0 +126,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

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

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

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

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

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

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

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

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