@azure/msal-common 4.2.1 → 4.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.json +212 -1
- package/LICENSE +21 -21
- package/README.md +61 -58
- package/changelog.md +402 -344
- package/dist/_virtual/_tslib.js +90 -0
- package/dist/_virtual/_tslib.js.map +1 -0
- package/dist/account/AuthToken.js +43 -0
- package/dist/account/AuthToken.js.map +1 -0
- package/dist/account/CcsCredential.d.ts +9 -0
- package/dist/account/CcsCredential.d.ts.map +1 -0
- package/dist/account/CcsCredential.js +14 -0
- package/dist/account/CcsCredential.js.map +1 -0
- package/dist/account/ClientInfo.d.ts +6 -1
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.js +44 -0
- package/dist/account/ClientInfo.js.map +1 -0
- package/dist/account/TokenClaims.d.ts +1 -0
- package/dist/account/TokenClaims.d.ts.map +1 -1
- package/dist/authority/Authority.d.ts +25 -0
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.js +574 -0
- package/dist/authority/Authority.js.map +1 -0
- package/dist/authority/AuthorityFactory.js +69 -0
- package/dist/authority/AuthorityFactory.js.map +1 -0
- package/dist/authority/AuthorityOptions.d.ts +2 -0
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityType.js +17 -0
- package/dist/authority/AuthorityType.js.map +1 -0
- package/dist/authority/AzureRegion.d.ts +2 -0
- package/dist/authority/AzureRegion.d.ts.map +1 -0
- package/dist/authority/AzureRegionConfiguration.d.ts +6 -0
- package/dist/authority/AzureRegionConfiguration.d.ts.map +1 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.js +13 -0
- package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -0
- package/dist/authority/OpenIdConfigResponse.js +15 -0
- package/dist/authority/OpenIdConfigResponse.js.map +1 -0
- package/dist/authority/ProtocolMode.js +17 -0
- package/dist/authority/ProtocolMode.js.map +1 -0
- package/dist/authority/RegionDiscovery.d.ts +31 -0
- package/dist/authority/RegionDiscovery.d.ts.map +1 -0
- package/dist/authority/RegionDiscovery.js +119 -0
- package/dist/authority/RegionDiscovery.js.map +1 -0
- package/dist/authority/RegionDiscoveryMetadata.d.ts +7 -0
- package/dist/authority/RegionDiscoveryMetadata.d.ts.map +1 -0
- package/dist/cache/CacheManager.js +713 -0
- package/dist/cache/CacheManager.js.map +1 -0
- package/dist/cache/entities/AccessTokenEntity.js +111 -0
- package/dist/cache/entities/AccessTokenEntity.js.map +1 -0
- package/dist/cache/entities/AccountEntity.d.ts +5 -5
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.js +242 -0
- package/dist/cache/entities/AccountEntity.js.map +1 -0
- package/dist/cache/entities/AppMetadataEntity.js +74 -0
- package/dist/cache/entities/AppMetadataEntity.js.map +1 -0
- package/dist/cache/entities/AuthorityMetadataEntity.js +81 -0
- package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -0
- package/dist/cache/entities/CacheRecord.js +19 -0
- package/dist/cache/entities/CacheRecord.js.map +1 -0
- package/dist/cache/entities/CredentialEntity.js +142 -0
- package/dist/cache/entities/CredentialEntity.js.map +1 -0
- package/dist/cache/entities/IdTokenEntity.js +71 -0
- package/dist/cache/entities/IdTokenEntity.js.map +1 -0
- package/dist/cache/entities/RefreshTokenEntity.js +73 -0
- package/dist/cache/entities/RefreshTokenEntity.js.map +1 -0
- package/dist/cache/entities/ServerTelemetryEntity.js +35 -0
- package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -0
- package/dist/cache/entities/ThrottlingEntity.js +32 -0
- package/dist/cache/entities/ThrottlingEntity.js.map +1 -0
- package/dist/cache/persistence/TokenCacheContext.js +39 -0
- package/dist/cache/persistence/TokenCacheContext.js.map +1 -0
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.js +388 -0
- package/dist/client/AuthorizationCodeClient.js.map +1 -0
- package/dist/client/BaseClient.d.ts +2 -1
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.js +101 -0
- package/dist/client/BaseClient.js.map +1 -0
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.js +169 -0
- package/dist/client/ClientCredentialClient.js.map +1 -0
- package/dist/client/DeviceCodeClient.d.ts +6 -0
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.js +212 -0
- package/dist/client/DeviceCodeClient.js.map +1 -0
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.js +209 -0
- package/dist/client/OnBehalfOfClient.js.map +1 -0
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.js +212 -0
- package/dist/client/RefreshTokenClient.js.map +1 -0
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.js +132 -0
- package/dist/client/SilentFlowClient.js.map +1 -0
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.js +112 -0
- package/dist/client/UsernamePasswordClient.js.map +1 -0
- package/dist/config/ClientConfiguration.d.ts +3 -0
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.js +91 -0
- package/dist/config/ClientConfiguration.js.map +1 -0
- package/dist/crypto/ICrypto.js +53 -0
- package/dist/crypto/ICrypto.js.map +1 -0
- package/dist/crypto/PopTokenGenerator.js +72 -0
- package/dist/crypto/PopTokenGenerator.js.map +1 -0
- package/dist/error/AuthError.js +46 -0
- package/dist/error/AuthError.js.map +1 -0
- package/dist/error/ClientAuthError.d.ts +13 -6
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.js +456 -0
- package/dist/error/ClientAuthError.js.map +1 -0
- package/dist/error/ClientConfigurationError.d.ts +1 -6
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.js +210 -0
- package/dist/error/ClientConfigurationError.js.map +1 -0
- package/dist/error/InteractionRequiredAuthError.js +48 -0
- package/dist/error/InteractionRequiredAuthError.js.map +1 -0
- package/dist/error/ServerError.js +25 -0
- package/dist/error/ServerError.js.map +1 -0
- package/dist/index.cjs.js +7045 -0
- package/dist/index.cjs.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +43 -6479
- package/dist/index.js.map +1 -0
- package/dist/logger/Logger.d.ts +12 -3
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.js +183 -0
- package/dist/logger/Logger.js.map +1 -0
- package/dist/network/INetworkModule.d.ts +1 -1
- package/dist/network/INetworkModule.d.ts.map +1 -1
- package/dist/network/INetworkModule.js +21 -0
- package/dist/network/INetworkModule.js.map +1 -0
- package/dist/network/NetworkManager.js +56 -0
- package/dist/network/NetworkManager.js.map +1 -0
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.js +95 -0
- package/dist/network/ThrottlingUtils.js.map +1 -0
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.js +8 -0
- package/dist/packageMetadata.js.map +1 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts +3 -0
- package/dist/request/CommonAuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/CommonAuthorizationUrlRequest.d.ts +1 -0
- package/dist/request/CommonAuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +7 -4
- package/dist/request/CommonClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/CommonRefreshTokenRequest.d.ts +2 -0
- package/dist/request/CommonRefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +11 -0
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.js +340 -0
- package/dist/request/RequestParameterBuilder.js.map +1 -0
- package/dist/request/RequestValidator.d.ts.map +1 -1
- package/dist/request/RequestValidator.js +92 -0
- package/dist/request/RequestValidator.js.map +1 -0
- package/dist/request/ScopeSet.js +192 -0
- package/dist/request/ScopeSet.js.map +1 -0
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/AuthorizationCodePayload.d.ts +1 -0
- package/dist/response/AuthorizationCodePayload.d.ts.map +1 -1
- package/dist/response/IMDSBadResponse.d.ts +5 -0
- package/dist/response/IMDSBadResponse.d.ts.map +1 -0
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.js +281 -0
- package/dist/response/ResponseHandler.js.map +1 -0
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +23 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.js +168 -0
- package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -0
- package/dist/url/UrlString.d.ts +10 -0
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.js +223 -0
- package/dist/url/UrlString.js.map +1 -0
- package/dist/utils/Constants.d.ts +47 -4
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.js +362 -0
- package/dist/utils/Constants.js.map +1 -0
- package/dist/utils/ProtocolUtils.js +77 -0
- package/dist/utils/ProtocolUtils.js.map +1 -0
- package/dist/utils/StringUtils.d.ts +5 -0
- package/dist/utils/StringUtils.d.ts.map +1 -1
- package/dist/utils/StringUtils.js +128 -0
- package/dist/utils/StringUtils.js.map +1 -0
- package/dist/utils/TimeUtils.d.ts +13 -0
- package/dist/utils/TimeUtils.d.ts.map +1 -1
- package/dist/utils/TimeUtils.js +53 -0
- package/dist/utils/TimeUtils.js.map +1 -0
- package/package.json +10 -19
- package/dist/index.es.js +0 -6472
|
@@ -1,15 +1,20 @@
|
|
|
1
|
+
import { CacheOutcome } from "../../utils/Constants";
|
|
1
2
|
import { CacheManager } from "../../cache/CacheManager";
|
|
2
3
|
import { AuthError } from "../../error/AuthError";
|
|
3
4
|
import { ServerTelemetryRequest } from "./ServerTelemetryRequest";
|
|
4
5
|
import { ServerTelemetryEntity } from "../../cache/entities/ServerTelemetryEntity";
|
|
6
|
+
import { RegionDiscoveryMetadata } from "../../authority/RegionDiscoveryMetadata";
|
|
5
7
|
export declare class ServerTelemetryManager {
|
|
6
8
|
private cacheManager;
|
|
7
9
|
private apiId;
|
|
8
10
|
private correlationId;
|
|
9
|
-
private forceRefresh;
|
|
10
11
|
private telemetryCacheKey;
|
|
11
12
|
private wrapperSKU;
|
|
12
13
|
private wrapperVer;
|
|
14
|
+
private regionUsed;
|
|
15
|
+
private regionSource;
|
|
16
|
+
private regionOutcome;
|
|
17
|
+
private cacheOutcome;
|
|
13
18
|
constructor(telemetryRequest: ServerTelemetryRequest, cacheManager: CacheManager);
|
|
14
19
|
/**
|
|
15
20
|
* API to add MSER Telemetry to request
|
|
@@ -41,5 +46,22 @@ export declare class ServerTelemetryManager {
|
|
|
41
46
|
* @param serverTelemetryEntity
|
|
42
47
|
*/
|
|
43
48
|
static maxErrorsToSend(serverTelemetryEntity: ServerTelemetryEntity): number;
|
|
49
|
+
/**
|
|
50
|
+
* Get the region discovery fields
|
|
51
|
+
*
|
|
52
|
+
* @returns string
|
|
53
|
+
*/
|
|
54
|
+
getRegionDiscoveryFields(): string;
|
|
55
|
+
/**
|
|
56
|
+
* Update the region discovery metadata
|
|
57
|
+
*
|
|
58
|
+
* @param regionDiscoveryMetadata
|
|
59
|
+
* @returns void
|
|
60
|
+
*/
|
|
61
|
+
updateRegionDiscoveryMetadata(regionDiscoveryMetadata: RegionDiscoveryMetadata): void;
|
|
62
|
+
/**
|
|
63
|
+
* Set cache outcome
|
|
64
|
+
*/
|
|
65
|
+
setCacheOutcome(cacheOutcome: CacheOutcome): void;
|
|
44
66
|
}
|
|
45
67
|
//# sourceMappingURL=ServerTelemetryManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ServerTelemetryManager.d.ts","sourceRoot":"","sources":["../../../src/telemetry/server/ServerTelemetryManager.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ServerTelemetryManager.d.ts","sourceRoot":"","sources":["../../../src/telemetry/server/ServerTelemetryManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAsC,YAAY,EAA8D,MAAM,uBAAuB,CAAC;AACrJ,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAC;AAEnF,OAAO,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAC;AAElF,qBAAa,sBAAsB;IAC/B,OAAO,CAAC,YAAY,CAAe;IACnC,OAAO,CAAC,KAAK,CAAS;IACtB,OAAO,CAAC,aAAa,CAAS;IAC9B,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,YAAY,CAAqC;IACzD,OAAO,CAAC,aAAa,CAAsC;IAC3D,OAAO,CAAC,YAAY,CAA2C;gBAEnD,gBAAgB,EAAE,sBAAsB,EAAE,YAAY,EAAE,YAAY;IAUhF;;OAEG;IACH,iCAAiC,IAAI,MAAM;IAS3C;;OAEG;IACH,8BAA8B,IAAI,MAAM;IAexC;;;OAGG;IACH,kBAAkB,CAAC,KAAK,EAAE,SAAS,GAAG,IAAI;IA0B1C;;OAEG;IACH,kBAAkB,IAAI,MAAM;IAQ5B;;OAEG;IACH,eAAe,IAAI,qBAAqB;IAOxC;;OAEG;IACH,mBAAmB,IAAI,IAAI;IAiB3B;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,qBAAqB,EAAE,qBAAqB,GAAG,MAAM;IAyB5E;;;;OAIG;IACH,wBAAwB,IAAI,MAAM;IAUlC;;;;;OAKG;IACH,6BAA6B,CAAC,uBAAuB,EAAE,uBAAuB,GAAG,IAAI;IAMrF;;OAEG;IACH,eAAe,CAAC,YAAY,EAAE,YAAY,GAAG,IAAI;CAGpD"}
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { SERVER_TELEM_CONSTANTS, CacheOutcome, Constants, Separators } from '../../utils/Constants.js';
|
|
4
|
+
import { ServerTelemetryEntity } from '../../cache/entities/ServerTelemetryEntity.js';
|
|
5
|
+
import { StringUtils } from '../../utils/StringUtils.js';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
var ServerTelemetryManager = /** @class */ (function () {
|
|
12
|
+
function ServerTelemetryManager(telemetryRequest, cacheManager) {
|
|
13
|
+
this.cacheOutcome = CacheOutcome.NO_CACHE_HIT;
|
|
14
|
+
this.cacheManager = cacheManager;
|
|
15
|
+
this.apiId = telemetryRequest.apiId;
|
|
16
|
+
this.correlationId = telemetryRequest.correlationId;
|
|
17
|
+
this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;
|
|
18
|
+
this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;
|
|
19
|
+
this.telemetryCacheKey = SERVER_TELEM_CONSTANTS.CACHE_KEY + Separators.CACHE_KEY_SEPARATOR + telemetryRequest.clientId;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* API to add MSER Telemetry to request
|
|
23
|
+
*/
|
|
24
|
+
ServerTelemetryManager.prototype.generateCurrentRequestHeaderValue = function () {
|
|
25
|
+
var request = "" + this.apiId + SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR + this.cacheOutcome;
|
|
26
|
+
var platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
|
|
27
|
+
var regionDiscoveryFields = this.getRegionDiscoveryFields();
|
|
28
|
+
var requestWithRegionDiscoveryFields = [request, regionDiscoveryFields].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
|
|
29
|
+
return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, requestWithRegionDiscoveryFields, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);
|
|
30
|
+
};
|
|
31
|
+
/**
|
|
32
|
+
* API to add MSER Telemetry for the last failed request
|
|
33
|
+
*/
|
|
34
|
+
ServerTelemetryManager.prototype.generateLastRequestHeaderValue = function () {
|
|
35
|
+
var lastRequests = this.getLastRequests();
|
|
36
|
+
var maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);
|
|
37
|
+
var failedRequests = lastRequests.failedRequests.slice(0, 2 * maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
|
|
38
|
+
var errors = lastRequests.errors.slice(0, maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
|
|
39
|
+
var errorCount = lastRequests.errors.length;
|
|
40
|
+
// Indicate whether this header contains all data or partial data
|
|
41
|
+
var overflow = maxErrors < errorCount ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;
|
|
42
|
+
var platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);
|
|
43
|
+
return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, lastRequests.cacheHits, failedRequests, errors, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* API to cache token failures for MSER data capture
|
|
47
|
+
* @param error
|
|
48
|
+
*/
|
|
49
|
+
ServerTelemetryManager.prototype.cacheFailedRequest = function (error) {
|
|
50
|
+
var lastRequests = this.getLastRequests();
|
|
51
|
+
if (lastRequests.errors.length >= SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {
|
|
52
|
+
// Remove a cached error to make room, first in first out
|
|
53
|
+
lastRequests.failedRequests.shift(); // apiId
|
|
54
|
+
lastRequests.failedRequests.shift(); // correlationId
|
|
55
|
+
lastRequests.errors.shift();
|
|
56
|
+
}
|
|
57
|
+
lastRequests.failedRequests.push(this.apiId, this.correlationId);
|
|
58
|
+
if (!StringUtils.isEmpty(error.subError)) {
|
|
59
|
+
lastRequests.errors.push(error.subError);
|
|
60
|
+
}
|
|
61
|
+
else if (!StringUtils.isEmpty(error.errorCode)) {
|
|
62
|
+
lastRequests.errors.push(error.errorCode);
|
|
63
|
+
}
|
|
64
|
+
else if (!!error && error.toString()) {
|
|
65
|
+
lastRequests.errors.push(error.toString());
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);
|
|
69
|
+
}
|
|
70
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
71
|
+
return;
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* Update server telemetry cache entry by incrementing cache hit counter
|
|
75
|
+
*/
|
|
76
|
+
ServerTelemetryManager.prototype.incrementCacheHits = function () {
|
|
77
|
+
var lastRequests = this.getLastRequests();
|
|
78
|
+
lastRequests.cacheHits += 1;
|
|
79
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);
|
|
80
|
+
return lastRequests.cacheHits;
|
|
81
|
+
};
|
|
82
|
+
/**
|
|
83
|
+
* Get the server telemetry entity from cache or initialize a new one
|
|
84
|
+
*/
|
|
85
|
+
ServerTelemetryManager.prototype.getLastRequests = function () {
|
|
86
|
+
var initialValue = new ServerTelemetryEntity();
|
|
87
|
+
var lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey);
|
|
88
|
+
return lastRequests || initialValue;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Remove server telemetry cache entry
|
|
92
|
+
*/
|
|
93
|
+
ServerTelemetryManager.prototype.clearTelemetryCache = function () {
|
|
94
|
+
var lastRequests = this.getLastRequests();
|
|
95
|
+
var numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);
|
|
96
|
+
var errorCount = lastRequests.errors.length;
|
|
97
|
+
if (numErrorsFlushed === errorCount) {
|
|
98
|
+
// All errors were sent on last request, clear Telemetry cache
|
|
99
|
+
this.cacheManager.removeItem(this.telemetryCacheKey);
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
// Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed
|
|
103
|
+
var serverTelemEntity = new ServerTelemetryEntity();
|
|
104
|
+
serverTelemEntity.failedRequests = lastRequests.failedRequests.slice(numErrorsFlushed * 2); // failedRequests contains 2 items for each error
|
|
105
|
+
serverTelemEntity.errors = lastRequests.errors.slice(numErrorsFlushed);
|
|
106
|
+
this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
/**
|
|
110
|
+
* Returns the maximum number of errors that can be flushed to the server in the next network request
|
|
111
|
+
* @param serverTelemetryEntity
|
|
112
|
+
*/
|
|
113
|
+
ServerTelemetryManager.maxErrorsToSend = function (serverTelemetryEntity) {
|
|
114
|
+
var i;
|
|
115
|
+
var maxErrors = 0;
|
|
116
|
+
var dataSize = 0;
|
|
117
|
+
var errorCount = serverTelemetryEntity.errors.length;
|
|
118
|
+
for (i = 0; i < errorCount; i++) {
|
|
119
|
+
// failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs
|
|
120
|
+
var apiId = serverTelemetryEntity.failedRequests[2 * i] || Constants.EMPTY_STRING;
|
|
121
|
+
var correlationId = serverTelemetryEntity.failedRequests[2 * i + 1] || Constants.EMPTY_STRING;
|
|
122
|
+
var errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;
|
|
123
|
+
// Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators
|
|
124
|
+
dataSize += apiId.toString().length + correlationId.toString().length + errorCode.length + 3;
|
|
125
|
+
if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {
|
|
126
|
+
// Adding this entry to the header would still keep header size below the limit
|
|
127
|
+
maxErrors += 1;
|
|
128
|
+
}
|
|
129
|
+
else {
|
|
130
|
+
break;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
return maxErrors;
|
|
134
|
+
};
|
|
135
|
+
/**
|
|
136
|
+
* Get the region discovery fields
|
|
137
|
+
*
|
|
138
|
+
* @returns string
|
|
139
|
+
*/
|
|
140
|
+
ServerTelemetryManager.prototype.getRegionDiscoveryFields = function () {
|
|
141
|
+
var regionDiscoveryFields = [];
|
|
142
|
+
regionDiscoveryFields.push(this.regionUsed || "");
|
|
143
|
+
regionDiscoveryFields.push(this.regionSource || "");
|
|
144
|
+
regionDiscoveryFields.push(this.regionOutcome || "");
|
|
145
|
+
return regionDiscoveryFields.join(",");
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Update the region discovery metadata
|
|
149
|
+
*
|
|
150
|
+
* @param regionDiscoveryMetadata
|
|
151
|
+
* @returns void
|
|
152
|
+
*/
|
|
153
|
+
ServerTelemetryManager.prototype.updateRegionDiscoveryMetadata = function (regionDiscoveryMetadata) {
|
|
154
|
+
this.regionUsed = regionDiscoveryMetadata.region_used;
|
|
155
|
+
this.regionSource = regionDiscoveryMetadata.region_source;
|
|
156
|
+
this.regionOutcome = regionDiscoveryMetadata.region_outcome;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Set cache outcome
|
|
160
|
+
*/
|
|
161
|
+
ServerTelemetryManager.prototype.setCacheOutcome = function (cacheOutcome) {
|
|
162
|
+
this.cacheOutcome = cacheOutcome;
|
|
163
|
+
};
|
|
164
|
+
return ServerTelemetryManager;
|
|
165
|
+
}());
|
|
166
|
+
|
|
167
|
+
export { ServerTelemetryManager };
|
|
168
|
+
//# sourceMappingURL=ServerTelemetryManager.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerTelemetryManager.js","sources":["../../../src/telemetry/server/ServerTelemetryManager.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS, Separators, CacheOutcome, Constants, RegionDiscoverySources, RegionDiscoveryOutcomes } from \"../../utils/Constants\";\nimport { CacheManager } from \"../../cache/CacheManager\";\nimport { AuthError } from \"../../error/AuthError\";\nimport { ServerTelemetryRequest } from \"./ServerTelemetryRequest\";\nimport { ServerTelemetryEntity } from \"../../cache/entities/ServerTelemetryEntity\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { RegionDiscoveryMetadata } from \"../../authority/RegionDiscoveryMetadata\";\n\nexport class ServerTelemetryManager {\n private cacheManager: CacheManager;\n private apiId: number;\n private correlationId: string;\n private telemetryCacheKey: string;\n private wrapperSKU: String;\n private wrapperVer: String;\n private regionUsed: string | undefined;\n private regionSource: RegionDiscoverySources | undefined;\n private regionOutcome: RegionDiscoveryOutcomes | undefined;\n private cacheOutcome: CacheOutcome = CacheOutcome.NO_CACHE_HIT;\n\n constructor(telemetryRequest: ServerTelemetryRequest, cacheManager: CacheManager) {\n this.cacheManager = cacheManager;\n this.apiId = telemetryRequest.apiId;\n this.correlationId = telemetryRequest.correlationId;\n this.wrapperSKU = telemetryRequest.wrapperSKU || Constants.EMPTY_STRING;\n this.wrapperVer = telemetryRequest.wrapperVer || Constants.EMPTY_STRING;\n\n this.telemetryCacheKey = SERVER_TELEM_CONSTANTS.CACHE_KEY + Separators.CACHE_KEY_SEPARATOR + telemetryRequest.clientId;\n }\n\n /**\n * API to add MSER Telemetry to request\n */\n generateCurrentRequestHeaderValue(): string {\n const request = `${this.apiId}${SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR}${this.cacheOutcome}`;\n const platformFields = [this.wrapperSKU, this.wrapperVer].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const regionDiscoveryFields = this.getRegionDiscoveryFields();\n const requestWithRegionDiscoveryFields = [request, regionDiscoveryFields].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, requestWithRegionDiscoveryFields, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\n }\n\n /**\n * API to add MSER Telemetry for the last failed request\n */\n generateLastRequestHeaderValue(): string {\n const lastRequests = this.getLastRequests();\n\n const maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);\n const failedRequests = lastRequests.failedRequests.slice(0, 2*maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const errors = lastRequests.errors.slice(0, maxErrors).join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n const errorCount = lastRequests.errors.length;\n\n // Indicate whether this header contains all data or partial data\n const overflow = maxErrors < errorCount ? SERVER_TELEM_CONSTANTS.OVERFLOW_TRUE : SERVER_TELEM_CONSTANTS.OVERFLOW_FALSE;\n const platformFields = [errorCount, overflow].join(SERVER_TELEM_CONSTANTS.VALUE_SEPARATOR);\n\n return [SERVER_TELEM_CONSTANTS.SCHEMA_VERSION, lastRequests.cacheHits, failedRequests, errors, platformFields].join(SERVER_TELEM_CONSTANTS.CATEGORY_SEPARATOR);\n }\n\n /**\n * API to cache token failures for MSER data capture\n * @param error\n */\n cacheFailedRequest(error: AuthError): void {\n const lastRequests = this.getLastRequests();\n if (lastRequests.errors.length >= SERVER_TELEM_CONSTANTS.MAX_CACHED_ERRORS) {\n // Remove a cached error to make room, first in first out\n lastRequests.failedRequests.shift(); // apiId\n lastRequests.failedRequests.shift(); // correlationId\n lastRequests.errors.shift();\n }\n \n lastRequests.failedRequests.push(this.apiId, this.correlationId);\n\n if (!StringUtils.isEmpty(error.subError)) {\n lastRequests.errors.push(error.subError);\n } else if (!StringUtils.isEmpty(error.errorCode)) {\n lastRequests.errors.push(error.errorCode);\n } else if (!!error && error.toString()) {\n lastRequests.errors.push(error.toString());\n } else {\n lastRequests.errors.push(SERVER_TELEM_CONSTANTS.UNKNOWN_ERROR);\n }\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\n\n return;\n }\n\n /**\n * Update server telemetry cache entry by incrementing cache hit counter\n */\n incrementCacheHits(): number {\n const lastRequests = this.getLastRequests();\n lastRequests.cacheHits += 1;\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, lastRequests);\n return lastRequests.cacheHits;\n }\n\n /**\n * Get the server telemetry entity from cache or initialize a new one\n */\n getLastRequests(): ServerTelemetryEntity {\n const initialValue: ServerTelemetryEntity = new ServerTelemetryEntity();\n const lastRequests = this.cacheManager.getServerTelemetry(this.telemetryCacheKey) as ServerTelemetryEntity;\n\n return lastRequests || initialValue;\n }\n\n /**\n * Remove server telemetry cache entry\n */\n clearTelemetryCache(): void {\n const lastRequests = this.getLastRequests();\n const numErrorsFlushed = ServerTelemetryManager.maxErrorsToSend(lastRequests);\n const errorCount = lastRequests.errors.length;\n if (numErrorsFlushed === errorCount) {\n // All errors were sent on last request, clear Telemetry cache\n this.cacheManager.removeItem(this.telemetryCacheKey);\n } else {\n // Partial data was flushed to server, construct a new telemetry cache item with errors that were not flushed\n const serverTelemEntity = new ServerTelemetryEntity();\n serverTelemEntity.failedRequests = lastRequests.failedRequests.slice(numErrorsFlushed*2); // failedRequests contains 2 items for each error\n serverTelemEntity.errors = lastRequests.errors.slice(numErrorsFlushed);\n\n this.cacheManager.setServerTelemetry(this.telemetryCacheKey, serverTelemEntity);\n }\n }\n\n /**\n * Returns the maximum number of errors that can be flushed to the server in the next network request\n * @param serverTelemetryEntity\n */\n static maxErrorsToSend(serverTelemetryEntity: ServerTelemetryEntity): number {\n let i;\n let maxErrors = 0;\n let dataSize = 0;\n const errorCount = serverTelemetryEntity.errors.length;\n for (i = 0; i < errorCount; i++) {\n // failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs\n const apiId = serverTelemetryEntity.failedRequests[2*i] || Constants.EMPTY_STRING;\n const correlationId = serverTelemetryEntity.failedRequests[2*i + 1] || Constants.EMPTY_STRING;\n const errorCode = serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;\n\n // Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators\n dataSize += apiId.toString().length + correlationId.toString().length + errorCode.length + 3;\n\n if (dataSize < SERVER_TELEM_CONSTANTS.MAX_LAST_HEADER_BYTES) {\n // Adding this entry to the header would still keep header size below the limit\n maxErrors += 1;\n } else {\n break;\n }\n }\n\n return maxErrors;\n }\n\n /**\n * Get the region discovery fields\n * \n * @returns string\n */\n getRegionDiscoveryFields(): string {\n const regionDiscoveryFields: string[] = [];\n\n regionDiscoveryFields.push(this.regionUsed || \"\");\n regionDiscoveryFields.push(this.regionSource || \"\");\n regionDiscoveryFields.push(this.regionOutcome || \"\");\n\n return regionDiscoveryFields.join(\",\");\n }\n\n /**\n * Update the region discovery metadata\n * \n * @param regionDiscoveryMetadata\n * @returns void\n */\n updateRegionDiscoveryMetadata(regionDiscoveryMetadata: RegionDiscoveryMetadata): void {\n this.regionUsed = regionDiscoveryMetadata.region_used;\n this.regionSource = regionDiscoveryMetadata.region_source;\n this.regionOutcome = regionDiscoveryMetadata.region_outcome;\n }\n\n /**\n * Set cache outcome \n */\n setCacheOutcome(cacheOutcome: CacheOutcome): void {\n this.cacheOutcome = cacheOutcome;\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;;IAyBI,gCAAY,gBAAwC,EAAE,YAA0B;QAFxE,iBAAY,GAAiB,YAAY,CAAC,YA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C,CAAC;aAClB;iBAAM;gBACH,MAAM;aACT;SACJ;QAED,OAAO,SAAS,CAAC;KACpB;;;;;;IAOD,yDAAwB,GAAxB;QACI,IAAM,qBAAqB,GAAa,EAAE,CAAC;QAE3C,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC;QAClD,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;QACpD,qBAAqB,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,IAAI,EAAE,CAAC,CAAC;QAErD,OAAO,qBAAqB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;KAC1C;;;;;;;IAQD,8DAA6B,GAA7B,UAA8B,uBAAgD;QAC1E,IAAI,CAAC,UAAU,GAAG,uBAAuB,CAAC,WAAW,CAAC;QACtD,IAAI,CAAC,YAAY,GAAG,uBAAuB,CAAC,aAAa,CAAC;QAC1D,IAAI,CAAC,aAAa,GAAG,uBAAuB,CAAC,cAAc,CAAC;KAC/D;;;;IAKD,gDAAe,GAAf,UAAgB,YAA0B;QACtC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAC;KACpC;IACL,6BAAC;AAAD,CAAC;;;;"}
|
package/dist/url/UrlString.d.ts
CHANGED
|
@@ -22,6 +22,16 @@ export declare class UrlString {
|
|
|
22
22
|
* @param name
|
|
23
23
|
*/
|
|
24
24
|
urlRemoveQueryStringParameter(name: string): string;
|
|
25
|
+
/**
|
|
26
|
+
* Given a url and a query string return the url with provided query string appended
|
|
27
|
+
* @param url
|
|
28
|
+
* @param queryString
|
|
29
|
+
*/
|
|
30
|
+
static appendQueryString(url: string, queryString: string): string;
|
|
31
|
+
/**
|
|
32
|
+
* Returns a url with the hash removed
|
|
33
|
+
* @param url
|
|
34
|
+
*/
|
|
25
35
|
static removeHashFromUrl(url: string): string;
|
|
26
36
|
/**
|
|
27
37
|
* Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UrlString.d.ts","sourceRoot":"","sources":["../../src/url/UrlString.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAI9F,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;GAEG;AACH,qBAAa,SAAS;IAGlB,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,IAAI,MAAM,CAE7B;gBAEW,GAAG,EAAE,MAAM;IAYvB;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;
|
|
1
|
+
{"version":3,"file":"UrlString.d.ts","sourceRoot":"","sources":["../../src/url/UrlString.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,+BAA+B,EAAE,MAAM,6CAA6C,CAAC;AAI9F,OAAO,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAC;AAG9B;;GAEG;AACH,qBAAa,SAAS;IAGlB,OAAO,CAAC,UAAU,CAAS;IAC3B,IAAW,SAAS,IAAI,MAAM,CAE7B;gBAEW,GAAG,EAAE,MAAM;IAYvB;;;OAGG;IACH,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAoB3C;;OAEG;IACH,aAAa,IAAI,IAAI;IAoBrB;;;;OAIG;IACH,6BAA6B,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAYnD;;;;OAIG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,MAAM;IAQlE;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAI7C;;;;OAIG;IACH,iBAAiB,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS;IAS9C;;OAEG;IACH,OAAO,IAAI,MAAM;IAIjB;;;OAGG;IACH,gBAAgB,IAAI,IAAI;IA4BxB,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAY5C,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM;IAWnE;;;OAGG;IACH,MAAM,CAAC,SAAS,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM;IAW5C,MAAM,CAAC,+BAA+B,CAAC,SAAS,EAAE,IAAI,GAAG,SAAS;IAIlE;;OAEG;IACH,MAAM,CAAC,mBAAmB,CAAC,IAAI,EAAE,MAAM,GAAG,+BAA+B;IAgBzE;;OAEG;IACH,MAAM,CAAC,2BAA2B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO;CAa5D"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { ClientConfigurationError } from '../error/ClientConfigurationError.js';
|
|
4
|
+
import { ClientAuthError } from '../error/ClientAuthError.js';
|
|
5
|
+
import { StringUtils } from '../utils/StringUtils.js';
|
|
6
|
+
import { AADAuthorityConstants, Constants } from '../utils/Constants.js';
|
|
7
|
+
|
|
8
|
+
/*
|
|
9
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
+
* Licensed under the MIT License.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Url object class which can perform various transformations on url strings.
|
|
14
|
+
*/
|
|
15
|
+
var UrlString = /** @class */ (function () {
|
|
16
|
+
function UrlString(url) {
|
|
17
|
+
this._urlString = url;
|
|
18
|
+
if (StringUtils.isEmpty(this._urlString)) {
|
|
19
|
+
// Throws error if url is empty
|
|
20
|
+
throw ClientConfigurationError.createUrlEmptyError();
|
|
21
|
+
}
|
|
22
|
+
if (StringUtils.isEmpty(this.getHash())) {
|
|
23
|
+
this._urlString = UrlString.canonicalizeUri(url);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
Object.defineProperty(UrlString.prototype, "urlString", {
|
|
27
|
+
get: function () {
|
|
28
|
+
return this._urlString;
|
|
29
|
+
},
|
|
30
|
+
enumerable: false,
|
|
31
|
+
configurable: true
|
|
32
|
+
});
|
|
33
|
+
/**
|
|
34
|
+
* Ensure urls are lower case and end with a / character.
|
|
35
|
+
* @param url
|
|
36
|
+
*/
|
|
37
|
+
UrlString.canonicalizeUri = function (url) {
|
|
38
|
+
if (url) {
|
|
39
|
+
var lowerCaseUrl = url.toLowerCase();
|
|
40
|
+
if (StringUtils.endsWith(lowerCaseUrl, "?")) {
|
|
41
|
+
lowerCaseUrl = lowerCaseUrl.slice(0, -1);
|
|
42
|
+
}
|
|
43
|
+
else if (StringUtils.endsWith(lowerCaseUrl, "?/")) {
|
|
44
|
+
lowerCaseUrl = lowerCaseUrl.slice(0, -2);
|
|
45
|
+
}
|
|
46
|
+
if (!StringUtils.endsWith(lowerCaseUrl, "/")) {
|
|
47
|
+
lowerCaseUrl += "/";
|
|
48
|
+
}
|
|
49
|
+
return lowerCaseUrl;
|
|
50
|
+
}
|
|
51
|
+
return url;
|
|
52
|
+
};
|
|
53
|
+
/**
|
|
54
|
+
* Throws if urlString passed is not a valid authority URI string.
|
|
55
|
+
*/
|
|
56
|
+
UrlString.prototype.validateAsUri = function () {
|
|
57
|
+
// Attempts to parse url for uri components
|
|
58
|
+
var components;
|
|
59
|
+
try {
|
|
60
|
+
components = this.getUrlComponents();
|
|
61
|
+
}
|
|
62
|
+
catch (e) {
|
|
63
|
+
throw ClientConfigurationError.createUrlParseError(e);
|
|
64
|
+
}
|
|
65
|
+
// Throw error if URI or path segments are not parseable.
|
|
66
|
+
if (!components.HostNameAndPort || !components.PathSegments) {
|
|
67
|
+
throw ClientConfigurationError.createUrlParseError("Given url string: " + this.urlString);
|
|
68
|
+
}
|
|
69
|
+
// Throw error if uri is insecure.
|
|
70
|
+
if (!components.Protocol || components.Protocol.toLowerCase() !== "https:") {
|
|
71
|
+
throw ClientConfigurationError.createInsecureAuthorityUriError(this.urlString);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
/**
|
|
75
|
+
* Function to remove query string params from url. Returns the new url.
|
|
76
|
+
* @param url
|
|
77
|
+
* @param name
|
|
78
|
+
*/
|
|
79
|
+
UrlString.prototype.urlRemoveQueryStringParameter = function (name) {
|
|
80
|
+
var regex = new RegExp("(\\&" + name + "=)[^\&]+");
|
|
81
|
+
this._urlString = this.urlString.replace(regex, "");
|
|
82
|
+
// name=value&
|
|
83
|
+
regex = new RegExp("(" + name + "=)[^\&]+&");
|
|
84
|
+
this._urlString = this.urlString.replace(regex, "");
|
|
85
|
+
// name=value
|
|
86
|
+
regex = new RegExp("(" + name + "=)[^\&]+");
|
|
87
|
+
this._urlString = this.urlString.replace(regex, "");
|
|
88
|
+
return this.urlString;
|
|
89
|
+
};
|
|
90
|
+
/**
|
|
91
|
+
* Given a url and a query string return the url with provided query string appended
|
|
92
|
+
* @param url
|
|
93
|
+
* @param queryString
|
|
94
|
+
*/
|
|
95
|
+
UrlString.appendQueryString = function (url, queryString) {
|
|
96
|
+
if (StringUtils.isEmpty(queryString)) {
|
|
97
|
+
return url;
|
|
98
|
+
}
|
|
99
|
+
return url.indexOf("?") < 0 ? url + "?" + queryString : url + "&" + queryString;
|
|
100
|
+
};
|
|
101
|
+
/**
|
|
102
|
+
* Returns a url with the hash removed
|
|
103
|
+
* @param url
|
|
104
|
+
*/
|
|
105
|
+
UrlString.removeHashFromUrl = function (url) {
|
|
106
|
+
return UrlString.canonicalizeUri(url.split("#")[0]);
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d
|
|
110
|
+
* @param href The url
|
|
111
|
+
* @param tenantId The tenant id to replace
|
|
112
|
+
*/
|
|
113
|
+
UrlString.prototype.replaceTenantPath = function (tenantId) {
|
|
114
|
+
var urlObject = this.getUrlComponents();
|
|
115
|
+
var pathArray = urlObject.PathSegments;
|
|
116
|
+
if (tenantId && (pathArray.length !== 0 && (pathArray[0] === AADAuthorityConstants.COMMON || pathArray[0] === AADAuthorityConstants.ORGANIZATIONS))) {
|
|
117
|
+
pathArray[0] = tenantId;
|
|
118
|
+
}
|
|
119
|
+
return UrlString.constructAuthorityUriFromObject(urlObject);
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Returns the anchor part(#) of the URL
|
|
123
|
+
*/
|
|
124
|
+
UrlString.prototype.getHash = function () {
|
|
125
|
+
return UrlString.parseHash(this.urlString);
|
|
126
|
+
};
|
|
127
|
+
/**
|
|
128
|
+
* Parses out the components from a url string.
|
|
129
|
+
* @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.
|
|
130
|
+
*/
|
|
131
|
+
UrlString.prototype.getUrlComponents = function () {
|
|
132
|
+
// https://gist.github.com/curtisz/11139b2cfcaef4a261e0
|
|
133
|
+
var regEx = RegExp("^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\?([^#]*))?(#(.*))?");
|
|
134
|
+
// If url string does not match regEx, we throw an error
|
|
135
|
+
var match = this.urlString.match(regEx);
|
|
136
|
+
if (!match) {
|
|
137
|
+
throw ClientConfigurationError.createUrlParseError("Given url string: " + this.urlString);
|
|
138
|
+
}
|
|
139
|
+
// Url component object
|
|
140
|
+
var urlComponents = {
|
|
141
|
+
Protocol: match[1],
|
|
142
|
+
HostNameAndPort: match[4],
|
|
143
|
+
AbsolutePath: match[5],
|
|
144
|
+
QueryString: match[7]
|
|
145
|
+
};
|
|
146
|
+
var pathSegments = urlComponents.AbsolutePath.split("/");
|
|
147
|
+
pathSegments = pathSegments.filter(function (val) { return val && val.length > 0; }); // remove empty elements
|
|
148
|
+
urlComponents.PathSegments = pathSegments;
|
|
149
|
+
if (!StringUtils.isEmpty(urlComponents.QueryString) && urlComponents.QueryString.endsWith("/")) {
|
|
150
|
+
urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length - 1);
|
|
151
|
+
}
|
|
152
|
+
return urlComponents;
|
|
153
|
+
};
|
|
154
|
+
UrlString.getDomainFromUrl = function (url) {
|
|
155
|
+
var regEx = RegExp("^([^:/?#]+://)?([^/?#]*)");
|
|
156
|
+
var match = url.match(regEx);
|
|
157
|
+
if (!match) {
|
|
158
|
+
throw ClientConfigurationError.createUrlParseError("Given url string: " + url);
|
|
159
|
+
}
|
|
160
|
+
return match[2];
|
|
161
|
+
};
|
|
162
|
+
UrlString.getAbsoluteUrl = function (relativeUrl, baseUrl) {
|
|
163
|
+
if (relativeUrl[0] === Constants.FORWARD_SLASH) {
|
|
164
|
+
var url = new UrlString(baseUrl);
|
|
165
|
+
var baseComponents = url.getUrlComponents();
|
|
166
|
+
return baseComponents.Protocol + "//" + baseComponents.HostNameAndPort + relativeUrl;
|
|
167
|
+
}
|
|
168
|
+
return relativeUrl;
|
|
169
|
+
};
|
|
170
|
+
/**
|
|
171
|
+
* Parses hash string from given string. Returns empty string if no hash symbol is found.
|
|
172
|
+
* @param hashString
|
|
173
|
+
*/
|
|
174
|
+
UrlString.parseHash = function (hashString) {
|
|
175
|
+
var hashIndex1 = hashString.indexOf("#");
|
|
176
|
+
var hashIndex2 = hashString.indexOf("#/");
|
|
177
|
+
if (hashIndex2 > -1) {
|
|
178
|
+
return hashString.substring(hashIndex2 + 2);
|
|
179
|
+
}
|
|
180
|
+
else if (hashIndex1 > -1) {
|
|
181
|
+
return hashString.substring(hashIndex1 + 1);
|
|
182
|
+
}
|
|
183
|
+
return "";
|
|
184
|
+
};
|
|
185
|
+
UrlString.constructAuthorityUriFromObject = function (urlObject) {
|
|
186
|
+
return new UrlString(urlObject.Protocol + "//" + urlObject.HostNameAndPort + "/" + urlObject.PathSegments.join("/"));
|
|
187
|
+
};
|
|
188
|
+
/**
|
|
189
|
+
* Returns URL hash as server auth code response object.
|
|
190
|
+
*/
|
|
191
|
+
UrlString.getDeserializedHash = function (hash) {
|
|
192
|
+
// Check if given hash is empty
|
|
193
|
+
if (StringUtils.isEmpty(hash)) {
|
|
194
|
+
return {};
|
|
195
|
+
}
|
|
196
|
+
// Strip the # symbol if present
|
|
197
|
+
var parsedHash = UrlString.parseHash(hash);
|
|
198
|
+
// If # symbol was not present, above will return empty string, so give original hash value
|
|
199
|
+
var deserializedHash = StringUtils.queryStringToObject(StringUtils.isEmpty(parsedHash) ? hash : parsedHash);
|
|
200
|
+
// Check if deserialization didn't work
|
|
201
|
+
if (!deserializedHash) {
|
|
202
|
+
throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedHash));
|
|
203
|
+
}
|
|
204
|
+
return deserializedHash;
|
|
205
|
+
};
|
|
206
|
+
/**
|
|
207
|
+
* Check if the hash of the URL string contains known properties
|
|
208
|
+
*/
|
|
209
|
+
UrlString.hashContainsKnownProperties = function (hash) {
|
|
210
|
+
if (StringUtils.isEmpty(hash)) {
|
|
211
|
+
return false;
|
|
212
|
+
}
|
|
213
|
+
var parameters = UrlString.getDeserializedHash(hash);
|
|
214
|
+
return !!(parameters.code ||
|
|
215
|
+
parameters.error_description ||
|
|
216
|
+
parameters.error ||
|
|
217
|
+
parameters.state);
|
|
218
|
+
};
|
|
219
|
+
return UrlString;
|
|
220
|
+
}());
|
|
221
|
+
|
|
222
|
+
export { UrlString };
|
|
223
|
+
//# sourceMappingURL=UrlString.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"UrlString.js","sources":["../../src/url/UrlString.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ServerAuthorizationCodeResponse } from \"../response/ServerAuthorizationCodeResponse\";\nimport { ClientConfigurationError } from \"../error/ClientConfigurationError\";\nimport { ClientAuthError } from \"../error/ClientAuthError\";\nimport { StringUtils } from \"../utils/StringUtils\";\nimport { IUri } from \"./IUri\";\nimport { AADAuthorityConstants, Constants } from \"../utils/Constants\";\n\n/**\n * Url object class which can perform various transformations on url strings.\n */\nexport class UrlString {\n\n // internal url string field\n private _urlString: string;\n public get urlString(): string {\n return this._urlString;\n }\n \n constructor(url: string) {\n this._urlString = url;\n if (StringUtils.isEmpty(this._urlString)) {\n // Throws error if url is empty\n throw ClientConfigurationError.createUrlEmptyError();\n }\n\n if (StringUtils.isEmpty(this.getHash())) {\n this._urlString = UrlString.canonicalizeUri(url);\n }\n }\n\n /**\n * Ensure urls are lower case and end with a / character.\n * @param url \n */\n static canonicalizeUri(url: string): string {\n if (url) {\n let lowerCaseUrl = url.toLowerCase();\n\n if (StringUtils.endsWith(lowerCaseUrl, \"?\")) {\n lowerCaseUrl = lowerCaseUrl.slice(0, -1);\n } else if (StringUtils.endsWith(lowerCaseUrl, \"?/\")) {\n lowerCaseUrl = lowerCaseUrl.slice(0, -2);\n }\n\n if (!StringUtils.endsWith(lowerCaseUrl, \"/\")) {\n lowerCaseUrl += \"/\";\n }\n\n return lowerCaseUrl;\n }\n\n return url;\n }\n\n /**\n * Throws if urlString passed is not a valid authority URI string.\n */\n validateAsUri(): void {\n // Attempts to parse url for uri components\n let components;\n try {\n components = this.getUrlComponents();\n } catch (e) {\n throw ClientConfigurationError.createUrlParseError(e);\n }\n\n // Throw error if URI or path segments are not parseable.\n if (!components.HostNameAndPort || !components.PathSegments) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${this.urlString}`);\n }\n\n // Throw error if uri is insecure.\n if(!components.Protocol || components.Protocol.toLowerCase() !== \"https:\") {\n throw ClientConfigurationError.createInsecureAuthorityUriError(this.urlString);\n }\n }\n\n /**\n * Function to remove query string params from url. Returns the new url.\n * @param url\n * @param name\n */\n urlRemoveQueryStringParameter(name: string): string {\n let regex = new RegExp(\"(\\\\&\" + name + \"=)[^\\&]+\");\n this._urlString = this.urlString.replace(regex, \"\");\n // name=value&\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+&\");\n this._urlString = this.urlString.replace(regex, \"\");\n // name=value\n regex = new RegExp(\"(\" + name + \"=)[^\\&]+\");\n this._urlString = this.urlString.replace(regex, \"\");\n return this.urlString;\n }\n\n /**\n * Given a url and a query string return the url with provided query string appended\n * @param url \n * @param queryString \n */\n static appendQueryString(url: string, queryString: string): string {\n if (StringUtils.isEmpty(queryString)) {\n return url;\n }\n\n return url.indexOf(\"?\") < 0 ? `${url}?${queryString}` : `${url}&${queryString}`;\n }\n\n /**\n * Returns a url with the hash removed\n * @param url \n */\n static removeHashFromUrl(url: string): string {\n return UrlString.canonicalizeUri(url.split(\"#\")[0]);\n }\n\n /**\n * Given a url like https://a:b/common/d?e=f#g, and a tenantId, returns https://a:b/tenantId/d\n * @param href The url\n * @param tenantId The tenant id to replace\n */\n replaceTenantPath(tenantId: string): UrlString {\n const urlObject = this.getUrlComponents();\n const pathArray = urlObject.PathSegments;\n if (tenantId && (pathArray.length !== 0 && (pathArray[0] === AADAuthorityConstants.COMMON || pathArray[0] === AADAuthorityConstants.ORGANIZATIONS))) {\n pathArray[0] = tenantId;\n }\n return UrlString.constructAuthorityUriFromObject(urlObject);\n }\n\n /**\n * Returns the anchor part(#) of the URL\n */\n getHash(): string {\n return UrlString.parseHash(this.urlString);\n }\n\n /**\n * Parses out the components from a url string.\n * @returns An object with the various components. Please cache this value insted of calling this multiple times on the same url.\n */\n getUrlComponents(): IUri {\n // https://gist.github.com/curtisz/11139b2cfcaef4a261e0\n const regEx = RegExp(\"^(([^:/?#]+):)?(//([^/?#]*))?([^?#]*)(\\\\?([^#]*))?(#(.*))?\");\n\n // If url string does not match regEx, we throw an error\n const match = this.urlString.match(regEx);\n if (!match) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${this.urlString}`);\n }\n\n // Url component object\n const urlComponents = {\n Protocol: match[1],\n HostNameAndPort: match[4],\n AbsolutePath: match[5],\n QueryString: match[7]\n } as IUri;\n\n let pathSegments = urlComponents.AbsolutePath.split(\"/\");\n pathSegments = pathSegments.filter((val) => val && val.length > 0); // remove empty elements\n urlComponents.PathSegments = pathSegments;\n\n if (!StringUtils.isEmpty(urlComponents.QueryString) && urlComponents.QueryString.endsWith(\"/\")) {\n urlComponents.QueryString = urlComponents.QueryString.substring(0, urlComponents.QueryString.length-1);\n }\n return urlComponents;\n }\n\n static getDomainFromUrl(url: string): string {\n const regEx = RegExp(\"^([^:/?#]+://)?([^/?#]*)\");\n\n const match = url.match(regEx);\n\n if (!match) {\n throw ClientConfigurationError.createUrlParseError(`Given url string: ${url}`);\n }\n\n return match[2];\n }\n\n static getAbsoluteUrl(relativeUrl: string, baseUrl: string): string {\n if (relativeUrl[0] === Constants.FORWARD_SLASH) {\n const url = new UrlString(baseUrl);\n const baseComponents = url.getUrlComponents();\n\n return baseComponents.Protocol + \"//\" + baseComponents.HostNameAndPort + relativeUrl;\n }\n \n return relativeUrl;\n }\n \n /**\n * Parses hash string from given string. Returns empty string if no hash symbol is found.\n * @param hashString \n */\n static parseHash(hashString: string): string {\n const hashIndex1 = hashString.indexOf(\"#\");\n const hashIndex2 = hashString.indexOf(\"#/\");\n if (hashIndex2 > -1) {\n return hashString.substring(hashIndex2 + 2);\n } else if (hashIndex1 > -1) {\n return hashString.substring(hashIndex1 + 1);\n }\n return \"\";\n }\n\n static constructAuthorityUriFromObject(urlObject: IUri): UrlString {\n return new UrlString(urlObject.Protocol + \"//\" + urlObject.HostNameAndPort + \"/\" + urlObject.PathSegments.join(\"/\"));\n }\n\n /**\n * Returns URL hash as server auth code response object.\n */\n static getDeserializedHash(hash: string): ServerAuthorizationCodeResponse {\n // Check if given hash is empty\n if (StringUtils.isEmpty(hash)) {\n return {};\n }\n // Strip the # symbol if present\n const parsedHash = UrlString.parseHash(hash);\n // If # symbol was not present, above will return empty string, so give original hash value\n const deserializedHash: ServerAuthorizationCodeResponse = StringUtils.queryStringToObject<ServerAuthorizationCodeResponse>(StringUtils.isEmpty(parsedHash) ? hash : parsedHash);\n // Check if deserialization didn't work\n if (!deserializedHash) {\n throw ClientAuthError.createHashNotDeserializedError(JSON.stringify(deserializedHash));\n }\n return deserializedHash;\n }\n\n /**\n * Check if the hash of the URL string contains known properties\n */\n static hashContainsKnownProperties(hash: string): boolean {\n if (StringUtils.isEmpty(hash)) {\n return false;\n }\n\n const parameters: ServerAuthorizationCodeResponse = UrlString.getDeserializedHash(hash);\n return !!(\n parameters.code ||\n parameters.error_description ||\n parameters.error ||\n parameters.state\n );\n }\n}\n"],"names":[],"mappings":";;;;;;;AAAA;;;;AAYA;;;;IAWI,mBAAY,GAAW;QACnB,IAAI,CAAC,UAAU,GAAG,GAAG,CAAC;QACtB,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,UAAU,CAAC,EAAE;;YAEtC,MAAM,wBAAwB,CAAC,mBAAmB,EAAE,CAAC;SACxD;QAED,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,EAAE;YACrC,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,eAAe,CAAC,GAAG,CAAC,CAAC;SACpD;KACJ;IAdD,sBAAW,gCAAS;aAApB;YACI,OAAO,IAAI,CAAC,UAAU,CAAC;SAC1B;;;OAAA;;;;;IAkBM,yBAAe,GAAtB,UAAuB,GAAW;QAC9B,IAAI,GAAG,EAAE;YACL,IAAI,YAAY,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;YAErC,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE;gBACzC,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aAC5C;iBAAM,IAAI,WAAW,CAAC,QAAQ,CAAC,YAAY,EAAE,IAAI,CAAC,EAAE;gBACjD,YAAY,GAAG,YAAY,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;aAC5C;YAED,IAAI,CAAC,WAAW,CAAC,QAAQ,CAAC,YAAY,EAAE,GAAG,CAAC,EAAE;gBAC1C,YAAY,IAAI,GAAG,CAAC;aACvB;YAED,OAAO,YAAY,CAAC;SACvB;QAED,OAAO,GAAG,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,gBAAgB,CAAC;KAC3B;;;;IAKM,qCAA2B,GAAlC,UAAmC,IAAY;QAC3C,IAAI,WAAW,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE;YAC3B,OAAO,KAAK,CAAC;SAChB;QAED,IAAM,UAAU,GAAoC,SAAS,CAAC,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACxF,OAAO,CAAC,EACJ,UAAU,CAAC,IAAI;YACf,UAAU,CAAC,iBAAiB;YAC5B,UAAU,CAAC,KAAK;YAChB,UAAU,CAAC,KAAK,CACnB,CAAC;KACL;IACL,gBAAC;AAAD,CAAC;;;;"}
|
|
@@ -24,6 +24,12 @@ export declare const Constants: {
|
|
|
24
24
|
NOT_DEFINED: string;
|
|
25
25
|
EMPTY_STRING: string;
|
|
26
26
|
FORWARD_SLASH: string;
|
|
27
|
+
IMDS_ENDPOINT: string;
|
|
28
|
+
IMDS_VERSION: string;
|
|
29
|
+
IMDS_TIMEOUT: number;
|
|
30
|
+
AZURE_REGION_AUTO_DISCOVER_FLAG: string;
|
|
31
|
+
REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX: string;
|
|
32
|
+
KNOWN_PUBLIC_CLOUDS: string[];
|
|
27
33
|
};
|
|
28
34
|
export declare const OIDC_DEFAULT_SCOPES: string[];
|
|
29
35
|
export declare const OIDC_SCOPES: string[];
|
|
@@ -32,7 +38,8 @@ export declare const OIDC_SCOPES: string[];
|
|
|
32
38
|
*/
|
|
33
39
|
export declare enum HeaderNames {
|
|
34
40
|
CONTENT_TYPE = "Content-Type",
|
|
35
|
-
RETRY_AFTER = "Retry-After"
|
|
41
|
+
RETRY_AFTER = "Retry-After",
|
|
42
|
+
CCS_HEADER = "X-AnchorMailbox"
|
|
36
43
|
}
|
|
37
44
|
/**
|
|
38
45
|
* Persistent cache keys MSAL which stay while user is logged in.
|
|
@@ -42,7 +49,8 @@ export declare enum PersistentCacheKeys {
|
|
|
42
49
|
CLIENT_INFO = "client.info",
|
|
43
50
|
ADAL_ID_TOKEN = "adal.idtoken",
|
|
44
51
|
ERROR = "error",
|
|
45
|
-
ERROR_DESC = "error.description"
|
|
52
|
+
ERROR_DESC = "error.description",
|
|
53
|
+
ACTIVE_ACCOUNT = "active-account"
|
|
46
54
|
}
|
|
47
55
|
/**
|
|
48
56
|
* String constants related to AAD Authority
|
|
@@ -97,7 +105,8 @@ export declare enum AADServerParamKeys {
|
|
|
97
105
|
OBO_ASSERTION = "assertion",
|
|
98
106
|
REQUESTED_TOKEN_USE = "requested_token_use",
|
|
99
107
|
ON_BEHALF_OF = "on_behalf_of",
|
|
100
|
-
FOCI = "foci"
|
|
108
|
+
FOCI = "foci",
|
|
109
|
+
CCS_HEADER = "X-AnchorMailbox"
|
|
101
110
|
}
|
|
102
111
|
/**
|
|
103
112
|
* Claims request keys
|
|
@@ -116,6 +125,7 @@ export declare const PromptValue: {
|
|
|
116
125
|
SELECT_ACCOUNT: string;
|
|
117
126
|
CONSENT: string;
|
|
118
127
|
NONE: string;
|
|
128
|
+
CREATE: string;
|
|
119
129
|
};
|
|
120
130
|
/**
|
|
121
131
|
* SSO Types - generated to populate hints
|
|
@@ -226,7 +236,7 @@ export declare enum CacheType {
|
|
|
226
236
|
* More Cache related constants
|
|
227
237
|
*/
|
|
228
238
|
export declare const APP_METADATA = "appmetadata";
|
|
229
|
-
export declare const
|
|
239
|
+
export declare const CLIENT_INFO = "client_info";
|
|
230
240
|
export declare const THE_FAMILY_ID = "1";
|
|
231
241
|
export declare const AUTHORITY_METADATA_CONSTANTS: {
|
|
232
242
|
CACHE_KEY: string;
|
|
@@ -276,4 +286,37 @@ export declare enum PasswordGrantConstants {
|
|
|
276
286
|
username = "username",
|
|
277
287
|
password = "password"
|
|
278
288
|
}
|
|
289
|
+
/**
|
|
290
|
+
* Response codes
|
|
291
|
+
*/
|
|
292
|
+
export declare enum ResponseCodes {
|
|
293
|
+
httpSuccess = 200,
|
|
294
|
+
httpBadRequest = 400
|
|
295
|
+
}
|
|
296
|
+
/**
|
|
297
|
+
* Region Discovery Sources
|
|
298
|
+
*/
|
|
299
|
+
export declare enum RegionDiscoverySources {
|
|
300
|
+
FAILED_AUTO_DETECTION = "1",
|
|
301
|
+
INTERNAL_CACHE = "2",
|
|
302
|
+
ENVIRONMENT_VARIABLE = "3",
|
|
303
|
+
IMDS = "4"
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Region Discovery Outcomes
|
|
307
|
+
*/
|
|
308
|
+
export declare enum RegionDiscoveryOutcomes {
|
|
309
|
+
CONFIGURED_MATCHES_DETECTED = "1",
|
|
310
|
+
CONFIGURED_NO_AUTO_DETECTION = "2",
|
|
311
|
+
CONFIGURED_NOT_DETECTED = "3",
|
|
312
|
+
AUTO_DETECTION_REQUESTED_SUCCESSFUL = "4",
|
|
313
|
+
AUTO_DETECTION_REQUESTED_FAILED = "5"
|
|
314
|
+
}
|
|
315
|
+
export declare enum CacheOutcome {
|
|
316
|
+
NO_CACHE_HIT = "0",
|
|
317
|
+
FORCE_REFRESH = "1",
|
|
318
|
+
NO_CACHED_ACCESS_TOKEN = "2",
|
|
319
|
+
CACHED_ACCESS_TOKEN_EXPIRED = "3",
|
|
320
|
+
REFRESH_CACHED_ACCESS_TOKEN = "4"
|
|
321
|
+
}
|
|
279
322
|
//# sourceMappingURL=Constants.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../src/utils/Constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS
|
|
1
|
+
{"version":3,"file":"Constants.d.ts","sourceRoot":"","sources":["../../src/utils/Constants.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA0CrB,CAAC;AAEF,eAAO,MAAM,mBAAmB,UAI/B,CAAC;AAEF,eAAO,MAAM,WAAW,UAGvB,CAAC;AAEF;;GAEG;AACH,oBAAY,WAAW;IACnB,YAAY,iBAAiB;IAC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