@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
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AppMetadataEntity.js","sources":["../../../src/cache/entities/AppMetadataEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { APP_METADATA, Separators } from \"../../utils/Constants\";\n\n/**\n * APP_METADATA Cache\n *\n * Key:Value Schema:\n *\n * Key: appmetadata-<environment>-<client_id>\n *\n * Value:\n * {\n * clientId: client ID of the application\n * environment: entity that issued the token, represented as a full host\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * }\n */\nexport class AppMetadataEntity {\n clientId: string;\n environment: string;\n familyId?: string;\n\n /**\n * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>\n */\n generateAppMetadataKey(): string {\n return AppMetadataEntity.generateAppMetadataCacheKey(this.environment, this.clientId);\n }\n\n /**\n * Generate AppMetadata Cache Key\n */\n static generateAppMetadataCacheKey(environment: string, clientId: string): string {\n const appMetaDataKeyArray: Array<string> = [\n APP_METADATA,\n environment,\n clientId,\n ];\n return appMetaDataKeyArray.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Creates AppMetadataEntity\n * @param clientId\n * @param environment\n * @param familyId\n */\n static createAppMetadataEntity(clientId: string, environment: string, familyId?: string): AppMetadataEntity {\n const appMetadata = new AppMetadataEntity();\n\n appMetadata.clientId = clientId;\n appMetadata.environment = environment;\n if (familyId) {\n appMetadata.familyId = familyId;\n }\n\n return appMetadata;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAppMetadataEntity(key: string, entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n key.indexOf(APP_METADATA) === 0 &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"environment\")\n );\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;AAOA;;;;;;;;;;;;;;;IAcA;KA0DC;;;;IAlDG,kDAAsB,GAAtB;QACI,OAAO,iBAAiB,CAAC,2BAA2B,CAAC,IAAI,CAAC,WAAW,EAAE,IAAI,CAAC,QAAQ,CAAC,CAAC;KACzF;;;;IAKM,6CAA2B,GAAlC,UAAmC,WAAmB,EAAE,QAAgB;QACpE,IAAM,mBAAmB,GAAkB;YACvC,YAAY;YACZ,WAAW;YACX,QAAQ;SACX,CAAC;QACF,OAAO,mBAAmB,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACjF;;;;;;;IAQM,yCAAuB,GAA9B,UAA+B,QAAgB,EAAE,WAAmB,EAAE,QAAiB;QACnF,IAAM,WAAW,GAAG,IAAI,iBAAiB,EAAE,CAAC;QAE5C,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAChC,WAAW,CAAC,WAAW,GAAG,WAAW,CAAC;QACtC,IAAI,QAAQ,EAAE;YACV,WAAW,CAAC,QAAQ,GAAG,QAAQ,CAAC;SACnC;QAED,OAAO,WAAW,CAAC;KACtB;;;;;IAMM,qCAAmB,GAA1B,UAA2B,GAAW,EAAE,MAAc;QAElD,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,QACI,GAAG,CAAC,OAAO,CAAC,YAAY,CAAC,KAAK,CAAC;YAC/B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC,EACtC;KACL;IACL,wBAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.js';
|
|
4
|
+
import { TimeUtils } from '../../utils/TimeUtils.js';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
|
+
* Licensed under the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
var AuthorityMetadataEntity = /** @class */ (function () {
|
|
11
|
+
function AuthorityMetadataEntity() {
|
|
12
|
+
this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Update the entity with new aliases, preferred_cache and preferred_network values
|
|
16
|
+
* @param metadata
|
|
17
|
+
* @param fromNetwork
|
|
18
|
+
*/
|
|
19
|
+
AuthorityMetadataEntity.prototype.updateCloudDiscoveryMetadata = function (metadata, fromNetwork) {
|
|
20
|
+
this.aliases = metadata.aliases;
|
|
21
|
+
this.preferred_cache = metadata.preferred_cache;
|
|
22
|
+
this.preferred_network = metadata.preferred_network;
|
|
23
|
+
this.aliasesFromNetwork = fromNetwork;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Update the entity with new endpoints
|
|
27
|
+
* @param metadata
|
|
28
|
+
* @param fromNetwork
|
|
29
|
+
*/
|
|
30
|
+
AuthorityMetadataEntity.prototype.updateEndpointMetadata = function (metadata, fromNetwork) {
|
|
31
|
+
this.authorization_endpoint = metadata.authorization_endpoint;
|
|
32
|
+
this.token_endpoint = metadata.token_endpoint;
|
|
33
|
+
this.end_session_endpoint = metadata.end_session_endpoint;
|
|
34
|
+
this.issuer = metadata.issuer;
|
|
35
|
+
this.endpointsFromNetwork = fromNetwork;
|
|
36
|
+
};
|
|
37
|
+
/**
|
|
38
|
+
* Save the authority that was used to create this cache entry
|
|
39
|
+
* @param authority
|
|
40
|
+
*/
|
|
41
|
+
AuthorityMetadataEntity.prototype.updateCanonicalAuthority = function (authority) {
|
|
42
|
+
this.canonical_authority = authority;
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* Reset the exiresAt value
|
|
46
|
+
*/
|
|
47
|
+
AuthorityMetadataEntity.prototype.resetExpiresAt = function () {
|
|
48
|
+
this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* Returns whether or not the data needs to be refreshed
|
|
52
|
+
*/
|
|
53
|
+
AuthorityMetadataEntity.prototype.isExpired = function () {
|
|
54
|
+
return this.expiresAt <= TimeUtils.nowSeconds();
|
|
55
|
+
};
|
|
56
|
+
/**
|
|
57
|
+
* Validates an entity: checks for all expected params
|
|
58
|
+
* @param entity
|
|
59
|
+
*/
|
|
60
|
+
AuthorityMetadataEntity.isAuthorityMetadataEntity = function (key, entity) {
|
|
61
|
+
if (!entity) {
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
return (key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&
|
|
65
|
+
entity.hasOwnProperty("aliases") &&
|
|
66
|
+
entity.hasOwnProperty("preferred_cache") &&
|
|
67
|
+
entity.hasOwnProperty("preferred_network") &&
|
|
68
|
+
entity.hasOwnProperty("canonical_authority") &&
|
|
69
|
+
entity.hasOwnProperty("authorization_endpoint") &&
|
|
70
|
+
entity.hasOwnProperty("token_endpoint") &&
|
|
71
|
+
entity.hasOwnProperty("end_session_endpoint") &&
|
|
72
|
+
entity.hasOwnProperty("issuer") &&
|
|
73
|
+
entity.hasOwnProperty("aliasesFromNetwork") &&
|
|
74
|
+
entity.hasOwnProperty("endpointsFromNetwork") &&
|
|
75
|
+
entity.hasOwnProperty("expiresAt"));
|
|
76
|
+
};
|
|
77
|
+
return AuthorityMetadataEntity;
|
|
78
|
+
}());
|
|
79
|
+
|
|
80
|
+
export { AuthorityMetadataEntity };
|
|
81
|
+
//# sourceMappingURL=AuthorityMetadataEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthorityMetadataEntity.js","sources":["../../../src/cache/entities/AuthorityMetadataEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CloudDiscoveryMetadata } from \"../../authority/CloudDiscoveryMetadata\";\nimport { OpenIdConfigResponse } from \"../../authority/OpenIdConfigResponse\";\nimport { AUTHORITY_METADATA_CONSTANTS } from \"../../utils/Constants\";\nimport { TimeUtils } from \"../../utils/TimeUtils\";\n\nexport class AuthorityMetadataEntity {\n aliases: Array<string>;\n preferred_cache: string;\n preferred_network: string;\n canonical_authority: string;\n authorization_endpoint: string;\n token_endpoint: string;\n end_session_endpoint: string;\n issuer: string;\n aliasesFromNetwork: boolean;\n endpointsFromNetwork: boolean;\n expiresAt: number;\n\n constructor() {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Update the entity with new aliases, preferred_cache and preferred_network values\n * @param metadata \n * @param fromNetwork \n */\n updateCloudDiscoveryMetadata(metadata: CloudDiscoveryMetadata, fromNetwork: boolean): void {\n this.aliases = metadata.aliases;\n this.preferred_cache = metadata.preferred_cache;\n this.preferred_network = metadata.preferred_network;\n this.aliasesFromNetwork = fromNetwork;\n }\n\n /**\n * Update the entity with new endpoints\n * @param metadata \n * @param fromNetwork \n */\n updateEndpointMetadata(metadata: OpenIdConfigResponse, fromNetwork: boolean): void {\n this.authorization_endpoint = metadata.authorization_endpoint;\n this.token_endpoint = metadata.token_endpoint;\n this.end_session_endpoint = metadata.end_session_endpoint;\n this.issuer = metadata.issuer;\n this.endpointsFromNetwork = fromNetwork;\n }\n\n /**\n * Save the authority that was used to create this cache entry\n * @param authority \n */\n updateCanonicalAuthority(authority: string): void {\n this.canonical_authority = authority;\n }\n\n /**\n * Reset the exiresAt value\n */\n resetExpiresAt(): void {\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\n }\n\n /**\n * Returns whether or not the data needs to be refreshed\n */\n isExpired(): boolean {\n return this.expiresAt <= TimeUtils.nowSeconds();\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAuthorityMetadataEntity(key: string, entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\n entity.hasOwnProperty(\"aliases\") &&\n entity.hasOwnProperty(\"preferred_cache\") &&\n entity.hasOwnProperty(\"preferred_network\") &&\n entity.hasOwnProperty(\"canonical_authority\") &&\n entity.hasOwnProperty(\"authorization_endpoint\") &&\n entity.hasOwnProperty(\"token_endpoint\") &&\n entity.hasOwnProperty(\"end_session_endpoint\") &&\n entity.hasOwnProperty(\"issuer\") &&\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\n entity.hasOwnProperty(\"expiresAt\")\n );\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;;IAuBI;QACI,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,GAAG,4BAA4B,CAAC,oBAAoB,CAAC;KAC/F;;;;;;IAOD,8DAA4B,GAA5B,UAA6B,QAAgC,EAAE,WAAoB;QAC/E,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,eAAe,GAAG,QAAQ,CAAC,eAAe,CAAC;QAChD,IAAI,CAAC,iBAAiB,GAAG,QAAQ,CAAC,iBAAiB,CAAC;QACpD,IAAI,CAAC,kBAAkB,GAAG,WAAW,CAAC;KACzC;;;;;;IAOD,wDAAsB,GAAtB,UAAuB,QAA8B,EAAE,WAAoB;QACvE,IAAI,CAAC,sBAAsB,GAAG,QAAQ,CAAC,sBAAsB,CAAC;QAC9D,IAAI,CAAC,cAAc,GAAG,QAAQ,CAAC,cAAc,CAAC;QAC9C,IAAI,CAAC,oBAAoB,GAAG,QAAQ,CAAC,oBAAoB,CAAC;QAC1D,IAAI,CAAC,MAAM,GAAG,QAAQ,CAAC,MAAM,CAAC;QAC9B,IAAI,CAAC,oBAAoB,GAAG,WAAW,CAAC;KAC3C;;;;;IAMD,0DAAwB,GAAxB,UAAyB,SAAiB;QACtC,IAAI,CAAC,mBAAmB,GAAG,SAAS,CAAC;KACxC;;;;IAKD,gDAAc,GAAd;QACI,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC,UAAU,EAAE,GAAG,4BAA4B,CAAC,oBAAoB,CAAC;KAC/F;;;;IAKD,2CAAS,GAAT;QACI,OAAO,IAAI,CAAC,SAAS,IAAI,SAAS,CAAC,UAAU,EAAE,CAAC;KACnD;;;;;IAMM,iDAAyB,GAAhC,UAAiC,GAAW,EAAE,MAAc;QAExD,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,QACI,GAAG,CAAC,OAAO,CAAC,4BAA4B,CAAC,SAAS,CAAC,KAAK,CAAC;YACzD,MAAM,CAAC,cAAc,CAAC,SAAS,CAAC;YAChC,MAAM,CAAC,cAAc,CAAC,iBAAiB,CAAC;YACxC,MAAM,CAAC,cAAc,CAAC,mBAAmB,CAAC;YAC1C,MAAM,CAAC,cAAc,CAAC,qBAAqB,CAAC;YAC5C,MAAM,CAAC,cAAc,CAAC,wBAAwB,CAAC;YAC/C,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,sBAAsB,CAAC;YAC7C,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,cAAc,CAAC,oBAAoB,CAAC;YAC3C,MAAM,CAAC,cAAc,CAAC,sBAAsB,CAAC;YAC7C,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,EACpC;KACL;IACL,8BAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
var CacheRecord = /** @class */ (function () {
|
|
8
|
+
function CacheRecord(accountEntity, idTokenEntity, accessTokenEntity, refreshTokenEntity, appMetadataEntity) {
|
|
9
|
+
this.account = accountEntity || null;
|
|
10
|
+
this.idToken = idTokenEntity || null;
|
|
11
|
+
this.accessToken = accessTokenEntity || null;
|
|
12
|
+
this.refreshToken = refreshTokenEntity || null;
|
|
13
|
+
this.appMetadata = appMetadataEntity || null;
|
|
14
|
+
}
|
|
15
|
+
return CacheRecord;
|
|
16
|
+
}());
|
|
17
|
+
|
|
18
|
+
export { CacheRecord };
|
|
19
|
+
//# sourceMappingURL=CacheRecord.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CacheRecord.js","sources":["../../../src/cache/entities/CacheRecord.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { IdTokenEntity } from \"./IdTokenEntity\";\nimport { AccessTokenEntity } from \"./AccessTokenEntity\";\nimport { RefreshTokenEntity } from \"./RefreshTokenEntity\";\nimport { AccountEntity } from \"./AccountEntity\";\nimport { AppMetadataEntity } from \"./AppMetadataEntity\";\n\nexport class CacheRecord {\n account: AccountEntity | null;\n idToken: IdTokenEntity | null;\n accessToken: AccessTokenEntity | null;\n refreshToken: RefreshTokenEntity | null;\n appMetadata: AppMetadataEntity | null;\n\n constructor(accountEntity?: AccountEntity | null, idTokenEntity?: IdTokenEntity | null, accessTokenEntity?: AccessTokenEntity | null, refreshTokenEntity?: RefreshTokenEntity | null, appMetadataEntity?: AppMetadataEntity | null) {\n this.account = accountEntity || null;\n this.idToken = idTokenEntity || null;\n this.accessToken = accessTokenEntity || null;\n this.refreshToken = refreshTokenEntity || null;\n this.appMetadata = appMetadataEntity || null;\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;;IAkBI,qBAAY,aAAoC,EAAE,aAAoC,EAAE,iBAA4C,EAAE,kBAA8C,EAAE,iBAA4C;QAC9N,IAAI,CAAC,OAAO,GAAG,aAAa,IAAI,IAAI,CAAC;QACrC,IAAI,CAAC,OAAO,GAAG,aAAa,IAAI,IAAI,CAAC;QACrC,IAAI,CAAC,WAAW,GAAG,iBAAiB,IAAI,IAAI,CAAC;QAC7C,IAAI,CAAC,YAAY,GAAG,kBAAkB,IAAI,IAAI,CAAC;QAC/C,IAAI,CAAC,WAAW,GAAG,iBAAiB,IAAI,IAAI,CAAC;KAChD;IACL,kBAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { CredentialType, CacheType, Constants, Separators } from '../../utils/Constants.js';
|
|
4
|
+
import { ClientAuthError } from '../../error/ClientAuthError.js';
|
|
5
|
+
|
|
6
|
+
/*
|
|
7
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
8
|
+
* Licensed under the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
/**
|
|
11
|
+
* Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
|
|
12
|
+
*
|
|
13
|
+
* Key:Value Schema:
|
|
14
|
+
*
|
|
15
|
+
* Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>
|
|
16
|
+
*
|
|
17
|
+
* Value Schema:
|
|
18
|
+
* {
|
|
19
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
20
|
+
* environment: entity that issued the token, represented as a full host
|
|
21
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
22
|
+
* clientId: client ID of the application
|
|
23
|
+
* secret: Actual credential as a string
|
|
24
|
+
* familyId: Family ID identifier, usually only used for refresh tokens
|
|
25
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
26
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
27
|
+
* oboAssertion: access token passed in as part of OBO request
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
var CredentialEntity = /** @class */ (function () {
|
|
31
|
+
function CredentialEntity() {
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Generate Account Id key component as per the schema: <home_account_id>-<environment>
|
|
35
|
+
*/
|
|
36
|
+
CredentialEntity.prototype.generateAccountId = function () {
|
|
37
|
+
return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);
|
|
38
|
+
};
|
|
39
|
+
/**
|
|
40
|
+
* Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>
|
|
41
|
+
*/
|
|
42
|
+
CredentialEntity.prototype.generateCredentialId = function () {
|
|
43
|
+
return CredentialEntity.generateCredentialIdForCacheKey(this.credentialType, this.clientId, this.realm, this.familyId);
|
|
44
|
+
};
|
|
45
|
+
/**
|
|
46
|
+
* Generate target key component as per schema: <target>
|
|
47
|
+
*/
|
|
48
|
+
CredentialEntity.prototype.generateTarget = function () {
|
|
49
|
+
return CredentialEntity.generateTargetForCacheKey(this.target);
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* generates credential key
|
|
53
|
+
*/
|
|
54
|
+
CredentialEntity.prototype.generateCredentialKey = function () {
|
|
55
|
+
return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId);
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* returns the type of the cache (in this case credential)
|
|
59
|
+
*/
|
|
60
|
+
CredentialEntity.prototype.generateType = function () {
|
|
61
|
+
switch (this.credentialType) {
|
|
62
|
+
case CredentialType.ID_TOKEN:
|
|
63
|
+
return CacheType.ID_TOKEN;
|
|
64
|
+
case CredentialType.ACCESS_TOKEN:
|
|
65
|
+
return CacheType.ACCESS_TOKEN;
|
|
66
|
+
case CredentialType.REFRESH_TOKEN:
|
|
67
|
+
return CacheType.REFRESH_TOKEN;
|
|
68
|
+
default: {
|
|
69
|
+
throw ClientAuthError.createUnexpectedCredentialTypeError();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
/**
|
|
74
|
+
* helper function to return `CredentialType`
|
|
75
|
+
* @param key
|
|
76
|
+
*/
|
|
77
|
+
CredentialEntity.getCredentialType = function (key) {
|
|
78
|
+
// First keyword search will match all "AccessToken" and "AccessToken_With_AuthScheme" credentials
|
|
79
|
+
if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {
|
|
80
|
+
// Perform second search to differentiate between "AccessToken" and "AccessToken_With_AuthScheme" credential types
|
|
81
|
+
if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {
|
|
82
|
+
return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;
|
|
83
|
+
}
|
|
84
|
+
return CredentialType.ACCESS_TOKEN;
|
|
85
|
+
}
|
|
86
|
+
else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {
|
|
87
|
+
return CredentialType.ID_TOKEN;
|
|
88
|
+
}
|
|
89
|
+
else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {
|
|
90
|
+
return CredentialType.REFRESH_TOKEN;
|
|
91
|
+
}
|
|
92
|
+
return Constants.NOT_DEFINED;
|
|
93
|
+
};
|
|
94
|
+
/**
|
|
95
|
+
* generates credential key
|
|
96
|
+
*/
|
|
97
|
+
CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId) {
|
|
98
|
+
var credentialKey = [
|
|
99
|
+
this.generateAccountIdForCacheKey(homeAccountId, environment),
|
|
100
|
+
this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
|
|
101
|
+
this.generateTargetForCacheKey(target),
|
|
102
|
+
];
|
|
103
|
+
return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
104
|
+
};
|
|
105
|
+
/**
|
|
106
|
+
* generates Account Id for keys
|
|
107
|
+
* @param homeAccountId
|
|
108
|
+
* @param environment
|
|
109
|
+
*/
|
|
110
|
+
CredentialEntity.generateAccountIdForCacheKey = function (homeAccountId, environment) {
|
|
111
|
+
var accountId = [homeAccountId, environment];
|
|
112
|
+
return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
113
|
+
};
|
|
114
|
+
/**
|
|
115
|
+
* Generates Credential Id for keys
|
|
116
|
+
* @param credentialType
|
|
117
|
+
* @param realm
|
|
118
|
+
* @param clientId
|
|
119
|
+
* @param familyId
|
|
120
|
+
*/
|
|
121
|
+
CredentialEntity.generateCredentialIdForCacheKey = function (credentialType, clientId, realm, familyId) {
|
|
122
|
+
var clientOrFamilyId = credentialType === CredentialType.REFRESH_TOKEN
|
|
123
|
+
? familyId || clientId
|
|
124
|
+
: clientId;
|
|
125
|
+
var credentialId = [
|
|
126
|
+
credentialType,
|
|
127
|
+
clientOrFamilyId,
|
|
128
|
+
realm || "",
|
|
129
|
+
];
|
|
130
|
+
return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
|
|
131
|
+
};
|
|
132
|
+
/**
|
|
133
|
+
* Generate target key component as per schema: <target>
|
|
134
|
+
*/
|
|
135
|
+
CredentialEntity.generateTargetForCacheKey = function (scopes) {
|
|
136
|
+
return (scopes || "").toLowerCase();
|
|
137
|
+
};
|
|
138
|
+
return CredentialEntity;
|
|
139
|
+
}());
|
|
140
|
+
|
|
141
|
+
export { CredentialEntity };
|
|
142
|
+
//# sourceMappingURL=CredentialEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { Separators, CredentialType, CacheType, Constants } from \"../../utils/Constants\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\n\n/**\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\n *\n * Key:Value Schema:\n *\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, usually only used for refresh tokens\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * oboAssertion: access token passed in as part of OBO request\n * }\n */\nexport class CredentialEntity {\n homeAccountId: string;\n environment: string;\n credentialType: CredentialType;\n clientId: string;\n secret: string;\n familyId?: string;\n realm?: string;\n target?: string;\n oboAssertion?: string;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\n }\n\n /**\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\n */\n generateCredentialId(): string {\n return CredentialEntity.generateCredentialIdForCacheKey(\n this.credentialType,\n this.clientId,\n this.realm,\n this.familyId\n );\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n generateTarget(): string {\n return CredentialEntity.generateTargetForCacheKey(this.target);\n }\n\n /**\n * generates credential key\n */\n generateCredentialKey(): string {\n return CredentialEntity.generateCredentialCacheKey(\n this.homeAccountId,\n this.environment,\n this.credentialType,\n this.clientId,\n this.realm,\n this.target,\n this.familyId\n );\n }\n\n /**\n * returns the type of the cache (in this case credential)\n */\n generateType(): number {\n switch (this.credentialType) {\n case CredentialType.ID_TOKEN:\n return CacheType.ID_TOKEN;\n case CredentialType.ACCESS_TOKEN:\n return CacheType.ACCESS_TOKEN;\n case CredentialType.REFRESH_TOKEN:\n return CacheType.REFRESH_TOKEN;\n default: {\n throw ClientAuthError.createUnexpectedCredentialTypeError();\n }\n }\n }\n\n /**\n * helper function to return `CredentialType`\n * @param key\n */\n static getCredentialType(key: string): string {\n // First keyword search will match all \"AccessToken\" and \"AccessToken_With_AuthScheme\" credentials\n if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {\n // Perform second search to differentiate between \"AccessToken\" and \"AccessToken_With_AuthScheme\" credential types\n if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {\n return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\n }\n return CredentialType.ACCESS_TOKEN;\n } else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.ID_TOKEN;\n } else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {\n return CredentialType.REFRESH_TOKEN;\n }\n\n return Constants.NOT_DEFINED;\n }\n\n /**\n * generates credential key\n */\n static generateCredentialCacheKey(\n homeAccountId: string,\n environment: string,\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n target?: string,\n familyId?: string\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target),\n ];\n\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * generates Account Id for keys\n * @param homeAccountId\n * @param environment\n */\n private static generateAccountIdForCacheKey(\n homeAccountId: string,\n environment: string\n ): string {\n const accountId: Array<string> = [homeAccountId, environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generates Credential Id for keys\n * @param credentialType\n * @param realm\n * @param clientId\n * @param familyId\n */\n private static generateCredentialIdForCacheKey(\n credentialType: CredentialType,\n clientId: string,\n realm?: string,\n familyId?: string\n ): string {\n const clientOrFamilyId =\n credentialType === CredentialType.REFRESH_TOKEN\n ? familyId || clientId\n : clientId;\n const credentialId: Array<string> = [\n credentialType,\n clientOrFamilyId,\n realm || \"\",\n ];\n\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate target key component as per schema: <target>\n */\n private static generateTargetForCacheKey(scopes?: string): string {\n return (scopes || \"\").toLowerCase();\n }\n}\n"],"names":[],"mappings":";;;;;AAAA;;;;AAQA;;;;;;;;;;;;;;;;;;;;;IAoBA;KA4JC;;;;IA9IG,4CAAiB,GAAjB;QACI,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KAC9F;;;;IAKD,+CAAoB,GAApB;QACI,OAAO,gBAAgB,CAAC,+BAA+B,CACnD,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,QAAQ,CAChB,CAAC;KACL;;;;IAKD,yCAAc,GAAd;QACI,OAAO,gBAAgB,CAAC,yBAAyB,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;KAClE;;;;IAKD,gDAAqB,GAArB;QACI,OAAO,gBAAgB,CAAC,0BAA0B,CAC9C,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,WAAW,EAChB,IAAI,CAAC,cAAc,EACnB,IAAI,CAAC,QAAQ,EACb,IAAI,CAAC,KAAK,EACV,IAAI,CAAC,MAAM,EACX,IAAI,CAAC,QAAQ,CAChB,CAAC;KACL;;;;IAKD,uCAAY,GAAZ;QACI,QAAQ,IAAI,CAAC,cAAc;YACvB,KAAK,cAAc,CAAC,QAAQ;gBACxB,OAAO,SAAS,CAAC,QAAQ,CAAC;YAC9B,KAAK,cAAc,CAAC,YAAY;gBAC5B,OAAO,SAAS,CAAC,YAAY,CAAC;YAClC,KAAK,cAAc,CAAC,aAAa;gBAC7B,OAAO,SAAS,CAAC,aAAa,CAAC;YACnC,SAAS;gBACL,MAAM,eAAe,CAAC,mCAAmC,EAAE,CAAC;aAC/D;SACJ;KACJ;;;;;IAMM,kCAAiB,GAAxB,UAAyB,GAAW;;QAEhC,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,YAAY,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;;YAE/D,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,6BAA6B,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;gBAChF,OAAO,cAAc,CAAC,6BAA6B,CAAC;aACvD;YACD,OAAO,cAAc,CAAC,YAAY,CAAC;SACtC;aAAM,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YAClE,OAAO,cAAc,CAAC,QAAQ,CAAC;SAClC;aAAM,IAAI,GAAG,CAAC,OAAO,CAAC,cAAc,CAAC,aAAa,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE;YACvE,OAAO,cAAc,CAAC,aAAa,CAAC;SACvC;QAED,OAAO,SAAS,CAAC,WAAW,CAAC;KAChC;;;;IAKM,2CAA0B,GAAjC,UACI,aAAqB,EACrB,WAAmB,EACnB,cAA8B,EAC9B,QAAgB,EAChB,KAAc,EACd,MAAe,EACf,QAAiB;QAEjB,IAAM,aAAa,GAAG;YAClB,IAAI,CAAC,4BAA4B,CAAC,aAAa,EAAE,WAAW,CAAC;YAC7D,IAAI,CAAC,+BAA+B,CAAC,cAAc,EAAE,QAAQ,EAAE,KAAK,EAAE,QAAQ,CAAC;YAC/E,IAAI,CAAC,yBAAyB,CAAC,MAAM,CAAC;SACzC,CAAC;QAEF,OAAO,aAAa,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC3E;;;;;;IAOc,6CAA4B,GAA3C,UACI,aAAqB,EACrB,WAAmB;QAEnB,IAAM,SAAS,GAAkB,CAAC,aAAa,EAAE,WAAW,CAAC,CAAC;QAC9D,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;;;;;;;;IASc,gDAA+B,GAA9C,UACI,cAA8B,EAC9B,QAAgB,EAChB,KAAc,EACd,QAAiB;QAEjB,IAAM,gBAAgB,GAClB,cAAc,KAAK,cAAc,CAAC,aAAa;cACzC,QAAQ,IAAI,QAAQ;cACpB,QAAQ,CAAC;QACnB,IAAM,YAAY,GAAkB;YAChC,cAAc;YACd,gBAAgB;YAChB,KAAK,IAAI,EAAE;SACd,CAAC;QAEF,OAAO,YAAY,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KAC1E;;;;IAKc,0CAAyB,GAAxC,UAAyC,MAAe;QACpD,OAAO,CAAC,MAAM,IAAI,EAAE,EAAE,WAAW,EAAE,CAAC;KACvC;IACL,uBAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { __extends } from '../../_virtual/_tslib.js';
|
|
4
|
+
import { CredentialEntity } from './CredentialEntity.js';
|
|
5
|
+
import { CredentialType } from '../../utils/Constants.js';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* ID_TOKEN Cache
|
|
13
|
+
*
|
|
14
|
+
* Key:Value Schema:
|
|
15
|
+
*
|
|
16
|
+
* Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-
|
|
17
|
+
*
|
|
18
|
+
* Value Schema:
|
|
19
|
+
* {
|
|
20
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
21
|
+
* environment: entity that issued the token, represented as a full host
|
|
22
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
23
|
+
* clientId: client ID of the application
|
|
24
|
+
* secret: Actual credential as a string
|
|
25
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
26
|
+
* }
|
|
27
|
+
*/
|
|
28
|
+
var IdTokenEntity = /** @class */ (function (_super) {
|
|
29
|
+
__extends(IdTokenEntity, _super);
|
|
30
|
+
function IdTokenEntity() {
|
|
31
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Create IdTokenEntity
|
|
35
|
+
* @param homeAccountId
|
|
36
|
+
* @param authenticationResult
|
|
37
|
+
* @param clientId
|
|
38
|
+
* @param authority
|
|
39
|
+
*/
|
|
40
|
+
IdTokenEntity.createIdTokenEntity = function (homeAccountId, environment, idToken, clientId, tenantId, oboAssertion) {
|
|
41
|
+
var idTokenEntity = new IdTokenEntity();
|
|
42
|
+
idTokenEntity.credentialType = CredentialType.ID_TOKEN;
|
|
43
|
+
idTokenEntity.homeAccountId = homeAccountId;
|
|
44
|
+
idTokenEntity.environment = environment;
|
|
45
|
+
idTokenEntity.clientId = clientId;
|
|
46
|
+
idTokenEntity.secret = idToken;
|
|
47
|
+
idTokenEntity.realm = tenantId;
|
|
48
|
+
idTokenEntity.oboAssertion = oboAssertion;
|
|
49
|
+
return idTokenEntity;
|
|
50
|
+
};
|
|
51
|
+
/**
|
|
52
|
+
* Validates an entity: checks for all expected params
|
|
53
|
+
* @param entity
|
|
54
|
+
*/
|
|
55
|
+
IdTokenEntity.isIdTokenEntity = function (entity) {
|
|
56
|
+
if (!entity) {
|
|
57
|
+
return false;
|
|
58
|
+
}
|
|
59
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
60
|
+
entity.hasOwnProperty("environment") &&
|
|
61
|
+
entity.hasOwnProperty("credentialType") &&
|
|
62
|
+
entity.hasOwnProperty("realm") &&
|
|
63
|
+
entity.hasOwnProperty("clientId") &&
|
|
64
|
+
entity.hasOwnProperty("secret") &&
|
|
65
|
+
entity["credentialType"] === CredentialType.ID_TOKEN);
|
|
66
|
+
};
|
|
67
|
+
return IdTokenEntity;
|
|
68
|
+
}(CredentialEntity));
|
|
69
|
+
|
|
70
|
+
export { IdTokenEntity };
|
|
71
|
+
//# sourceMappingURL=IdTokenEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IdTokenEntity.js","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * ID_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\n *\n * Value Schema:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * realm: Full tenant or organizational identifier that the account belongs to\n * }\n */\nexport class IdTokenEntity extends CredentialEntity {\n realm: string;\n\n /**\n * Create IdTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createIdTokenEntity(\n homeAccountId: string,\n environment: string,\n idToken: string,\n clientId: string,\n tenantId: string,\n oboAssertion?: string\n ): IdTokenEntity {\n const idTokenEntity = new IdTokenEntity();\n\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\n idTokenEntity.homeAccountId = homeAccountId;\n idTokenEntity.environment = environment;\n idTokenEntity.clientId = clientId;\n idTokenEntity.secret = idToken;\n idTokenEntity.realm = tenantId;\n idTokenEntity.oboAssertion = oboAssertion;\n\n return idTokenEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isIdTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"realm\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.ID_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAQA;;;;;;;;;;;;;;;;;;IAiBmC,iCAAgB;IAAnD;;KAmDC;;;;;;;;IAzCU,iCAAmB,GAA1B,UACI,aAAqB,EACrB,WAAmB,EACnB,OAAe,EACf,QAAgB,EAChB,QAAgB,EAChB,YAAqB;QAErB,IAAM,aAAa,GAAG,IAAI,aAAa,EAAE,CAAC;QAE1C,aAAa,CAAC,cAAc,GAAG,cAAc,CAAC,QAAQ,CAAC;QACvD,aAAa,CAAC,aAAa,GAAG,aAAa,CAAC;QAC5C,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;QACxC,aAAa,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAClC,aAAa,CAAC,MAAM,GAAG,OAAO,CAAC;QAC/B,aAAa,CAAC,KAAK,GAAG,QAAQ,CAAC;QAC/B,aAAa,CAAC,YAAY,GAAG,YAAY,CAAC;QAE1C,OAAO,aAAa,CAAC;KACxB;;;;;IAMM,6BAAe,GAAtB,UAAuB,MAAc;QAEjC,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;YACtC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC;YAC9B,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,QAAQ,EACtD;KACL;IACL,oBAAC;AAAD,CAnDA,CAAmC,gBAAgB;;;;"}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { __extends } from '../../_virtual/_tslib.js';
|
|
4
|
+
import { CredentialEntity } from './CredentialEntity.js';
|
|
5
|
+
import { CredentialType } from '../../utils/Constants.js';
|
|
6
|
+
|
|
7
|
+
/*
|
|
8
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
9
|
+
* Licensed under the MIT License.
|
|
10
|
+
*/
|
|
11
|
+
/**
|
|
12
|
+
* REFRESH_TOKEN Cache
|
|
13
|
+
*
|
|
14
|
+
* Key:Value Schema:
|
|
15
|
+
*
|
|
16
|
+
* Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--
|
|
17
|
+
*
|
|
18
|
+
* Value:
|
|
19
|
+
* {
|
|
20
|
+
* homeAccountId: home account identifier for the auth scheme,
|
|
21
|
+
* environment: entity that issued the token, represented as a full host
|
|
22
|
+
* credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other
|
|
23
|
+
* clientId: client ID of the application
|
|
24
|
+
* secret: Actual credential as a string
|
|
25
|
+
* familyId: Family ID identifier, '1' represents Microsoft Family
|
|
26
|
+
* realm: Full tenant or organizational identifier that the account belongs to
|
|
27
|
+
* target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
|
|
28
|
+
* }
|
|
29
|
+
*/
|
|
30
|
+
var RefreshTokenEntity = /** @class */ (function (_super) {
|
|
31
|
+
__extends(RefreshTokenEntity, _super);
|
|
32
|
+
function RefreshTokenEntity() {
|
|
33
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Create RefreshTokenEntity
|
|
37
|
+
* @param homeAccountId
|
|
38
|
+
* @param authenticationResult
|
|
39
|
+
* @param clientId
|
|
40
|
+
* @param authority
|
|
41
|
+
*/
|
|
42
|
+
RefreshTokenEntity.createRefreshTokenEntity = function (homeAccountId, environment, refreshToken, clientId, familyId, oboAssertion) {
|
|
43
|
+
var rtEntity = new RefreshTokenEntity();
|
|
44
|
+
rtEntity.clientId = clientId;
|
|
45
|
+
rtEntity.credentialType = CredentialType.REFRESH_TOKEN;
|
|
46
|
+
rtEntity.environment = environment;
|
|
47
|
+
rtEntity.homeAccountId = homeAccountId;
|
|
48
|
+
rtEntity.secret = refreshToken;
|
|
49
|
+
rtEntity.oboAssertion = oboAssertion;
|
|
50
|
+
if (familyId)
|
|
51
|
+
rtEntity.familyId = familyId;
|
|
52
|
+
return rtEntity;
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Validates an entity: checks for all expected params
|
|
56
|
+
* @param entity
|
|
57
|
+
*/
|
|
58
|
+
RefreshTokenEntity.isRefreshTokenEntity = function (entity) {
|
|
59
|
+
if (!entity) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
return (entity.hasOwnProperty("homeAccountId") &&
|
|
63
|
+
entity.hasOwnProperty("environment") &&
|
|
64
|
+
entity.hasOwnProperty("credentialType") &&
|
|
65
|
+
entity.hasOwnProperty("clientId") &&
|
|
66
|
+
entity.hasOwnProperty("secret") &&
|
|
67
|
+
entity["credentialType"] === CredentialType.REFRESH_TOKEN);
|
|
68
|
+
};
|
|
69
|
+
return RefreshTokenEntity;
|
|
70
|
+
}(CredentialEntity));
|
|
71
|
+
|
|
72
|
+
export { RefreshTokenEntity };
|
|
73
|
+
//# sourceMappingURL=RefreshTokenEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RefreshTokenEntity.js","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { CredentialEntity } from \"./CredentialEntity\";\nimport { CredentialType } from \"../../utils/Constants\";\n\n/**\n * REFRESH_TOKEN Cache\n *\n * Key:Value Schema:\n *\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\n *\n * Value:\n * {\n * homeAccountId: home account identifier for the auth scheme,\n * environment: entity that issued the token, represented as a full host\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\n * clientId: client ID of the application\n * secret: Actual credential as a string\n * familyId: Family ID identifier, '1' represents Microsoft Family\n * realm: Full tenant or organizational identifier that the account belongs to\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\n * }\n */\nexport class RefreshTokenEntity extends CredentialEntity {\n familyId?: string;\n\n /**\n * Create RefreshTokenEntity\n * @param homeAccountId\n * @param authenticationResult\n * @param clientId\n * @param authority\n */\n static createRefreshTokenEntity(\n homeAccountId: string,\n environment: string,\n refreshToken: string,\n clientId: string,\n familyId?: string,\n oboAssertion?: string\n ): RefreshTokenEntity {\n const rtEntity = new RefreshTokenEntity();\n\n rtEntity.clientId = clientId;\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\n rtEntity.environment = environment;\n rtEntity.homeAccountId = homeAccountId;\n rtEntity.secret = refreshToken;\n rtEntity.oboAssertion = oboAssertion;\n\n if (familyId)\n rtEntity.familyId = familyId;\n\n return rtEntity;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isRefreshTokenEntity(entity: object): boolean {\n\n if (!entity) {\n return false;\n }\n\n return (\n entity.hasOwnProperty(\"homeAccountId\") &&\n entity.hasOwnProperty(\"environment\") &&\n entity.hasOwnProperty(\"credentialType\") &&\n entity.hasOwnProperty(\"clientId\") &&\n entity.hasOwnProperty(\"secret\") &&\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN\n );\n }\n}\n"],"names":[],"mappings":";;;;;;AAAA;;;;AAQA;;;;;;;;;;;;;;;;;;;;IAmBwC,sCAAgB;IAAxD;;KAoDC;;;;;;;;IA1CU,2CAAwB,GAA/B,UACI,aAAqB,EACrB,WAAmB,EACnB,YAAoB,EACpB,QAAgB,EAChB,QAAiB,EACjB,YAAqB;QAErB,IAAM,QAAQ,GAAG,IAAI,kBAAkB,EAAE,CAAC;QAE1C,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAC7B,QAAQ,CAAC,cAAc,GAAG,cAAc,CAAC,aAAa,CAAC;QACvD,QAAQ,CAAC,WAAW,GAAG,WAAW,CAAC;QACnC,QAAQ,CAAC,aAAa,GAAG,aAAa,CAAC;QACvC,QAAQ,CAAC,MAAM,GAAG,YAAY,CAAC;QAC/B,QAAQ,CAAC,YAAY,GAAG,YAAY,CAAC;QAErC,IAAI,QAAQ;YACR,QAAQ,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEjC,OAAO,QAAQ,CAAC;KACnB;;;;;IAMM,uCAAoB,GAA3B,UAA4B,MAAc;QAEtC,IAAI,CAAC,MAAM,EAAE;YACT,OAAO,KAAK,CAAC;SAChB;QAED,QACI,MAAM,CAAC,cAAc,CAAC,eAAe,CAAC;YACtC,MAAM,CAAC,cAAc,CAAC,aAAa,CAAC;YACpC,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;YACvC,MAAM,CAAC,cAAc,CAAC,UAAU,CAAC;YACjC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;YAC/B,MAAM,CAAC,gBAAgB,CAAC,KAAK,cAAc,CAAC,aAAa,EAC3D;KACL;IACL,yBAAC;AAAD,CApDA,CAAwC,gBAAgB;;;;"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
var ServerTelemetryEntity = /** @class */ (function () {
|
|
10
|
+
function ServerTelemetryEntity() {
|
|
11
|
+
this.failedRequests = [];
|
|
12
|
+
this.errors = [];
|
|
13
|
+
this.cacheHits = 0;
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* validates if a given cache entry is "Telemetry", parses <key,value>
|
|
17
|
+
* @param key
|
|
18
|
+
* @param entity
|
|
19
|
+
*/
|
|
20
|
+
ServerTelemetryEntity.isServerTelemetryEntity = function (key, entity) {
|
|
21
|
+
var validateKey = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;
|
|
22
|
+
var validateEntity = true;
|
|
23
|
+
if (entity) {
|
|
24
|
+
validateEntity =
|
|
25
|
+
entity.hasOwnProperty("failedRequests") &&
|
|
26
|
+
entity.hasOwnProperty("errors") &&
|
|
27
|
+
entity.hasOwnProperty("cacheHits");
|
|
28
|
+
}
|
|
29
|
+
return validateKey && validateEntity;
|
|
30
|
+
};
|
|
31
|
+
return ServerTelemetryEntity;
|
|
32
|
+
}());
|
|
33
|
+
|
|
34
|
+
export { ServerTelemetryEntity };
|
|
35
|
+
//# sourceMappingURL=ServerTelemetryEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\n\nexport class ServerTelemetryEntity {\n failedRequests: Array<string|number>;\n errors: string[];\n cacheHits: number;\n\n constructor() {\n this.failedRequests = [];\n this.errors = [];\n this.cacheHits = 0;\n }\n\n /**\n * validates if a given cache entry is \"Telemetry\", parses <key,value>\n * @param key\n * @param entity\n */\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\n\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\n let validateEntity: boolean = true;\n\n if (entity) {\n validateEntity =\n entity.hasOwnProperty(\"failedRequests\") &&\n entity.hasOwnProperty(\"errors\") &&\n entity.hasOwnProperty(\"cacheHits\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;IAYI;QACI,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,EAAE,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,CAAC,CAAC;KACtB;;;;;;IAOM,6CAAuB,GAA9B,UAA+B,GAAW,EAAE,MAAe;QAEvD,IAAM,WAAW,GAAY,GAAG,CAAC,OAAO,CAAC,sBAAsB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;QACjF,IAAI,cAAc,GAAY,IAAI,CAAC;QAEnC,IAAI,MAAM,EAAE;YACR,cAAc;gBACV,MAAM,CAAC,cAAc,CAAC,gBAAgB,CAAC;oBACvC,MAAM,CAAC,cAAc,CAAC,QAAQ,CAAC;oBAC/B,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC;SAC1C;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC;IACL,4BAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
import { ThrottlingConstants } from '../../utils/Constants.js';
|
|
4
|
+
|
|
5
|
+
/*
|
|
6
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
+
* Licensed under the MIT License.
|
|
8
|
+
*/
|
|
9
|
+
var ThrottlingEntity = /** @class */ (function () {
|
|
10
|
+
function ThrottlingEntity() {
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* validates if a given cache entry is "Throttling", parses <key,value>
|
|
14
|
+
* @param key
|
|
15
|
+
* @param entity
|
|
16
|
+
*/
|
|
17
|
+
ThrottlingEntity.isThrottlingEntity = function (key, entity) {
|
|
18
|
+
var validateKey = false;
|
|
19
|
+
if (key) {
|
|
20
|
+
validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;
|
|
21
|
+
}
|
|
22
|
+
var validateEntity = true;
|
|
23
|
+
if (entity) {
|
|
24
|
+
validateEntity = entity.hasOwnProperty("throttleTime");
|
|
25
|
+
}
|
|
26
|
+
return validateKey && validateEntity;
|
|
27
|
+
};
|
|
28
|
+
return ThrottlingEntity;
|
|
29
|
+
}());
|
|
30
|
+
|
|
31
|
+
export { ThrottlingEntity };
|
|
32
|
+
//# sourceMappingURL=ThrottlingEntity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ThrottlingEntity.js","sources":["../../../src/cache/entities/ThrottlingEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ThrottlingConstants } from \"../../utils/Constants\";\n\nexport class ThrottlingEntity {\n // Unix-time value representing the expiration of the throttle\n throttleTime: number;\n // Information provided by the server\n error?: string;\n errorCodes?: Array<string>;\n errorMessage?: string;\n subError?: string;\n\n /**\n * validates if a given cache entry is \"Throttling\", parses <key,value>\n * @param key\n * @param entity\n */\n static isThrottlingEntity(key: string, entity?: object): boolean {\n \n let validateKey: boolean = false;\n if (key) {\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\n }\n \n let validateEntity: boolean = true;\n if (entity) {\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\n }\n\n return validateKey && validateEntity;\n }\n}\n"],"names":[],"mappings":";;;;AAAA;;;;;IAOA;KA4BC;;;;;;IAdU,mCAAkB,GAAzB,UAA0B,GAAW,EAAE,MAAe;QAElD,IAAI,WAAW,GAAY,KAAK,CAAC;QACjC,IAAI,GAAG,EAAE;YACL,WAAW,GAAG,GAAG,CAAC,OAAO,CAAC,mBAAmB,CAAC,iBAAiB,CAAC,KAAK,CAAC,CAAC;SAC1E;QAED,IAAI,cAAc,GAAY,IAAI,CAAC;QACnC,IAAI,MAAM,EAAE;YACR,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;SAC1D;QAED,OAAO,WAAW,IAAI,cAAc,CAAC;KACxC;IACL,uBAAC;AAAD,CAAC;;;;"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*! @azure/msal-common v4.5.1 2021-08-02 */
|
|
2
|
+
'use strict';
|
|
3
|
+
/*
|
|
4
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
5
|
+
* Licensed under the MIT License.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* This class instance helps track the memory changes facilitating
|
|
9
|
+
* decisions to read from and write to the persistent cache
|
|
10
|
+
*/ var TokenCacheContext = /** @class */ (function () {
|
|
11
|
+
function TokenCacheContext(tokenCache, hasChanged) {
|
|
12
|
+
this.cache = tokenCache;
|
|
13
|
+
this.hasChanged = hasChanged;
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(TokenCacheContext.prototype, "cacheHasChanged", {
|
|
16
|
+
/**
|
|
17
|
+
* boolean which indicates the changes in cache
|
|
18
|
+
*/
|
|
19
|
+
get: function () {
|
|
20
|
+
return this.hasChanged;
|
|
21
|
+
},
|
|
22
|
+
enumerable: false,
|
|
23
|
+
configurable: true
|
|
24
|
+
});
|
|
25
|
+
Object.defineProperty(TokenCacheContext.prototype, "tokenCache", {
|
|
26
|
+
/**
|
|
27
|
+
* function to retrieve the token cache
|
|
28
|
+
*/
|
|
29
|
+
get: function () {
|
|
30
|
+
return this.cache;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
return TokenCacheContext;
|
|
36
|
+
}());
|
|
37
|
+
|
|
38
|
+
export { TokenCacheContext };
|
|
39
|
+
//# sourceMappingURL=TokenCacheContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TokenCacheContext.js","sources":["../../../src/cache/persistence/TokenCacheContext.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport { ISerializableTokenCache } from \"../interface/ISerializableTokenCache\";\n\n/**\n * This class instance helps track the memory changes facilitating\n * decisions to read from and write to the persistent cache\n */export class TokenCacheContext {\n /**\n * boolean indicating cache change\n */\n hasChanged: boolean;\n /**\n * serializable token cache interface\n */\n cache: ISerializableTokenCache;\n\n constructor(tokenCache: ISerializableTokenCache, hasChanged: boolean) {\n this.cache = tokenCache;\n this.hasChanged = hasChanged;\n }\n\n /**\n * boolean which indicates the changes in cache\n */\n get cacheHasChanged(): boolean {\n return this.hasChanged;\n }\n\n /**\n * function to retrieve the token cache\n */\n get tokenCache(): ISerializableTokenCache {\n return this.cache;\n }\n}\n"],"names":[],"mappings":";;AAAA;;;;AAOA;;;;IAaI,2BAAY,UAAmC,EAAE,UAAmB;QAChE,IAAI,CAAC,KAAK,GAAG,UAAU,CAAC;QACxB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;KAChC;IAKD,sBAAI,8CAAe;;;;aAAnB;YACI,OAAO,IAAI,CAAC,UAAU,CAAC;SAC1B;;;OAAA;IAKD,sBAAI,yCAAU;;;;aAAd;YACI,OAAO,IAAI,CAAC,KAAK,CAAC;SACrB;;;OAAA;IACL,wBAAC;AAAD,CAAC;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/AuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAI3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;
|
|
1
|
+
{"version":3,"file":"AuthorizationCodeClient.d.ts","sourceRoot":"","sources":["../../src/client/AuthorizationCodeClient.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,6BAA6B,EAAE,MAAM,0CAA0C,CAAC;AACzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,2CAA2C,CAAC;AAI3F,OAAO,EAAE,mBAAmB,EAAE,MAAM,+BAA+B,CAAC;AAIpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,kCAAkC,CAAC;AAMxE,OAAO,EAAE,uBAAuB,EAAE,MAAM,oCAAoC,CAAC;AAI7E,OAAO,EAAE,wBAAwB,EAAE,MAAM,sCAAsC,CAAC;AAOhF;;GAEG;AACH,qBAAa,uBAAwB,SAAQ,UAAU;gBAEvC,aAAa,EAAE,mBAAmB;IAI9C;;;;;;;;;OASG;IACG,cAAc,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,MAAM,CAAC;IAM7E;;;;OAIG;IACG,YAAY,CAAC,OAAO,EAAE,8BAA8B,EAAE,eAAe,CAAC,EAAE,wBAAwB,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuBtI;;;;OAIG;IACH,sBAAsB,CAAC,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,wBAAwB;IAuB3F;;;;OAIG;IACH,YAAY,CAAC,aAAa,EAAE,uBAAuB,GAAG,MAAM;IAoB5D;;;;OAIG;YACW,mBAAmB;IA2BjC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAUlC;;;OAGG;YACW,sBAAsB;IAyFpC;;;OAGG;IACH,OAAO,CAAC,4BAA4B;IAsGpC;;;OAGG;IACH,OAAO,CAAC,0BAA0B;IAkBlC;;;OAGG;IACH,OAAO,CAAC,iBAAiB;CAO5B"}
|