@azure/msal-common 4.5.0 → 5.1.0

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.
Files changed (186) hide show
  1. package/CHANGELOG.json +178 -0
  2. package/{changelog.md → CHANGELOG.md} +446 -390
  3. package/LICENSE +21 -21
  4. package/README.md +62 -61
  5. package/dist/_virtual/_tslib.js +1 -1
  6. package/dist/account/AuthToken.js +7 -7
  7. package/dist/account/AuthToken.js.map +1 -1
  8. package/dist/account/CcsCredential.js +1 -1
  9. package/dist/account/CcsCredential.js.map +1 -1
  10. package/dist/account/ClientInfo.js +10 -10
  11. package/dist/account/ClientInfo.js.map +1 -1
  12. package/dist/account/TokenClaims.d.ts +5 -0
  13. package/dist/account/TokenClaims.d.ts.map +1 -1
  14. package/dist/authority/Authority.d.ts.map +1 -1
  15. package/dist/authority/Authority.js +60 -54
  16. package/dist/authority/Authority.js.map +1 -1
  17. package/dist/authority/AuthorityFactory.js +9 -9
  18. package/dist/authority/AuthorityFactory.js.map +1 -1
  19. package/dist/authority/AuthorityType.js +1 -1
  20. package/dist/authority/AuthorityType.js.map +1 -1
  21. package/dist/authority/CloudInstanceDiscoveryResponse.js +1 -1
  22. package/dist/authority/CloudInstanceDiscoveryResponse.js.map +1 -1
  23. package/dist/authority/OpenIdConfigResponse.d.ts +1 -1
  24. package/dist/authority/OpenIdConfigResponse.d.ts.map +1 -1
  25. package/dist/authority/OpenIdConfigResponse.js +1 -2
  26. package/dist/authority/OpenIdConfigResponse.js.map +1 -1
  27. package/dist/authority/ProtocolMode.js +1 -1
  28. package/dist/authority/ProtocolMode.js.map +1 -1
  29. package/dist/authority/RegionDiscovery.js +9 -9
  30. package/dist/authority/RegionDiscovery.js.map +1 -1
  31. package/dist/cache/CacheManager.d.ts +23 -9
  32. package/dist/cache/CacheManager.d.ts.map +1 -1
  33. package/dist/cache/CacheManager.js +244 -114
  34. package/dist/cache/CacheManager.js.map +1 -1
  35. package/dist/cache/entities/AccessTokenEntity.d.ts +3 -2
  36. package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
  37. package/dist/cache/entities/AccessTokenEntity.js +23 -17
  38. package/dist/cache/entities/AccessTokenEntity.js.map +1 -1
  39. package/dist/cache/entities/AccountEntity.d.ts +2 -2
  40. package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
  41. package/dist/cache/entities/AccountEntity.js +18 -18
  42. package/dist/cache/entities/AccountEntity.js.map +1 -1
  43. package/dist/cache/entities/AppMetadataEntity.js +1 -1
  44. package/dist/cache/entities/AppMetadataEntity.js.map +1 -1
  45. package/dist/cache/entities/AuthorityMetadataEntity.d.ts +1 -1
  46. package/dist/cache/entities/AuthorityMetadataEntity.d.ts.map +1 -1
  47. package/dist/cache/entities/AuthorityMetadataEntity.js +5 -6
  48. package/dist/cache/entities/AuthorityMetadataEntity.js.map +1 -1
  49. package/dist/cache/entities/CacheRecord.js +1 -1
  50. package/dist/cache/entities/CacheRecord.js.map +1 -1
  51. package/dist/cache/entities/CredentialEntity.d.ts +7 -3
  52. package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
  53. package/dist/cache/entities/CredentialEntity.js +16 -9
  54. package/dist/cache/entities/CredentialEntity.js.map +1 -1
  55. package/dist/cache/entities/IdTokenEntity.js +3 -3
  56. package/dist/cache/entities/IdTokenEntity.js.map +1 -1
  57. package/dist/cache/entities/RefreshTokenEntity.js +3 -3
  58. package/dist/cache/entities/RefreshTokenEntity.js.map +1 -1
  59. package/dist/cache/entities/ServerTelemetryEntity.js +1 -1
  60. package/dist/cache/entities/ServerTelemetryEntity.js.map +1 -1
  61. package/dist/cache/entities/ThrottlingEntity.js +1 -1
  62. package/dist/cache/entities/ThrottlingEntity.js.map +1 -1
  63. package/dist/cache/interface/ICacheManager.d.ts +5 -5
  64. package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
  65. package/dist/cache/persistence/TokenCacheContext.js +3 -3
  66. package/dist/cache/persistence/TokenCacheContext.js.map +1 -1
  67. package/dist/cache/utils/CacheTypes.d.ts +4 -1
  68. package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
  69. package/dist/client/AuthorizationCodeClient.d.ts +1 -1
  70. package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
  71. package/dist/client/AuthorizationCodeClient.js +56 -43
  72. package/dist/client/AuthorizationCodeClient.js.map +1 -1
  73. package/dist/client/BaseClient.js +11 -11
  74. package/dist/client/BaseClient.js.map +1 -1
  75. package/dist/client/ClientCredentialClient.d.ts.map +1 -1
  76. package/dist/client/ClientCredentialClient.js +24 -18
  77. package/dist/client/ClientCredentialClient.js.map +1 -1
  78. package/dist/client/DeviceCodeClient.d.ts.map +1 -1
  79. package/dist/client/DeviceCodeClient.js +39 -27
  80. package/dist/client/DeviceCodeClient.js.map +1 -1
  81. package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
  82. package/dist/client/OnBehalfOfClient.js +26 -20
  83. package/dist/client/OnBehalfOfClient.js.map +1 -1
  84. package/dist/client/RefreshTokenClient.d.ts.map +1 -1
  85. package/dist/client/RefreshTokenClient.js +49 -32
  86. package/dist/client/RefreshTokenClient.js.map +1 -1
  87. package/dist/client/SilentFlowClient.d.ts.map +1 -1
  88. package/dist/client/SilentFlowClient.js +40 -35
  89. package/dist/client/SilentFlowClient.js.map +1 -1
  90. package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
  91. package/dist/client/UsernamePasswordClient.js +18 -12
  92. package/dist/client/UsernamePasswordClient.js.map +1 -1
  93. package/dist/config/ClientConfiguration.d.ts.map +1 -1
  94. package/dist/config/ClientConfiguration.js +8 -7
  95. package/dist/config/ClientConfiguration.js.map +1 -1
  96. package/dist/crypto/ICrypto.d.ts +11 -1
  97. package/dist/crypto/ICrypto.d.ts.map +1 -1
  98. package/dist/crypto/ICrypto.js +26 -8
  99. package/dist/crypto/ICrypto.js.map +1 -1
  100. package/dist/crypto/PopTokenGenerator.d.ts +21 -4
  101. package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
  102. package/dist/crypto/PopTokenGenerator.js +42 -31
  103. package/dist/crypto/PopTokenGenerator.js.map +1 -1
  104. package/dist/error/AuthError.d.ts +5 -0
  105. package/dist/error/AuthError.d.ts.map +1 -1
  106. package/dist/error/AuthError.js +6 -3
  107. package/dist/error/AuthError.js.map +1 -1
  108. package/dist/error/ClientAuthError.d.ts +13 -4
  109. package/dist/error/ClientAuthError.d.ts.map +1 -1
  110. package/dist/error/ClientAuthError.js +20 -9
  111. package/dist/error/ClientAuthError.js.map +1 -1
  112. package/dist/error/ClientConfigurationError.d.ts +29 -0
  113. package/dist/error/ClientConfigurationError.d.ts.map +1 -1
  114. package/dist/error/ClientConfigurationError.js +45 -5
  115. package/dist/error/ClientConfigurationError.js.map +1 -1
  116. package/dist/error/InteractionRequiredAuthError.d.ts +24 -5
  117. package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
  118. package/dist/error/InteractionRequiredAuthError.js +30 -9
  119. package/dist/error/InteractionRequiredAuthError.js.map +1 -1
  120. package/dist/error/ServerError.js +3 -3
  121. package/dist/error/ServerError.js.map +1 -1
  122. package/dist/index.cjs.js +675 -244
  123. package/dist/index.cjs.js.map +1 -1
  124. package/dist/index.d.ts +7 -2
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +33 -29
  127. package/dist/index.js.map +1 -1
  128. package/dist/logger/Logger.d.ts.map +1 -1
  129. package/dist/logger/Logger.js +11 -9
  130. package/dist/logger/Logger.js.map +1 -1
  131. package/dist/network/INetworkModule.js +4 -4
  132. package/dist/network/INetworkModule.js.map +1 -1
  133. package/dist/network/NetworkManager.js +8 -8
  134. package/dist/network/NetworkManager.js.map +1 -1
  135. package/dist/network/RequestThumbprint.d.ts +7 -0
  136. package/dist/network/RequestThumbprint.d.ts.map +1 -1
  137. package/dist/network/ThrottlingUtils.d.ts +2 -1
  138. package/dist/network/ThrottlingUtils.d.ts.map +1 -1
  139. package/dist/network/ThrottlingUtils.js +14 -8
  140. package/dist/network/ThrottlingUtils.js.map +1 -1
  141. package/dist/packageMetadata.d.ts +1 -1
  142. package/dist/packageMetadata.js +2 -2
  143. package/dist/packageMetadata.js.map +1 -1
  144. package/dist/request/AuthenticationHeaderParser.d.ts +20 -0
  145. package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -0
  146. package/dist/request/AuthenticationHeaderParser.js +64 -0
  147. package/dist/request/AuthenticationHeaderParser.js.map +1 -0
  148. package/dist/request/BaseAuthRequest.d.ts +7 -1
  149. package/dist/request/BaseAuthRequest.d.ts.map +1 -1
  150. package/dist/request/CommonEndSessionRequest.d.ts +4 -0
  151. package/dist/request/CommonEndSessionRequest.d.ts.map +1 -1
  152. package/dist/request/RequestParameterBuilder.d.ts +4 -0
  153. package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
  154. package/dist/request/RequestParameterBuilder.js +27 -18
  155. package/dist/request/RequestParameterBuilder.js.map +1 -1
  156. package/dist/request/RequestValidator.js +10 -10
  157. package/dist/request/RequestValidator.js.map +1 -1
  158. package/dist/request/ScopeSet.js +14 -14
  159. package/dist/request/ScopeSet.js.map +1 -1
  160. package/dist/response/AuthenticationResult.d.ts +2 -1
  161. package/dist/response/AuthenticationResult.d.ts.map +1 -1
  162. package/dist/response/ExternalTokenResponse.d.ts +15 -0
  163. package/dist/response/ExternalTokenResponse.d.ts.map +1 -0
  164. package/dist/response/ResponseHandler.d.ts.map +1 -1
  165. package/dist/response/ResponseHandler.js +74 -69
  166. package/dist/response/ResponseHandler.js.map +1 -1
  167. package/dist/response/ServerAuthorizationTokenResponse.d.ts +5 -2
  168. package/dist/response/ServerAuthorizationTokenResponse.d.ts.map +1 -1
  169. package/dist/telemetry/server/ServerTelemetryManager.js +13 -13
  170. package/dist/telemetry/server/ServerTelemetryManager.js.map +1 -1
  171. package/dist/url/UrlString.d.ts +0 -6
  172. package/dist/url/UrlString.d.ts.map +1 -1
  173. package/dist/url/UrlString.js +25 -40
  174. package/dist/url/UrlString.js.map +1 -1
  175. package/dist/utils/Constants.d.ts +5 -2
  176. package/dist/utils/Constants.d.ts.map +1 -1
  177. package/dist/utils/Constants.js +5 -2
  178. package/dist/utils/Constants.js.map +1 -1
  179. package/dist/utils/ProtocolUtils.js +13 -13
  180. package/dist/utils/ProtocolUtils.js.map +1 -1
  181. package/dist/utils/StringUtils.d.ts.map +1 -1
  182. package/dist/utils/StringUtils.js +15 -14
  183. package/dist/utils/StringUtils.js.map +1 -1
  184. package/dist/utils/TimeUtils.js +1 -1
  185. package/dist/utils/TimeUtils.js.map +1 -1
  186. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"AccountEntity.js","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport {\r\n Separators,\r\n CacheAccountType,\r\n CacheType,\r\n Constants,\r\n} from \"../../utils/Constants\";\r\nimport { Authority } from \"../../authority/Authority\";\r\nimport { AuthToken } from \"../../account/AuthToken\";\r\nimport { ICrypto } from \"../../crypto/ICrypto\";\r\nimport { buildClientInfo } from \"../../account/ClientInfo\";\r\nimport { StringUtils } from \"../../utils/StringUtils\";\r\nimport { AccountInfo } from \"../../account/AccountInfo\";\r\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\r\nimport { AuthorityType } from \"../../authority/AuthorityType\";\r\nimport { Logger } from \"../../logger/Logger\";\r\nimport { TokenClaims } from \"../../account/TokenClaims\";\r\n\r\n/**\r\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\r\n *\r\n * Key : Value Schema\r\n *\r\n * Key: <home_account_id>-<environment>-<realm*>\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\r\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\r\n * authorityType: Accounts authority type as a string\r\n * name: Full name for the account, including given name and family name,\r\n * clientInfo: Full base64 encoded client info received from ESTS\r\n * lastModificationTime: last time this entity was modified in the cache\r\n * lastModificationApp:\r\n * oboAssertion: access token passed in as part of OBO request\r\n * idTokenClaims: Object containing claims parsed from ID token\r\n * }\r\n */\r\nexport class AccountEntity {\r\n homeAccountId: string;\r\n environment: string;\r\n realm: string;\r\n localAccountId: string;\r\n username: string;\r\n authorityType: string;\r\n name?: string;\r\n clientInfo?: string;\r\n lastModificationTime?: string;\r\n lastModificationApp?: string;\r\n oboAssertion?: string;\r\n cloudGraphHostName?: string;\r\n msGraphHost?: string; \r\n idTokenClaims?: TokenClaims;\r\n\r\n /**\r\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\r\n */\r\n generateAccountId(): string {\r\n const accountId: Array<string> = [this.homeAccountId, this.environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>\r\n */\r\n generateAccountKey(): string {\r\n return AccountEntity.generateAccountCacheKey({\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId\r\n });\r\n }\r\n\r\n /**\r\n * returns the type of the cache (in this case account)\r\n */\r\n generateType(): number {\r\n switch (this.authorityType) {\r\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\r\n return CacheType.ADFS;\r\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\r\n return CacheType.MSA;\r\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\r\n return CacheType.MSSTS;\r\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\r\n return CacheType.GENERIC;\r\n default: {\r\n throw ClientAuthError.createUnexpectedAccountTypeError();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Returns the AccountInfo interface for this account.\r\n */\r\n getAccountInfo(): AccountInfo {\r\n return {\r\n homeAccountId: this.homeAccountId,\r\n environment: this.environment,\r\n tenantId: this.realm,\r\n username: this.username,\r\n localAccountId: this.localAccountId,\r\n name: this.name,\r\n idTokenClaims: this.idTokenClaims\r\n };\r\n }\r\n\r\n /**\r\n * Generates account key from interface\r\n * @param accountInterface\r\n */\r\n static generateAccountCacheKey(accountInterface: AccountInfo): string {\r\n const accountKey = [\r\n accountInterface.homeAccountId,\r\n accountInterface.environment || \"\",\r\n accountInterface.tenantId || \"\",\r\n ];\r\n\r\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\r\n * @param clientInfo\r\n * @param authority\r\n * @param idToken\r\n * @param policy\r\n */\r\n static createAccount(\r\n clientInfo: string,\r\n homeAccountId: string,\r\n authority: Authority,\r\n idToken: AuthToken,\r\n oboAssertion?: string,\r\n cloudGraphHostName?: string,\r\n msGraphHost?: string\r\n ): AccountEntity {\r\n const account: AccountEntity = new AccountEntity();\r\n\r\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\r\n account.clientInfo = clientInfo;\r\n account.homeAccountId = homeAccountId;\r\n\r\n const env = authority.getPreferredCache();\r\n if (StringUtils.isEmpty(env)) {\r\n throw ClientAuthError.createInvalidCacheEnvironmentError();\r\n }\r\n\r\n account.environment = env;\r\n // non AAD scenarios can have empty realm\r\n account.realm = idToken?.claims?.tid || \"\";\r\n account.oboAssertion = oboAssertion;\r\n \r\n if (idToken) {\r\n account.idTokenClaims = idToken.claims;\r\n\r\n // How do you account for MSA CID here?\r\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\r\n\r\n /*\r\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array. In most cases it will contain a single email.\r\n * This field should not be relied upon if a custom policy is configured to return more than 1 email.\r\n */\r\n account.username = idToken?.claims?.preferred_username || (idToken?.claims?.emails? idToken.claims.emails[0]: \"\");\r\n account.name = idToken?.claims?.name;\r\n }\r\n\r\n account.cloudGraphHostName = cloudGraphHostName;\r\n account.msGraphHost = msGraphHost;\r\n\r\n return account;\r\n }\r\n\r\n /**\r\n * Builds non-AAD/ADFS account.\r\n * @param authority\r\n * @param idToken\r\n */\r\n static createGenericAccount(\r\n authority: Authority,\r\n homeAccountId: string,\r\n idToken: AuthToken,\r\n oboAssertion?: string,\r\n cloudGraphHostName?: string,\r\n msGraphHost?: string\r\n ): AccountEntity {\r\n const account: AccountEntity = new AccountEntity();\r\n\r\n account.authorityType = (authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\r\n account.homeAccountId = homeAccountId;\r\n // non AAD scenarios can have empty realm\r\n account.realm = \"\";\r\n account.oboAssertion = oboAssertion;\r\n\r\n const env = authority.getPreferredCache();\r\n\r\n if (StringUtils.isEmpty(env)) {\r\n throw ClientAuthError.createInvalidCacheEnvironmentError();\r\n }\r\n\r\n if (idToken) {\r\n // How do you account for MSA CID here?\r\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\r\n // upn claim for most ADFS scenarios\r\n account.username = idToken?.claims?.upn || \"\";\r\n account.name = idToken?.claims?.name || \"\";\r\n account.idTokenClaims = idToken?.claims;\r\n }\r\n\r\n account.environment = env;\r\n\r\n account.cloudGraphHostName = cloudGraphHostName;\r\n account.msGraphHost = msGraphHost;\r\n\r\n /*\r\n * add uniqueName to claims\r\n * account.name = idToken.claims.uniqueName;\r\n */\r\n\r\n return account;\r\n }\r\n\r\n /**\r\n * Generate HomeAccountId from server response\r\n * @param serverClientInfo\r\n * @param authType\r\n */\r\n static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idToken?: AuthToken): string {\r\n\r\n const accountId = idToken?.claims?.sub ? idToken.claims.sub : Constants.EMPTY_STRING;\r\n\r\n // since ADFS does not have tid and does not set client_info\r\n if (authType === AuthorityType.Adfs) {\r\n return accountId;\r\n }\r\n\r\n // for cases where there is clientInfo\r\n if (serverClientInfo) {\r\n try {\r\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\r\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\r\n return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;\r\n }\r\n } catch (e) {}\r\n }\r\n\r\n // default to \"sub\" claim\r\n logger.verbose(\"No client info in response\");\r\n return accountId;\r\n }\r\n\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isAccountEntity(entity: object): boolean {\r\n\r\n if (!entity) {\r\n return false;\r\n }\r\n\r\n return (\r\n entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"localAccountId\") &&\r\n entity.hasOwnProperty(\"username\") &&\r\n entity.hasOwnProperty(\"authorityType\")\r\n );\r\n }\r\n\r\n /**\r\n * Helper function to determine whether 2 accountInfo objects represent the same account\r\n * @param accountA \r\n * @param accountB \r\n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\r\n */\r\n static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean {\r\n if (!accountA || !accountB) {\r\n return false;\r\n }\r\n\r\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\r\n if (compareClaims) {\r\n const accountAClaims = (accountA.idTokenClaims || {}) as TokenClaims;\r\n const accountBClaims = (accountB.idTokenClaims || {}) as TokenClaims;\r\n\r\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\r\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\r\n (accountAClaims.nonce === accountBClaims.nonce);\r\n }\r\n\r\n return (accountA.homeAccountId === accountB.homeAccountId) && \r\n (accountA.localAccountId === accountB.localAccountId) &&\r\n (accountA.username === accountB.username) &&\r\n (accountA.tenantId === accountB.tenantId) &&\r\n (accountA.environment === accountB.environment) &&\r\n claimsMatch;\r\n }\r\n}\r\n"],"names":["ClientAuthError","StringUtils","AuthorityType","Constants"],"mappings":";;;;;;;;AAAA;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;IAuBA;KAuQC;;;;IApPG,yCAAiB,GAAjB;QACI,IAAM,SAAS,GAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;;;;IAKD,0CAAkB,GAAlB;QACI,OAAO,aAAa,CAAC,uBAAuB,CAAC;YACzC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAC;KACN;;;;IAKD,oCAAY,GAAZ;QACI,QAAQ,IAAI,CAAC,aAAa;YACtB,KAAK,gBAAgB,CAAC,iBAAiB;gBACnC,OAAO,SAAS,CAAC,IAAI,CAAC;YAC1B,KAAK,gBAAgB,CAAC,kBAAkB;gBACpC,OAAO,SAAS,CAAC,GAAG,CAAC;YACzB,KAAK,gBAAgB,CAAC,kBAAkB;gBACpC,OAAO,SAAS,CAAC,KAAK,CAAC;YAC3B,KAAK,gBAAgB,CAAC,oBAAoB;gBACtC,OAAO,SAAS,CAAC,OAAO,CAAC;YAC7B,SAAS;gBACL,MAAMA,iBAAe,CAAC,gCAAgC,EAAE,CAAC;aAC5D;SACJ;KACJ;;;;IAKD,sCAAc,GAAd;QACI,OAAO;YACH,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IA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QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,CAAC;YAC/C,WAAW,CAAC;KACnB;IACL,oBAAC;AAAD,CAAC;;;;"}
1
+ {"version":3,"file":"AccountEntity.js","sources":["../../../src/cache/entities/AccountEntity.ts"],"sourcesContent":["/*\n * Copyright (c) Microsoft Corporation. All rights reserved.\n * Licensed under the MIT License.\n */\n\nimport {\n Separators,\n CacheAccountType,\n CacheType,\n Constants,\n} from \"../../utils/Constants\";\nimport { Authority } from \"../../authority/Authority\";\nimport { AuthToken } from \"../../account/AuthToken\";\nimport { ICrypto } from \"../../crypto/ICrypto\";\nimport { buildClientInfo } from \"../../account/ClientInfo\";\nimport { StringUtils } from \"../../utils/StringUtils\";\nimport { AccountInfo } from \"../../account/AccountInfo\";\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\nimport { AuthorityType } from \"../../authority/AuthorityType\";\nimport { Logger } from \"../../logger/Logger\";\nimport { TokenClaims } from \"../../account/TokenClaims\";\n\n/**\n * Type that defines required and optional parameters for an Account field (based on universal cache schema implemented by all MSALs).\n *\n * Key : Value Schema\n *\n * Key: <home_account_id>-<environment>-<realm*>\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 * realm: Full tenant or organizational identifier that the account belongs to\n * localAccountId: Original tenant-specific accountID, usually used for legacy cases\n * username: primary username that represents the user, usually corresponds to preferred_username in the v2 endpt\n * authorityType: Accounts authority type as a string\n * name: Full name for the account, including given name and family name,\n * clientInfo: Full base64 encoded client info received from ESTS\n * lastModificationTime: last time this entity was modified in the cache\n * lastModificationApp:\n * oboAssertion: access token passed in as part of OBO request\n * idTokenClaims: Object containing claims parsed from ID token\n * }\n */\nexport class AccountEntity {\n homeAccountId: string;\n environment: string;\n realm: string;\n localAccountId: string;\n username: string;\n authorityType: string;\n name?: string;\n clientInfo?: string;\n lastModificationTime?: string;\n lastModificationApp?: string;\n oboAssertion?: string;\n cloudGraphHostName?: string;\n msGraphHost?: string; \n idTokenClaims?: TokenClaims;\n\n /**\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\n */\n generateAccountId(): string {\n const accountId: Array<string> = [this.homeAccountId, this.environment];\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Generate Account Cache Key as per the schema: <home_account_id>-<environment>-<realm*>\n */\n generateAccountKey(): string {\n return AccountEntity.generateAccountCacheKey({\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId\n });\n }\n\n /**\n * returns the type of the cache (in this case account)\n */\n generateType(): number {\n switch (this.authorityType) {\n case CacheAccountType.ADFS_ACCOUNT_TYPE:\n return CacheType.ADFS;\n case CacheAccountType.MSAV1_ACCOUNT_TYPE:\n return CacheType.MSA;\n case CacheAccountType.MSSTS_ACCOUNT_TYPE:\n return CacheType.MSSTS;\n case CacheAccountType.GENERIC_ACCOUNT_TYPE:\n return CacheType.GENERIC;\n default: {\n throw ClientAuthError.createUnexpectedAccountTypeError();\n }\n }\n }\n\n /**\n * Returns the AccountInfo interface for this account.\n */\n getAccountInfo(): AccountInfo {\n return {\n homeAccountId: this.homeAccountId,\n environment: this.environment,\n tenantId: this.realm,\n username: this.username,\n localAccountId: this.localAccountId,\n name: this.name,\n idTokenClaims: this.idTokenClaims\n };\n }\n\n /**\n * Generates account key from interface\n * @param accountInterface\n */\n static generateAccountCacheKey(accountInterface: AccountInfo): string {\n const accountKey = [\n accountInterface.homeAccountId,\n accountInterface.environment || \"\",\n accountInterface.tenantId || \"\",\n ];\n\n return accountKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\n }\n\n /**\n * Build Account cache from IdToken, clientInfo and authority/policy. Associated with AAD.\n * @param clientInfo\n * @param authority\n * @param idToken\n * @param policy\n */\n static createAccount(\n clientInfo: string,\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = CacheAccountType.MSSTS_ACCOUNT_TYPE;\n account.clientInfo = clientInfo;\n account.homeAccountId = homeAccountId;\n\n const env = environment || (authority && authority.getPreferredCache());\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n account.environment = env;\n // non AAD scenarios can have empty realm\n account.realm = idToken?.claims?.tid || \"\";\n account.oboAssertion = oboAssertion;\n \n if (idToken) {\n account.idTokenClaims = idToken.claims;\n\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\n\n /*\n * In B2C scenarios the emails claim is used instead of preferred_username and it is an array. In most cases it will contain a single email.\n * This field should not be relied upon if a custom policy is configured to return more than 1 email.\n */\n account.username = idToken?.claims?.preferred_username || (idToken?.claims?.emails? idToken.claims.emails[0]: \"\");\n account.name = idToken?.claims?.name;\n }\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n return account;\n }\n\n /**\n * Builds non-AAD/ADFS account.\n * @param authority\n * @param idToken\n */\n static createGenericAccount(\n homeAccountId: string,\n idToken: AuthToken,\n authority?: Authority,\n oboAssertion?: string,\n cloudGraphHostName?: string,\n msGraphHost?: string,\n environment?: string\n ): AccountEntity {\n const account: AccountEntity = new AccountEntity();\n\n account.authorityType = (authority && authority.authorityType === AuthorityType.Adfs) ? CacheAccountType.ADFS_ACCOUNT_TYPE : CacheAccountType.GENERIC_ACCOUNT_TYPE;\n account.homeAccountId = homeAccountId;\n // non AAD scenarios can have empty realm\n account.realm = \"\";\n account.oboAssertion = oboAssertion;\n\n const env = environment || authority && authority.getPreferredCache();\n\n if (!env) {\n throw ClientAuthError.createInvalidCacheEnvironmentError();\n }\n\n if (idToken) {\n // How do you account for MSA CID here?\n account.localAccountId = idToken?.claims?.oid || idToken?.claims?.sub || \"\";\n // upn claim for most ADFS scenarios\n account.username = idToken?.claims?.upn || \"\";\n account.name = idToken?.claims?.name || \"\";\n account.idTokenClaims = idToken?.claims;\n }\n\n account.environment = env;\n\n account.cloudGraphHostName = cloudGraphHostName;\n account.msGraphHost = msGraphHost;\n\n /*\n * add uniqueName to claims\n * account.name = idToken.claims.uniqueName;\n */\n\n return account;\n }\n\n /**\n * Generate HomeAccountId from server response\n * @param serverClientInfo\n * @param authType\n */\n static generateHomeAccountId(serverClientInfo: string, authType: AuthorityType, logger: Logger, cryptoObj: ICrypto, idToken?: AuthToken): string {\n\n const accountId = idToken?.claims?.sub ? idToken.claims.sub : Constants.EMPTY_STRING;\n\n // since ADFS does not have tid and does not set client_info\n if (authType === AuthorityType.Adfs) {\n return accountId;\n }\n\n // for cases where there is clientInfo\n if (serverClientInfo) {\n try {\n const clientInfo = buildClientInfo(serverClientInfo, cryptoObj);\n if (!StringUtils.isEmpty(clientInfo.uid) && !StringUtils.isEmpty(clientInfo.utid)) {\n return `${clientInfo.uid}${Separators.CLIENT_INFO_SEPARATOR}${clientInfo.utid}`;\n }\n } catch (e) {}\n }\n\n // default to \"sub\" claim\n logger.verbose(\"No client info in response\");\n return accountId;\n }\n\n /**\n * Validates an entity: checks for all expected params\n * @param entity\n */\n static isAccountEntity(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(\"realm\") &&\n entity.hasOwnProperty(\"localAccountId\") &&\n entity.hasOwnProperty(\"username\") &&\n entity.hasOwnProperty(\"authorityType\")\n );\n }\n\n /**\n * Helper function to determine whether 2 accountInfo objects represent the same account\n * @param accountA \n * @param accountB \n * @param compareClaims - If set to true idTokenClaims will also be compared to determine account equality\n */\n static accountInfoIsEqual(accountA: AccountInfo | null, accountB: AccountInfo | null, compareClaims?: boolean): boolean {\n if (!accountA || !accountB) {\n return false;\n }\n\n let claimsMatch = true; // default to true so as to not fail comparison below if compareClaims: false\n if (compareClaims) {\n const accountAClaims = (accountA.idTokenClaims || {}) as TokenClaims;\n const accountBClaims = (accountB.idTokenClaims || {}) as TokenClaims;\n\n // issued at timestamp and nonce are expected to change each time a new id token is acquired\n claimsMatch = (accountAClaims.iat === accountBClaims.iat) &&\n (accountAClaims.nonce === accountBClaims.nonce);\n }\n\n return (accountA.homeAccountId === accountB.homeAccountId) && \n (accountA.localAccountId === accountB.localAccountId) &&\n (accountA.username === accountB.username) &&\n (accountA.tenantId === accountB.tenantId) &&\n (accountA.environment === accountB.environment) &&\n claimsMatch;\n }\n}\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAsBA;;;;;;;;;;;;;;;;;;;;;;;;IAuBA;KA0QC;;;;IAvPG,yCAAiB,GAAjB;QACI,IAAM,SAAS,GAAkB,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;QACxE,OAAO,SAAS,CAAC,IAAI,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC,WAAW,EAAE,CAAC;KACvE;;;;IAKD,0CAAkB,GAAlB;QACI,OAAO,aAAa,CAAC,uBAAuB,CAAC;YACzC,aAAa,EAAE,IAAI,CAAC,aAAa;YACjC,WAAW,EAAE,IAAI,CAAC,WAAW;YAC7B,QAAQ,EAAE,IAAI,CAAC,KAAK;YACpB,QAAQ,EAAE,IAAI,CAAC,QAAQ;YACvB,cAAc,EAAE,IAAI,CAAC,cAAc;SACtC,CAAC,CAAC;KACN;;;;IAKD,oCAAY,GAAZ;QACI,QAAQ,IAAI,CAAC,aAAa;YACtB,KAAK,gBAAgB,CAAC,iBAAiB;gBACnC,OAAO,SAAS,CAAC,IAAI,CAAC;YAC1B,KAAK,gBAAgB,CAAC,kBAAkB;gBACpC,OAAO,SAAS,CAAC,GAAG,CAAC;YACzB,KAAK,g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AAC,aAAa,IAAI,EAAE,CAAgB,CAAC;YACrE,IAAM,cAAc,IAAI,QAAQ,CAAC,aAAa,IAAI,EAAE,CAAgB,CAAC;;YAGrE,WAAW,GAAG,CAAC,cAAc,CAAC,GAAG,KAAK,cAAc,CAAC,GAAG;iBACvD,cAAc,CAAC,KAAK,KAAK,cAAc,CAAC,KAAK,CAAC,CAAC;SACnD;QAED,OAAO,CAAC,QAAQ,CAAC,aAAa,KAAK,QAAQ,CAAC,aAAa;aACpD,QAAQ,CAAC,cAAc,KAAK,QAAQ,CAAC,cAAc,CAAC;aACpD,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,QAAQ,KAAK,QAAQ,CAAC,QAAQ,CAAC;aACxC,QAAQ,CAAC,WAAW,KAAK,QAAQ,CAAC,WAAW,CAAC;YAC/C,WAAW,CAAC;KACnB;IACL,oBAAC;AAAD,CAAC;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { Separators, APP_METADATA } from '../../utils/Constants.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"AppMetadataEntity.js","sources":["../../../src/cache/entities/AppMetadataEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { APP_METADATA, Separators } from \"../../utils/Constants\";\r\n\r\n/**\r\n * APP_METADATA Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key: appmetadata-<environment>-<client_id>\r\n *\r\n * Value:\r\n * {\r\n * clientId: client ID of the application\r\n * environment: entity that issued the token, represented as a full host\r\n * familyId: Family ID identifier, '1' represents Microsoft Family\r\n * }\r\n */\r\nexport class AppMetadataEntity {\r\n clientId: string;\r\n environment: string;\r\n familyId?: string;\r\n\r\n /**\r\n * Generate AppMetadata Cache Key as per the schema: appmetadata-<environment>-<client_id>\r\n */\r\n generateAppMetadataKey(): string {\r\n return AppMetadataEntity.generateAppMetadataCacheKey(this.environment, this.clientId);\r\n }\r\n\r\n /**\r\n * Generate AppMetadata Cache Key\r\n */\r\n static generateAppMetadataCacheKey(environment: string, clientId: string): string {\r\n const appMetaDataKeyArray: Array<string> = [\r\n APP_METADATA,\r\n environment,\r\n clientId,\r\n ];\r\n return appMetaDataKeyArray.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Creates AppMetadataEntity\r\n * @param clientId\r\n * @param environment\r\n * @param familyId\r\n */\r\n static createAppMetadataEntity(clientId: string, environment: string, familyId?: string): AppMetadataEntity {\r\n const appMetadata = new AppMetadataEntity();\r\n\r\n appMetadata.clientId = clientId;\r\n appMetadata.environment = environment;\r\n if (familyId) {\r\n appMetadata.familyId = familyId;\r\n }\r\n\r\n return appMetadata;\r\n }\r\n\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isAppMetadataEntity(key: string, entity: object): boolean {\r\n\r\n if (!entity) {\r\n return false;\r\n }\r\n\r\n return (\r\n key.indexOf(APP_METADATA) === 0 &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"environment\")\r\n );\r\n }\r\n}\r\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;;;;"}
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;;;;"}
@@ -7,7 +7,7 @@ export declare class AuthorityMetadataEntity {
7
7
  canonical_authority: string;
8
8
  authorization_endpoint: string;
9
9
  token_endpoint: string;
10
- end_session_endpoint: string;
10
+ end_session_endpoint?: string;
11
11
  issuer: string;
12
12
  aliasesFromNetwork: boolean;
13
13
  endpointsFromNetwork: boolean;
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorityMetadataEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/AuthorityMetadataEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,sBAAsB,EAAE,MAAM,wCAAwC,CAAC;AAChF,OAAO,EAAE,oBAAoB,EAAE,MAAM,sCAAsC,CAAC;AAI5E,qBAAa,uBAAuB;IAChC,OAAO,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACvB,eAAe,EAAE,MAAM,CAAC;IACxB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,cAAc,EAAE,MAAM,CAAC;IACvB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,MAAM,EAAE,MAAM,CAAC;IACf,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,SAAS,EAAE,MAAM,CAAC;;IAMlB;;;;OAIG;IACH,4BAA4B,CAAC,QAAQ,EAAE,sBAAsB,EAAE,WAAW,EAAE,OAAO,GAAG,IAAI;IAO1F;;;;OAIG;IACH,sBAAsB,CAAC,QAAQ,E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IAIpB;;;OAGG;IACH,MAAM,CAAC,yBAAyB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO;CAoBzE"}
@@ -1,7 +1,7 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { AUTHORITY_METADATA_CONSTANTS } from '../../utils/Constants.js';
4
- import { TimeUtils as TimeUtils$1 } from '../../utils/TimeUtils.js';
4
+ import { TimeUtils } from '../../utils/TimeUtils.js';
5
5
 
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -9,7 +9,7 @@ import { TimeUtils as TimeUtils$1 } from '../../utils/TimeUtils.js';
9
9
  */
10
10
  var AuthorityMetadataEntity = /** @class */ (function () {
11
11
  function AuthorityMetadataEntity() {
12
- this.expiresAt = TimeUtils$1.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
12
+ this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
13
13
  }
14
14
  /**
15
15
  * Update the entity with new aliases, preferred_cache and preferred_network values
@@ -45,13 +45,13 @@ var AuthorityMetadataEntity = /** @class */ (function () {
45
45
  * Reset the exiresAt value
46
46
  */
47
47
  AuthorityMetadataEntity.prototype.resetExpiresAt = function () {
48
- this.expiresAt = TimeUtils$1.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
48
+ this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;
49
49
  };
50
50
  /**
51
51
  * Returns whether or not the data needs to be refreshed
52
52
  */
53
53
  AuthorityMetadataEntity.prototype.isExpired = function () {
54
- return this.expiresAt <= TimeUtils$1.nowSeconds();
54
+ return this.expiresAt <= TimeUtils.nowSeconds();
55
55
  };
56
56
  /**
57
57
  * Validates an entity: checks for all expected params
@@ -68,7 +68,6 @@ var AuthorityMetadataEntity = /** @class */ (function () {
68
68
  entity.hasOwnProperty("canonical_authority") &&
69
69
  entity.hasOwnProperty("authorization_endpoint") &&
70
70
  entity.hasOwnProperty("token_endpoint") &&
71
- entity.hasOwnProperty("end_session_endpoint") &&
72
71
  entity.hasOwnProperty("issuer") &&
73
72
  entity.hasOwnProperty("aliasesFromNetwork") &&
74
73
  entity.hasOwnProperty("endpointsFromNetwork") &&
@@ -1 +1 @@
1
- {"version":3,"file":"AuthorityMetadataEntity.js","sources":["../../../src/cache/entities/AuthorityMetadataEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CloudDiscoveryMetadata } from \"../../authority/CloudDiscoveryMetadata\";\r\nimport { OpenIdConfigResponse } from \"../../authority/OpenIdConfigResponse\";\r\nimport { AUTHORITY_METADATA_CONSTANTS } from \"../../utils/Constants\";\r\nimport { TimeUtils } from \"../../utils/TimeUtils\";\r\n\r\nexport class AuthorityMetadataEntity {\r\n aliases: Array<string>;\r\n preferred_cache: string;\r\n preferred_network: string;\r\n canonical_authority: string;\r\n authorization_endpoint: string;\r\n token_endpoint: string;\r\n end_session_endpoint: string;\r\n issuer: string;\r\n aliasesFromNetwork: boolean;\r\n endpointsFromNetwork: boolean;\r\n expiresAt: number;\r\n\r\n constructor() {\r\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\r\n }\r\n\r\n /**\r\n * Update the entity with new aliases, preferred_cache and preferred_network values\r\n * @param metadata \r\n * @param fromNetwork \r\n */\r\n updateCloudDiscoveryMetadata(metadata: CloudDiscoveryMetadata, fromNetwork: boolean): void {\r\n this.aliases = metadata.aliases;\r\n this.preferred_cache = metadata.preferred_cache;\r\n this.preferred_network = metadata.preferred_network;\r\n this.aliasesFromNetwork = fromNetwork;\r\n }\r\n\r\n /**\r\n * Update the entity with new endpoints\r\n * @param metadata \r\n * @param fromNetwork \r\n */\r\n updateEndpointMetadata(metadata: OpenIdConfigResponse, fromNetwork: boolean): void {\r\n this.authorization_endpoint = metadata.authorization_endpoint;\r\n this.token_endpoint = metadata.token_endpoint;\r\n this.end_session_endpoint = metadata.end_session_endpoint;\r\n this.issuer = metadata.issuer;\r\n this.endpointsFromNetwork = fromNetwork;\r\n }\r\n\r\n /**\r\n * Save the authority that was used to create this cache entry\r\n * @param authority \r\n */\r\n updateCanonicalAuthority(authority: string): void {\r\n this.canonical_authority = authority;\r\n }\r\n\r\n /**\r\n * Reset the exiresAt value\r\n */\r\n resetExpiresAt(): void {\r\n this.expiresAt = TimeUtils.nowSeconds() + AUTHORITY_METADATA_CONSTANTS.REFRESH_TIME_SECONDS;\r\n }\r\n\r\n /**\r\n * Returns whether or not the data needs to be refreshed\r\n */\r\n isExpired(): boolean {\r\n return this.expiresAt <= TimeUtils.nowSeconds();\r\n }\r\n\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isAuthorityMetadataEntity(key: string, entity: object): boolean {\r\n\r\n if (!entity) {\r\n return false;\r\n }\r\n\r\n return (\r\n key.indexOf(AUTHORITY_METADATA_CONSTANTS.CACHE_KEY) === 0 &&\r\n entity.hasOwnProperty(\"aliases\") &&\r\n entity.hasOwnProperty(\"preferred_cache\") &&\r\n entity.hasOwnProperty(\"preferred_network\") &&\r\n entity.hasOwnProperty(\"canonical_authority\") &&\r\n entity.hasOwnProperty(\"authorization_endpoint\") &&\r\n entity.hasOwnProperty(\"token_endpoint\") &&\r\n entity.hasOwnProperty(\"end_session_endpoint\") &&\r\n entity.hasOwnProperty(\"issuer\") &&\r\n entity.hasOwnProperty(\"aliasesFromNetwork\") &&\r\n entity.hasOwnProperty(\"endpointsFromNetwork\") &&\r\n entity.hasOwnProperty(\"expiresAt\")\r\n );\r\n }\r\n}\r\n"],"names":["TimeUtils"],"mappings":";;;;;AAAA;;;;;IAuBI;QACI,I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AS,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;;;;"}
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(\"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;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BAAmB,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,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;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  /*
4
4
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -1 +1 @@
1
- {"version":3,"file":"CacheRecord.js","sources":["../../../src/cache/entities/CacheRecord.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { IdTokenEntity } from \"./IdTokenEntity\";\r\nimport { AccessTokenEntity } from \"./AccessTokenEntity\";\r\nimport { RefreshTokenEntity } from \"./RefreshTokenEntity\";\r\nimport { AccountEntity } from \"./AccountEntity\";\r\nimport { AppMetadataEntity } from \"./AppMetadataEntity\";\r\n\r\nexport class CacheRecord {\r\n account: AccountEntity | null;\r\n idToken: IdTokenEntity | null;\r\n accessToken: AccessTokenEntity | null;\r\n refreshToken: RefreshTokenEntity | null;\r\n appMetadata: AppMetadataEntity | null;\r\n\r\n constructor(accountEntity?: AccountEntity | null, idTokenEntity?: IdTokenEntity | null, accessTokenEntity?: AccessTokenEntity | null, refreshTokenEntity?: RefreshTokenEntity | null, appMetadataEntity?: AppMetadataEntity | null) {\r\n this.account = accountEntity || null;\r\n this.idToken = idTokenEntity || null;\r\n this.accessToken = accessTokenEntity || null;\r\n this.refreshToken = refreshTokenEntity || null;\r\n this.appMetadata = appMetadataEntity || null;\r\n }\r\n}\r\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;;;;"}
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;;;;"}
@@ -1,10 +1,10 @@
1
- import { CredentialType } from "../../utils/Constants";
1
+ import { CredentialType, AuthenticationScheme } from "../../utils/Constants";
2
2
  /**
3
3
  * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc
4
4
  *
5
5
  * Key:Value Schema:
6
6
  *
7
- * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>
7
+ * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme>
8
8
  *
9
9
  * Value Schema:
10
10
  * {
@@ -17,6 +17,7 @@ import { CredentialType } from "../../utils/Constants";
17
17
  * realm: Full tenant or organizational identifier that the account belongs to
18
18
  * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
19
19
  * oboAssertion: access token passed in as part of OBO request
20
+ * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
20
21
  * }
21
22
  */
22
23
  export declare class CredentialEntity {
@@ -29,6 +30,8 @@ export declare class CredentialEntity {
29
30
  realm?: string;
30
31
  target?: string;
31
32
  oboAssertion?: string;
33
+ tokenType?: AuthenticationScheme;
34
+ keyId?: string;
32
35
  /**
33
36
  * Generate Account Id key component as per the schema: <home_account_id>-<environment>
34
37
  */
@@ -56,8 +59,9 @@ export declare class CredentialEntity {
56
59
  static getCredentialType(key: string): string;
57
60
  /**
58
61
  * generates credential key
62
+ * <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
59
63
  */
60
- static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string): string;
64
+ static generateCredentialCacheKey(homeAccountId: string, environment: string, credentialType: CredentialType, clientId: string, realm?: string, target?: string, familyId?: string, tokenType?: AuthenticationScheme): string;
61
65
  /**
62
66
  * generates Account Id for keys
63
67
  * @param homeAccountId
@@ -1 +1 @@
1
- {"version":3,"file":"CredentialEntity.d.ts","sourceRoot":"","sources":["../../../src/cache/entities/CredentialEntity.ts"],"names":[],"mappings":"AAKA,OAAO,EAAc,cAAc,EAAwB,MAAM,uBAAuB,CAAC;AAGzF;;;;;;;;;;;;;;;;;;;GAmBG;AACH,qBAAa,gBAAgB;IACzB,aAAa,EAAE,MAAM,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,cAAc,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;OAEG;IACH,iBAAiB,IAAI,MAAM;IAI3B;;OAEG;IACH,oBAAoB,IAAI,MAAM;IAS9B;;OAEG;IACH,cAAc,IAAI,MAAM;IAIxB;;OAEG;IACH,qBAAqB,IAAI,MAAM;IAY/B;;OAEG;IACH,YAAY,IAAI,MAAM;IActB;;;OAGG;IACH,MAAM,CAAC,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM;IAiB7C;;OAEG;IACH,MAAM,CAAC,0BAA0B,CAC7B,aAAa,EAAE,MAAM,EACrB,WAAW,EAAE,MAAM,EACnB,cAAc,EAAE,cAAc,EAC9B,QAAQ,EAAE,MAAM,EAChB,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,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,KAAK,CAAC,EAAE,MAAM,EACd,MAAM,CAAC,EAAE,MAAM,EACf,QAAQ,CAAC,EAAE,MAAM,EACjB,SAAS,CAAC,EAAE,oBAAoB,GACjC,MAAM;IAeT;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,4BAA4B;IAQ3C;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,+BAA+B;IAmB9C;;OAEG;IACH,OAAO,CAAC,MAAM,CAAC,yBAAyB;CAG3C"}
@@ -1,7 +1,7 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
- import { CredentialType, CacheType, Constants as Constants$1, Separators } from '../../utils/Constants.js';
4
- import { ClientAuthError as ClientAuthError$1 } from '../../error/ClientAuthError.js';
3
+ import { CredentialType, CacheType, Constants, AuthenticationScheme, Separators } from '../../utils/Constants.js';
4
+ import { ClientAuthError } from '../../error/ClientAuthError.js';
5
5
 
6
6
  /*
7
7
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -12,7 +12,7 @@ import { ClientAuthError as ClientAuthError$1 } from '../../error/ClientAuthErro
12
12
  *
13
13
  * Key:Value Schema:
14
14
  *
15
- * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>
15
+ * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>-<scheme>
16
16
  *
17
17
  * Value Schema:
18
18
  * {
@@ -25,6 +25,7 @@ import { ClientAuthError as ClientAuthError$1 } from '../../error/ClientAuthErro
25
25
  * realm: Full tenant or organizational identifier that the account belongs to
26
26
  * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.
27
27
  * oboAssertion: access token passed in as part of OBO request
28
+ * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)
28
29
  * }
29
30
  */
30
31
  var CredentialEntity = /** @class */ (function () {
@@ -52,7 +53,7 @@ var CredentialEntity = /** @class */ (function () {
52
53
  * generates credential key
53
54
  */
54
55
  CredentialEntity.prototype.generateCredentialKey = function () {
55
- return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId);
56
+ return CredentialEntity.generateCredentialCacheKey(this.homeAccountId, this.environment, this.credentialType, this.clientId, this.realm, this.target, this.familyId, this.tokenType);
56
57
  };
57
58
  /**
58
59
  * returns the type of the cache (in this case credential)
@@ -62,11 +63,12 @@ var CredentialEntity = /** @class */ (function () {
62
63
  case CredentialType.ID_TOKEN:
63
64
  return CacheType.ID_TOKEN;
64
65
  case CredentialType.ACCESS_TOKEN:
66
+ case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:
65
67
  return CacheType.ACCESS_TOKEN;
66
68
  case CredentialType.REFRESH_TOKEN:
67
69
  return CacheType.REFRESH_TOKEN;
68
70
  default: {
69
- throw ClientAuthError$1.createUnexpectedCredentialTypeError();
71
+ throw ClientAuthError.createUnexpectedCredentialTypeError();
70
72
  }
71
73
  }
72
74
  };
@@ -89,17 +91,22 @@ var CredentialEntity = /** @class */ (function () {
89
91
  else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {
90
92
  return CredentialType.REFRESH_TOKEN;
91
93
  }
92
- return Constants$1.NOT_DEFINED;
94
+ return Constants.NOT_DEFINED;
93
95
  };
94
96
  /**
95
97
  * generates credential key
98
+ * <home_account_id*>-\<environment>-<credential_type>-<client_id>-<realm\*>-<target\*>-<scheme\*>
96
99
  */
97
- CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId) {
100
+ CredentialEntity.generateCredentialCacheKey = function (homeAccountId, environment, credentialType, clientId, realm, target, familyId, tokenType) {
98
101
  var credentialKey = [
99
102
  this.generateAccountIdForCacheKey(homeAccountId, environment),
100
103
  this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),
101
- this.generateTargetForCacheKey(target),
104
+ this.generateTargetForCacheKey(target)
102
105
  ];
106
+ // PoP Tokens and SSH certs include scheme in cache key
107
+ if (tokenType && tokenType !== AuthenticationScheme.BEARER) {
108
+ credentialKey.push(tokenType.toLowerCase());
109
+ }
103
110
  return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();
104
111
  };
105
112
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"CredentialEntity.js","sources":["../../../src/cache/entities/CredentialEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { Separators, CredentialType, CacheType, Constants } from \"../../utils/Constants\";\r\nimport { ClientAuthError } from \"../../error/ClientAuthError\";\r\n\r\n/**\r\n * Base type for credentials to be stored in the cache: eg: ACCESS_TOKEN, ID_TOKEN etc\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key: <home_account_id*>-<environment>-<credential_type>-<client_id>-<realm*>-<target*>\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, usually only used for refresh tokens\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * oboAssertion: access token passed in as part of OBO request\r\n * }\r\n */\r\nexport class CredentialEntity {\r\n homeAccountId: string;\r\n environment: string;\r\n credentialType: CredentialType;\r\n clientId: string;\r\n secret: string;\r\n familyId?: string;\r\n realm?: string;\r\n target?: string;\r\n oboAssertion?: string;\r\n\r\n /**\r\n * Generate Account Id key component as per the schema: <home_account_id>-<environment>\r\n */\r\n generateAccountId(): string {\r\n return CredentialEntity.generateAccountIdForCacheKey(this.homeAccountId, this.environment);\r\n }\r\n\r\n /**\r\n * Generate Credential Id key component as per the schema: <credential_type>-<client_id>-<realm>\r\n */\r\n generateCredentialId(): string {\r\n return CredentialEntity.generateCredentialIdForCacheKey(\r\n this.credentialType,\r\n this.clientId,\r\n this.realm,\r\n this.familyId\r\n );\r\n }\r\n\r\n /**\r\n * Generate target key component as per schema: <target>\r\n */\r\n generateTarget(): string {\r\n return CredentialEntity.generateTargetForCacheKey(this.target);\r\n }\r\n\r\n /**\r\n * generates credential key\r\n */\r\n generateCredentialKey(): string {\r\n return CredentialEntity.generateCredentialCacheKey(\r\n this.homeAccountId,\r\n this.environment,\r\n this.credentialType,\r\n this.clientId,\r\n this.realm,\r\n this.target,\r\n this.familyId\r\n );\r\n }\r\n\r\n /**\r\n * returns the type of the cache (in this case credential)\r\n */\r\n generateType(): number {\r\n switch (this.credentialType) {\r\n case CredentialType.ID_TOKEN:\r\n return CacheType.ID_TOKEN;\r\n case CredentialType.ACCESS_TOKEN:\r\n return CacheType.ACCESS_TOKEN;\r\n case CredentialType.REFRESH_TOKEN:\r\n return CacheType.REFRESH_TOKEN;\r\n default: {\r\n throw ClientAuthError.createUnexpectedCredentialTypeError();\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * helper function to return `CredentialType`\r\n * @param key\r\n */\r\n static getCredentialType(key: string): string {\r\n // First keyword search will match all \"AccessToken\" and \"AccessToken_With_AuthScheme\" credentials\r\n if (key.indexOf(CredentialType.ACCESS_TOKEN.toLowerCase()) !== -1) {\r\n // Perform second search to differentiate between \"AccessToken\" and \"AccessToken_With_AuthScheme\" credential types\r\n if (key.indexOf(CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME.toLowerCase()) !== -1) {\r\n return CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME;\r\n }\r\n return CredentialType.ACCESS_TOKEN;\r\n } else if (key.indexOf(CredentialType.ID_TOKEN.toLowerCase()) !== -1) {\r\n return CredentialType.ID_TOKEN;\r\n } else if (key.indexOf(CredentialType.REFRESH_TOKEN.toLowerCase()) !== -1) {\r\n return CredentialType.REFRESH_TOKEN;\r\n }\r\n\r\n return Constants.NOT_DEFINED;\r\n }\r\n\r\n /**\r\n * generates credential key\r\n */\r\n static generateCredentialCacheKey(\r\n homeAccountId: string,\r\n environment: string,\r\n credentialType: CredentialType,\r\n clientId: string,\r\n realm?: string,\r\n target?: string,\r\n familyId?: string\r\n ): string {\r\n const credentialKey = [\r\n this.generateAccountIdForCacheKey(homeAccountId, environment),\r\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\r\n this.generateTargetForCacheKey(target),\r\n ];\r\n\r\n return credentialKey.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * generates Account Id for keys\r\n * @param homeAccountId\r\n * @param environment\r\n */\r\n private static generateAccountIdForCacheKey(\r\n homeAccountId: string,\r\n environment: string\r\n ): string {\r\n const accountId: Array<string> = [homeAccountId, environment];\r\n return accountId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generates Credential Id for keys\r\n * @param credentialType\r\n * @param realm\r\n * @param clientId\r\n * @param familyId\r\n */\r\n private static generateCredentialIdForCacheKey(\r\n credentialType: CredentialType,\r\n clientId: string,\r\n realm?: string,\r\n familyId?: string\r\n ): string {\r\n const clientOrFamilyId =\r\n credentialType === CredentialType.REFRESH_TOKEN\r\n ? familyId || clientId\r\n : clientId;\r\n const credentialId: Array<string> = [\r\n credentialType,\r\n clientOrFamilyId,\r\n realm || \"\",\r\n ];\r\n\r\n return credentialId.join(Separators.CACHE_KEY_SEPARATOR).toLowerCase();\r\n }\r\n\r\n /**\r\n * Generate target key component as per schema: <target>\r\n */\r\n private static generateTargetForCacheKey(scopes?: string): string {\r\n return (scopes || \"\").toLowerCase();\r\n }\r\n}\r\n"],"names":["ClientAuthError","Constants"],"mappings":";;;;;AAAA;;;;AAQA;;;;;;;;;;;;;;;;;;;;;IAoBA;KA4JC;;;;IA9IG,4CAAiB,GAAjB;QACI,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,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,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;;;;"}
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, AuthenticationScheme } 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*>-<scheme>\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 * tokenType: Matches the authentication scheme for which the token was issued (i.e. Bearer or pop)\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 tokenType?: AuthenticationScheme;\n keyId?: 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 this.tokenType\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 case CredentialType.ACCESS_TOKEN_WITH_AUTH_SCHEME:\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 * <home_account_id*>-\\<environment>-<credential_type>-<client_id>-<realm\\*>-<target\\*>-<scheme\\*>\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 tokenType?: AuthenticationScheme\n ): string {\n const credentialKey = [\n this.generateAccountIdForCacheKey(homeAccountId, environment),\n this.generateCredentialIdForCacheKey(credentialType, clientId, realm, familyId),\n this.generateTargetForCacheKey(target)\n ];\n\n // PoP Tokens and SSH certs include scheme in cache key\n if (tokenType && tokenType !== AuthenticationScheme.BEARER) {\n credentialKey.push(tokenType.toLowerCase());\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;;;;;;;;;;;;;;;;;;;;;;IAqBA;KAuKC;;;;IAvJG,4CAAiB,GAAjB;QACI,OAAO,gBAAgB,CAAC,4BAA4B,CAAC,IAAI,CAAC,aAAa,EAAE,IAAI,CAAC,WAAW,CAAC,CAAC;KAC9F;;;;I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AgB,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;;;;"}
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { __extends } from '../../_virtual/_tslib.js';
4
+ import { CredentialEntity } from './CredentialEntity.js';
4
5
  import { CredentialType } from '../../utils/Constants.js';
5
- import { CredentialEntity as CredentialEntity$1 } from './CredentialEntity.js';
6
6
 
7
7
  /*
8
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -65,7 +65,7 @@ var IdTokenEntity = /** @class */ (function (_super) {
65
65
  entity["credentialType"] === CredentialType.ID_TOKEN);
66
66
  };
67
67
  return IdTokenEntity;
68
- }(CredentialEntity$1));
68
+ }(CredentialEntity));
69
69
 
70
70
  export { IdTokenEntity };
71
71
  //# sourceMappingURL=IdTokenEntity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IdTokenEntity.js","sources":["../../../src/cache/entities/IdTokenEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CredentialEntity } from \"./CredentialEntity\";\r\nimport { CredentialType } from \"../../utils/Constants\";\r\n\r\n/**\r\n * ID_TOKEN Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key Example: uid.utid-login.microsoftonline.com-idtoken-clientId-contoso.com-\r\n *\r\n * Value Schema:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * }\r\n */\r\nexport class IdTokenEntity extends CredentialEntity {\r\n realm: string;\r\n\r\n /**\r\n * Create IdTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\n static createIdTokenEntity(\r\n homeAccountId: string,\r\n environment: string,\r\n idToken: string,\r\n clientId: string,\r\n tenantId: string,\r\n oboAssertion?: string\r\n ): IdTokenEntity {\r\n const idTokenEntity = new IdTokenEntity();\r\n\r\n idTokenEntity.credentialType = CredentialType.ID_TOKEN;\r\n idTokenEntity.homeAccountId = homeAccountId;\r\n idTokenEntity.environment = environment;\r\n idTokenEntity.clientId = clientId;\r\n idTokenEntity.secret = idToken;\r\n idTokenEntity.realm = tenantId;\r\n idTokenEntity.oboAssertion = oboAssertion;\r\n\r\n return idTokenEntity;\r\n }\r\n\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isIdTokenEntity(entity: object): boolean {\r\n\r\n if (!entity) {\r\n return false;\r\n }\r\n\r\n return (\r\n entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"realm\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\") &&\r\n entity[\"credentialType\"] === CredentialType.ID_TOKEN\r\n );\r\n }\r\n}\r\n"],"names":["CredentialEntity"],"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,CAAmCA,kBAAgB;;;;"}
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;;;;"}
@@ -1,8 +1,8 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { __extends } from '../../_virtual/_tslib.js';
4
+ import { CredentialEntity } from './CredentialEntity.js';
4
5
  import { CredentialType } from '../../utils/Constants.js';
5
- import { CredentialEntity as CredentialEntity$1 } from './CredentialEntity.js';
6
6
 
7
7
  /*
8
8
  * Copyright (c) Microsoft Corporation. All rights reserved.
@@ -67,7 +67,7 @@ var RefreshTokenEntity = /** @class */ (function (_super) {
67
67
  entity["credentialType"] === CredentialType.REFRESH_TOKEN);
68
68
  };
69
69
  return RefreshTokenEntity;
70
- }(CredentialEntity$1));
70
+ }(CredentialEntity));
71
71
 
72
72
  export { RefreshTokenEntity };
73
73
  //# sourceMappingURL=RefreshTokenEntity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"RefreshTokenEntity.js","sources":["../../../src/cache/entities/RefreshTokenEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { CredentialEntity } from \"./CredentialEntity\";\r\nimport { CredentialType } from \"../../utils/Constants\";\r\n\r\n/**\r\n * REFRESH_TOKEN Cache\r\n *\r\n * Key:Value Schema:\r\n *\r\n * Key Example: uid.utid-login.microsoftonline.com-refreshtoken-clientId--\r\n *\r\n * Value:\r\n * {\r\n * homeAccountId: home account identifier for the auth scheme,\r\n * environment: entity that issued the token, represented as a full host\r\n * credentialType: Type of credential as a string, can be one of the following: RefreshToken, AccessToken, IdToken, Password, Cookie, Certificate, Other\r\n * clientId: client ID of the application\r\n * secret: Actual credential as a string\r\n * familyId: Family ID identifier, '1' represents Microsoft Family\r\n * realm: Full tenant or organizational identifier that the account belongs to\r\n * target: Permissions that are included in the token, or for refresh tokens, the resource identifier.\r\n * }\r\n */\r\nexport class RefreshTokenEntity extends CredentialEntity {\r\n familyId?: string;\r\n\r\n /**\r\n * Create RefreshTokenEntity\r\n * @param homeAccountId\r\n * @param authenticationResult\r\n * @param clientId\r\n * @param authority\r\n */\r\n static createRefreshTokenEntity(\r\n homeAccountId: string,\r\n environment: string,\r\n refreshToken: string,\r\n clientId: string,\r\n familyId?: string,\r\n oboAssertion?: string\r\n ): RefreshTokenEntity {\r\n const rtEntity = new RefreshTokenEntity();\r\n\r\n rtEntity.clientId = clientId;\r\n rtEntity.credentialType = CredentialType.REFRESH_TOKEN;\r\n rtEntity.environment = environment;\r\n rtEntity.homeAccountId = homeAccountId;\r\n rtEntity.secret = refreshToken;\r\n rtEntity.oboAssertion = oboAssertion;\r\n\r\n if (familyId)\r\n rtEntity.familyId = familyId;\r\n\r\n return rtEntity;\r\n }\r\n\r\n /**\r\n * Validates an entity: checks for all expected params\r\n * @param entity\r\n */\r\n static isRefreshTokenEntity(entity: object): boolean {\r\n\r\n if (!entity) {\r\n return false;\r\n }\r\n\r\n return (\r\n entity.hasOwnProperty(\"homeAccountId\") &&\r\n entity.hasOwnProperty(\"environment\") &&\r\n entity.hasOwnProperty(\"credentialType\") &&\r\n entity.hasOwnProperty(\"clientId\") &&\r\n entity.hasOwnProperty(\"secret\") &&\r\n entity[\"credentialType\"] === CredentialType.REFRESH_TOKEN\r\n );\r\n }\r\n}\r\n"],"names":["CredentialEntity"],"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,CAAwCA,kBAAgB;;;;"}
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;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { SERVER_TELEM_CONSTANTS } from '../../utils/Constants.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"ServerTelemetryEntity.js","sources":["../../../src/cache/entities/ServerTelemetryEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { SERVER_TELEM_CONSTANTS } from \"../../utils/Constants\";\r\n\r\nexport class ServerTelemetryEntity {\r\n failedRequests: Array<string|number>;\r\n errors: string[];\r\n cacheHits: number;\r\n\r\n constructor() {\r\n this.failedRequests = [];\r\n this.errors = [];\r\n this.cacheHits = 0;\r\n }\r\n\r\n /**\r\n * validates if a given cache entry is \"Telemetry\", parses <key,value>\r\n * @param key\r\n * @param entity\r\n */\r\n static isServerTelemetryEntity(key: string, entity?: object): boolean {\r\n\r\n const validateKey: boolean = key.indexOf(SERVER_TELEM_CONSTANTS.CACHE_KEY) === 0;\r\n let validateEntity: boolean = true;\r\n\r\n if (entity) {\r\n validateEntity =\r\n entity.hasOwnProperty(\"failedRequests\") &&\r\n entity.hasOwnProperty(\"errors\") &&\r\n entity.hasOwnProperty(\"cacheHits\");\r\n }\r\n\r\n return validateKey && validateEntity;\r\n }\r\n}\r\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;;;;"}
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;;;;"}
@@ -1,4 +1,4 @@
1
- /*! @azure/msal-common v4.5.0 2021-07-22 */
1
+ /*! @azure/msal-common v5.1.0 2021-11-02 */
2
2
  'use strict';
3
3
  import { ThrottlingConstants } from '../../utils/Constants.js';
4
4
 
@@ -1 +1 @@
1
- {"version":3,"file":"ThrottlingEntity.js","sources":["../../../src/cache/entities/ThrottlingEntity.ts"],"sourcesContent":["/*\r\n * Copyright (c) Microsoft Corporation. All rights reserved.\r\n * Licensed under the MIT License.\r\n */\r\n\r\nimport { ThrottlingConstants } from \"../../utils/Constants\";\r\n\r\nexport class ThrottlingEntity {\r\n // Unix-time value representing the expiration of the throttle\r\n throttleTime: number;\r\n // Information provided by the server\r\n error?: string;\r\n errorCodes?: Array<string>;\r\n errorMessage?: string;\r\n subError?: string;\r\n\r\n /**\r\n * validates if a given cache entry is \"Throttling\", parses <key,value>\r\n * @param key\r\n * @param entity\r\n */\r\n static isThrottlingEntity(key: string, entity?: object): boolean {\r\n \r\n let validateKey: boolean = false;\r\n if (key) {\r\n validateKey = key.indexOf(ThrottlingConstants.THROTTLING_PREFIX) === 0;\r\n }\r\n \r\n let validateEntity: boolean = true;\r\n if (entity) {\r\n validateEntity = entity.hasOwnProperty(\"throttleTime\");\r\n }\r\n\r\n return validateKey && validateEntity;\r\n }\r\n}\r\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;;;;"}
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;;;;"}
@@ -116,7 +116,7 @@ export interface ICacheManager {
116
116
  * saves a cache record
117
117
  * @param cacheRecord
118
118
  */
119
- saveCacheRecord(cacheRecord: CacheRecord): void;
119
+ saveCacheRecord(cacheRecord: CacheRecord): Promise<void>;
120
120
  /**
121
121
  * retrieve accounts matching all provided filters; if no filter is set, get all accounts
122
122
  * @param homeAccountId
@@ -137,21 +137,21 @@ export interface ICacheManager {
137
137
  /**
138
138
  * Removes all accounts and related tokens from cache.
139
139
  */
140
- removeAllAccounts(): boolean;
140
+ removeAllAccounts(): Promise<boolean>;
141
141
  /**
142
142
  * returns a boolean if the given account is removed
143
143
  * @param account
144
144
  */
145
- removeAccount(accountKey: string): boolean;
145
+ removeAccount(accountKey: string): Promise<boolean>;
146
146
  /**
147
147
  * returns a boolean if the given account is removed
148
148
  * @param account
149
149
  */
150
- removeAccountContext(account: AccountEntity): boolean;
150
+ removeAccountContext(account: AccountEntity): Promise<boolean>;
151
151
  /**
152
152
  * returns a boolean if the given credential is removed
153
153
  * @param credential
154
154
  */
155
- removeCredential(credential: CredentialEntity): boolean;
155
+ removeCredential(credential: CredentialEntity): Promise<boolean>;
156
156
  }
157
157
  //# sourceMappingURL=ICacheManager.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"ICacheManager.d.ts","sourceRoot":"","sources":["../../../src/cache/interface/ICacheManager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAChE,OAAO,EACH,YAAY,EACZ,eAAe,EACf,aAAa,EACb,gBAAgB,EACnB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AACtD,OAAO,EAAE,aAAa,EA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