@azure/msal-common 15.13.0 → 16.0.0-alpha.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.
- package/dist/account/AccountInfo.d.ts +0 -4
- package/dist/account/AccountInfo.d.ts.map +1 -1
- package/dist/account/AccountInfo.mjs +1 -1
- package/dist/account/AccountInfo.mjs.map +1 -1
- package/dist/account/AuthToken.mjs +1 -1
- package/dist/account/AuthToken.mjs.map +1 -1
- package/dist/account/CcsCredential.mjs +1 -1
- package/dist/account/CcsCredential.mjs.map +1 -1
- package/dist/account/ClientInfo.d.ts +1 -5
- package/dist/account/ClientInfo.d.ts.map +1 -1
- package/dist/account/ClientInfo.mjs +4 -6
- package/dist/account/ClientInfo.mjs.map +1 -1
- package/dist/account/TokenClaims.mjs +1 -1
- package/dist/account/TokenClaims.mjs.map +1 -1
- package/dist/authority/Authority.d.ts +2 -2
- package/dist/authority/Authority.d.ts.map +1 -1
- package/dist/authority/Authority.mjs +89 -105
- package/dist/authority/Authority.mjs.map +1 -1
- package/dist/authority/AuthorityFactory.d.ts +6 -2
- package/dist/authority/AuthorityFactory.d.ts.map +1 -1
- package/dist/authority/AuthorityFactory.mjs +8 -5
- package/dist/authority/AuthorityFactory.mjs.map +1 -1
- package/dist/authority/AuthorityMetadata.d.ts +2 -2
- package/dist/authority/AuthorityMetadata.d.ts.map +1 -1
- package/dist/authority/AuthorityMetadata.mjs +8 -8
- package/dist/authority/AuthorityMetadata.mjs.map +1 -1
- package/dist/authority/AuthorityOptions.d.ts +0 -1
- package/dist/authority/AuthorityOptions.d.ts.map +1 -1
- package/dist/authority/AuthorityOptions.mjs +1 -1
- package/dist/authority/AuthorityOptions.mjs.map +1 -1
- package/dist/authority/AuthorityType.mjs +1 -1
- package/dist/authority/AuthorityType.mjs.map +1 -1
- package/dist/authority/CloudInstanceDiscoveryErrorResponse.mjs +1 -1
- package/dist/authority/CloudInstanceDiscoveryResponse.mjs +1 -1
- package/dist/authority/OIDCOptions.d.ts +2 -2
- package/dist/authority/OIDCOptions.d.ts.map +1 -1
- package/dist/authority/OpenIdConfigResponse.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs +1 -1
- package/dist/authority/ProtocolMode.mjs.map +1 -1
- package/dist/authority/RegionDiscovery.d.ts +3 -3
- package/dist/authority/RegionDiscovery.d.ts.map +1 -1
- package/dist/authority/RegionDiscovery.mjs +14 -15
- package/dist/authority/RegionDiscovery.mjs.map +1 -1
- package/dist/cache/CacheManager.d.ts +25 -17
- package/dist/cache/CacheManager.d.ts.map +1 -1
- package/dist/cache/CacheManager.mjs +69 -80
- package/dist/cache/CacheManager.mjs.map +1 -1
- package/dist/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/dist/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/dist/cache/entities/AccountEntity.d.ts +4 -57
- package/dist/cache/entities/AccountEntity.d.ts.map +1 -1
- package/dist/cache/entities/CredentialEntity.d.ts +0 -2
- package/dist/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/dist/cache/interface/ICacheManager.d.ts +41 -12
- package/dist/cache/interface/ICacheManager.d.ts.map +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs +1 -1
- package/dist/cache/persistence/TokenCacheContext.mjs.map +1 -1
- package/dist/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/dist/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/dist/cache/utils/AccountEntityUtils.mjs +212 -0
- package/dist/cache/utils/AccountEntityUtils.mjs.map +1 -0
- package/dist/cache/utils/CacheHelpers.d.ts +2 -2
- package/dist/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/dist/cache/utils/CacheHelpers.mjs +10 -13
- package/dist/cache/utils/CacheHelpers.mjs.map +1 -1
- package/dist/cache/utils/CacheTypes.d.ts +0 -1
- package/dist/cache/utils/CacheTypes.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts +1 -1
- package/dist/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/dist/client/AuthorizationCodeClient.mjs +16 -20
- package/dist/client/AuthorizationCodeClient.mjs.map +1 -1
- package/dist/client/BaseClient.d.ts +3 -3
- package/dist/client/BaseClient.d.ts.map +1 -1
- package/dist/client/BaseClient.mjs +7 -12
- package/dist/client/BaseClient.mjs.map +1 -1
- package/dist/client/RefreshTokenClient.d.ts +1 -1
- package/dist/client/RefreshTokenClient.d.ts.map +1 -1
- package/dist/client/RefreshTokenClient.mjs +22 -27
- package/dist/client/RefreshTokenClient.mjs.map +1 -1
- package/dist/client/SilentFlowClient.d.ts +1 -1
- package/dist/client/SilentFlowClient.d.ts.map +1 -1
- package/dist/client/SilentFlowClient.mjs +8 -12
- package/dist/client/SilentFlowClient.mjs.map +1 -1
- package/dist/config/ClientConfiguration.d.ts +2 -22
- package/dist/config/ClientConfiguration.d.ts.map +1 -1
- package/dist/config/ClientConfiguration.mjs +9 -15
- package/dist/config/ClientConfiguration.mjs.map +1 -1
- package/dist/constants/AADServerParamKeys.mjs +1 -1
- package/dist/crypto/ICrypto.d.ts +5 -3
- package/dist/crypto/ICrypto.d.ts.map +1 -1
- package/dist/crypto/ICrypto.mjs +1 -1
- package/dist/crypto/ICrypto.mjs.map +1 -1
- package/dist/crypto/JoseHeader.mjs +1 -1
- package/dist/crypto/JoseHeader.mjs.map +1 -1
- package/dist/crypto/PopTokenGenerator.d.ts +2 -2
- package/dist/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/dist/crypto/PopTokenGenerator.mjs +3 -5
- package/dist/crypto/PopTokenGenerator.mjs.map +1 -1
- package/dist/error/AuthError.d.ts +1 -18
- package/dist/error/AuthError.d.ts.map +1 -1
- package/dist/error/AuthError.mjs +12 -34
- package/dist/error/AuthError.mjs.map +1 -1
- package/dist/error/AuthErrorCodes.mjs +1 -1
- package/dist/error/CacheError.d.ts +1 -6
- package/dist/error/CacheError.d.ts.map +1 -1
- package/dist/error/CacheError.mjs +6 -13
- package/dist/error/CacheError.mjs.map +1 -1
- package/dist/error/CacheErrorCodes.mjs +1 -1
- package/dist/error/ClientAuthError.d.ts +0 -224
- package/dist/error/ClientAuthError.d.ts.map +1 -1
- package/dist/error/ClientAuthError.mjs +3 -235
- package/dist/error/ClientAuthError.mjs.map +1 -1
- package/dist/error/ClientAuthErrorCodes.d.ts +0 -8
- package/dist/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientAuthErrorCodes.mjs +2 -10
- package/dist/error/ClientAuthErrorCodes.mjs.map +1 -1
- package/dist/error/ClientConfigurationError.d.ts +0 -123
- package/dist/error/ClientConfigurationError.d.ts.map +1 -1
- package/dist/error/ClientConfigurationError.mjs +3 -129
- package/dist/error/ClientConfigurationError.mjs.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/dist/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/dist/error/ClientConfigurationErrorCodes.mjs +3 -5
- package/dist/error/ClientConfigurationErrorCodes.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthError.d.ts +1 -19
- package/dist/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/dist/error/InteractionRequiredAuthError.mjs +10 -35
- package/dist/error/InteractionRequiredAuthError.mjs.map +1 -1
- package/dist/error/InteractionRequiredAuthErrorCodes.mjs +1 -1
- package/dist/error/JoseHeaderError.d.ts +0 -4
- package/dist/error/JoseHeaderError.d.ts.map +1 -1
- package/dist/error/JoseHeaderError.mjs +3 -8
- package/dist/error/JoseHeaderError.mjs.map +1 -1
- package/dist/error/JoseHeaderErrorCodes.mjs +1 -1
- package/dist/error/NetworkError.mjs +1 -1
- package/dist/error/NetworkError.mjs.map +1 -1
- package/dist/error/ServerError.mjs +1 -1
- package/dist/error/ServerError.mjs.map +1 -1
- package/dist/exports-browser-only.d.ts +4 -3
- package/dist/exports-browser-only.d.ts.map +1 -1
- package/dist/exports-common.d.ts +8 -6
- package/dist/exports-common.d.ts.map +1 -1
- package/dist/exports-node-only.d.ts +1 -4
- package/dist/exports-node-only.d.ts.map +1 -1
- package/dist/index-browser.mjs +12 -8
- package/dist/index-browser.mjs.map +1 -1
- package/dist/index-node.mjs +10 -7
- package/dist/index-node.mjs.map +1 -1
- package/dist/index.mjs +12 -8
- package/dist/index.mjs.map +1 -1
- package/dist/logger/Logger.d.ts +12 -13
- package/dist/logger/Logger.d.ts.map +1 -1
- package/dist/logger/Logger.mjs +16 -21
- package/dist/logger/Logger.mjs.map +1 -1
- package/dist/network/INetworkModule.mjs +1 -1
- package/dist/network/INetworkModule.mjs.map +1 -1
- package/dist/network/RequestThumbprint.mjs +1 -1
- package/dist/network/ThrottlingUtils.d.ts.map +1 -1
- package/dist/network/ThrottlingUtils.mjs +6 -7
- package/dist/network/ThrottlingUtils.mjs.map +1 -1
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.d.ts.map +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/protocol/Authorize.d.ts +1 -2
- package/dist/protocol/Authorize.d.ts.map +1 -1
- package/dist/protocol/Authorize.mjs +14 -14
- package/dist/protocol/Authorize.mjs.map +1 -1
- package/dist/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/dist/request/AuthenticationHeaderParser.mjs +3 -3
- package/dist/request/AuthenticationHeaderParser.mjs.map +1 -1
- package/dist/request/BaseAuthRequest.d.ts +1 -7
- package/dist/request/BaseAuthRequest.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.d.ts +3 -9
- package/dist/request/RequestParameterBuilder.d.ts.map +1 -1
- package/dist/request/RequestParameterBuilder.mjs +7 -20
- package/dist/request/RequestParameterBuilder.mjs.map +1 -1
- package/dist/request/ScopeSet.mjs +5 -5
- package/dist/request/ScopeSet.mjs.map +1 -1
- package/dist/response/AuthenticationResult.d.ts +1 -1
- package/dist/response/AuthenticationResult.d.ts.map +1 -1
- package/dist/response/ResponseHandler.d.ts +6 -5
- package/dist/response/ResponseHandler.d.ts.map +1 -1
- package/dist/response/ResponseHandler.mjs +39 -41
- package/dist/response/ResponseHandler.mjs.map +1 -1
- package/dist/telemetry/performance/IPerformanceClient.d.ts +1 -31
- package/dist/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/dist/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceClient.mjs +28 -188
- package/dist/telemetry/performance/PerformanceClient.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.d.ts +0 -282
- package/dist/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/dist/telemetry/performance/PerformanceEvent.mjs +2 -483
- package/dist/telemetry/performance/PerformanceEvent.mjs.map +1 -1
- package/dist/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/dist/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs +73 -0
- package/dist/telemetry/performance/PerformanceEvents.mjs.map +1 -0
- package/dist/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/dist/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/dist/telemetry/performance/StubPerformanceClient.mjs +2 -26
- package/dist/telemetry/performance/StubPerformanceClient.mjs.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/dist/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/dist/telemetry/server/ServerTelemetryManager.mjs +28 -30
- package/dist/telemetry/server/ServerTelemetryManager.mjs.map +1 -1
- package/dist/url/UrlString.d.ts +0 -5
- package/dist/url/UrlString.d.ts.map +1 -1
- package/dist/url/UrlString.mjs +5 -13
- package/dist/url/UrlString.mjs.map +1 -1
- package/dist/utils/ClientAssertionUtils.mjs +1 -1
- package/dist/utils/ClientAssertionUtils.mjs.map +1 -1
- package/dist/utils/Constants.d.ts +81 -117
- package/dist/utils/Constants.d.ts.map +1 -1
- package/dist/utils/Constants.mjs +100 -131
- package/dist/utils/Constants.mjs.map +1 -1
- package/dist/utils/FunctionWrappers.d.ts +2 -2
- package/dist/utils/FunctionWrappers.d.ts.map +1 -1
- package/dist/utils/FunctionWrappers.mjs +19 -20
- package/dist/utils/FunctionWrappers.mjs.map +1 -1
- package/dist/utils/ProtocolUtils.mjs +7 -7
- package/dist/utils/ProtocolUtils.mjs.map +1 -1
- package/dist/utils/StringUtils.mjs +1 -1
- package/dist/utils/StringUtils.mjs.map +1 -1
- package/dist/utils/TimeUtils.mjs +1 -1
- package/dist/utils/TimeUtils.mjs.map +1 -1
- package/dist/utils/UrlUtils.d.ts +1 -2
- package/dist/utils/UrlUtils.d.ts.map +1 -1
- package/dist/utils/UrlUtils.mjs +3 -10
- package/dist/utils/UrlUtils.mjs.map +1 -1
- package/lib/index-browser.cjs +29 -222
- package/lib/index-browser.cjs.map +1 -1
- package/lib/{index-node-D8Iaiqq3.js → index-node-FrCFfFuh.js} +1606 -2493
- package/lib/index-node-FrCFfFuh.js.map +1 -0
- package/lib/index-node.cjs +4 -33
- package/lib/index-node.cjs.map +1 -1
- package/lib/index.cjs +3 -33
- package/lib/index.cjs.map +1 -1
- package/lib/types/account/AccountInfo.d.ts +0 -4
- package/lib/types/account/AccountInfo.d.ts.map +1 -1
- package/lib/types/account/ClientInfo.d.ts +1 -5
- package/lib/types/account/ClientInfo.d.ts.map +1 -1
- package/lib/types/authority/Authority.d.ts +2 -2
- package/lib/types/authority/Authority.d.ts.map +1 -1
- package/lib/types/authority/AuthorityFactory.d.ts +6 -2
- package/lib/types/authority/AuthorityFactory.d.ts.map +1 -1
- package/lib/types/authority/AuthorityMetadata.d.ts +2 -2
- package/lib/types/authority/AuthorityMetadata.d.ts.map +1 -1
- package/lib/types/authority/AuthorityOptions.d.ts +0 -1
- package/lib/types/authority/AuthorityOptions.d.ts.map +1 -1
- package/lib/types/authority/OIDCOptions.d.ts +2 -2
- package/lib/types/authority/OIDCOptions.d.ts.map +1 -1
- package/lib/types/authority/RegionDiscovery.d.ts +3 -3
- package/lib/types/authority/RegionDiscovery.d.ts.map +1 -1
- package/lib/types/cache/CacheManager.d.ts +25 -17
- package/lib/types/cache/CacheManager.d.ts.map +1 -1
- package/lib/types/cache/entities/AccessTokenEntity.d.ts +0 -4
- package/lib/types/cache/entities/AccessTokenEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/AccountEntity.d.ts +4 -57
- package/lib/types/cache/entities/AccountEntity.d.ts.map +1 -1
- package/lib/types/cache/entities/CredentialEntity.d.ts +0 -2
- package/lib/types/cache/entities/CredentialEntity.d.ts.map +1 -1
- package/lib/types/cache/interface/ICacheManager.d.ts +41 -12
- package/lib/types/cache/interface/ICacheManager.d.ts.map +1 -1
- package/lib/types/cache/utils/AccountEntityUtils.d.ts +60 -0
- package/lib/types/cache/utils/AccountEntityUtils.d.ts.map +1 -0
- package/lib/types/cache/utils/CacheHelpers.d.ts +2 -2
- package/lib/types/cache/utils/CacheHelpers.d.ts.map +1 -1
- package/lib/types/cache/utils/CacheTypes.d.ts +0 -1
- package/lib/types/cache/utils/CacheTypes.d.ts.map +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts +1 -1
- package/lib/types/client/AuthorizationCodeClient.d.ts.map +1 -1
- package/lib/types/client/BaseClient.d.ts +3 -3
- package/lib/types/client/BaseClient.d.ts.map +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts +1 -1
- package/lib/types/client/RefreshTokenClient.d.ts.map +1 -1
- package/lib/types/client/SilentFlowClient.d.ts +1 -1
- package/lib/types/client/SilentFlowClient.d.ts.map +1 -1
- package/lib/types/config/ClientConfiguration.d.ts +2 -22
- package/lib/types/config/ClientConfiguration.d.ts.map +1 -1
- package/lib/types/crypto/ICrypto.d.ts +5 -3
- package/lib/types/crypto/ICrypto.d.ts.map +1 -1
- package/lib/types/crypto/PopTokenGenerator.d.ts +2 -2
- package/lib/types/crypto/PopTokenGenerator.d.ts.map +1 -1
- package/lib/types/error/AuthError.d.ts +1 -18
- package/lib/types/error/AuthError.d.ts.map +1 -1
- package/lib/types/error/CacheError.d.ts +1 -6
- package/lib/types/error/CacheError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthError.d.ts +0 -224
- package/lib/types/error/ClientAuthError.d.ts.map +1 -1
- package/lib/types/error/ClientAuthErrorCodes.d.ts +0 -8
- package/lib/types/error/ClientAuthErrorCodes.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationError.d.ts +0 -123
- package/lib/types/error/ClientConfigurationError.d.ts.map +1 -1
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts +0 -2
- package/lib/types/error/ClientConfigurationErrorCodes.d.ts.map +1 -1
- package/lib/types/error/InteractionRequiredAuthError.d.ts +1 -19
- package/lib/types/error/InteractionRequiredAuthError.d.ts.map +1 -1
- package/lib/types/error/JoseHeaderError.d.ts +0 -4
- package/lib/types/error/JoseHeaderError.d.ts.map +1 -1
- package/lib/types/exports-browser-only.d.ts +4 -3
- package/lib/types/exports-browser-only.d.ts.map +1 -1
- package/lib/types/exports-common.d.ts +8 -6
- package/lib/types/exports-common.d.ts.map +1 -1
- package/lib/types/exports-node-only.d.ts +1 -4
- package/lib/types/exports-node-only.d.ts.map +1 -1
- package/lib/types/logger/Logger.d.ts +12 -13
- package/lib/types/logger/Logger.d.ts.map +1 -1
- package/lib/types/network/ThrottlingUtils.d.ts.map +1 -1
- package/lib/types/packageMetadata.d.ts +1 -1
- package/lib/types/packageMetadata.d.ts.map +1 -1
- package/lib/types/protocol/Authorize.d.ts +1 -2
- package/lib/types/protocol/Authorize.d.ts.map +1 -1
- package/lib/types/request/AuthenticationHeaderParser.d.ts.map +1 -1
- package/lib/types/request/BaseAuthRequest.d.ts +1 -7
- package/lib/types/request/BaseAuthRequest.d.ts.map +1 -1
- package/lib/types/request/RequestParameterBuilder.d.ts +3 -9
- package/lib/types/request/RequestParameterBuilder.d.ts.map +1 -1
- package/lib/types/response/AuthenticationResult.d.ts +1 -1
- package/lib/types/response/AuthenticationResult.d.ts.map +1 -1
- package/lib/types/response/ResponseHandler.d.ts +6 -5
- package/lib/types/response/ResponseHandler.d.ts.map +1 -1
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts +1 -31
- package/lib/types/telemetry/performance/IPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceClient.d.ts +6 -85
- package/lib/types/telemetry/performance/PerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts +0 -282
- package/lib/types/telemetry/performance/PerformanceEvent.d.ts.map +1 -1
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts +65 -0
- package/lib/types/telemetry/performance/PerformanceEvents.d.ts.map +1 -0
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts +0 -4
- package/lib/types/telemetry/performance/StubPerformanceClient.d.ts.map +1 -1
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts +2 -2
- package/lib/types/telemetry/server/ServerTelemetryManager.d.ts.map +1 -1
- package/lib/types/url/UrlString.d.ts +0 -5
- package/lib/types/url/UrlString.d.ts.map +1 -1
- package/lib/types/utils/Constants.d.ts +81 -117
- package/lib/types/utils/Constants.d.ts.map +1 -1
- package/lib/types/utils/FunctionWrappers.d.ts +2 -2
- package/lib/types/utils/FunctionWrappers.d.ts.map +1 -1
- package/lib/types/utils/UrlUtils.d.ts +1 -2
- package/lib/types/utils/UrlUtils.d.ts.map +1 -1
- package/package.json +120 -122
- package/src/account/AccountInfo.ts +0 -6
- package/src/account/ClientInfo.ts +4 -11
- package/src/authority/Authority.ts +145 -146
- package/src/authority/AuthorityFactory.ts +7 -7
- package/src/authority/AuthorityMetadata.ts +21 -12
- package/src/authority/AuthorityOptions.ts +0 -1
- package/src/authority/OIDCOptions.ts +2 -2
- package/src/authority/RegionDiscovery.ts +20 -33
- package/src/cache/CacheManager.ts +176 -126
- package/src/cache/entities/AccessTokenEntity.ts +0 -4
- package/src/cache/entities/AccountEntity.ts +4 -293
- package/src/cache/entities/CredentialEntity.ts +0 -2
- package/src/cache/interface/ICacheManager.ts +61 -15
- package/src/cache/utils/AccountEntityUtils.ts +287 -0
- package/src/cache/utils/CacheHelpers.ts +23 -37
- package/src/cache/utils/CacheTypes.ts +0 -1
- package/src/client/AuthorizationCodeClient.ts +28 -49
- package/src/client/BaseClient.ts +8 -20
- package/src/client/RefreshTokenClient.ts +29 -61
- package/src/client/SilentFlowClient.ts +11 -20
- package/src/config/ClientConfiguration.ts +9 -37
- package/src/crypto/ICrypto.ts +5 -3
- package/src/crypto/PopTokenGenerator.ts +3 -13
- package/src/error/AuthError.ts +11 -30
- package/src/error/CacheError.ts +4 -15
- package/src/error/ClientAuthError.ts +1 -311
- package/src/error/ClientAuthErrorCodes.ts +0 -8
- package/src/error/ClientConfigurationError.ts +1 -194
- package/src/error/ClientConfigurationErrorCodes.ts +0 -3
- package/src/error/InteractionRequiredAuthError.ts +8 -48
- package/src/error/JoseHeaderError.ts +1 -8
- package/src/exports-browser-only.ts +2 -6
- package/src/exports-common.ts +4 -34
- package/src/exports-node-only.ts +1 -4
- package/src/logger/Logger.ts +26 -39
- package/src/network/ThrottlingUtils.ts +12 -15
- package/src/packageMetadata.ts +1 -1
- package/src/protocol/Authorize.ts +24 -20
- package/src/request/AuthenticationHeaderParser.ts +2 -4
- package/src/request/BaseAuthRequest.ts +1 -7
- package/src/request/RequestParameterBuilder.ts +30 -45
- package/src/request/ScopeSet.ts +4 -4
- package/src/response/AuthenticationResult.ts +1 -1
- package/src/response/ResponseHandler.ts +53 -58
- package/src/telemetry/performance/IPerformanceClient.ts +1 -43
- package/src/telemetry/performance/PerformanceClient.ts +32 -295
- package/src/telemetry/performance/PerformanceEvent.ts +0 -586
- package/src/telemetry/performance/PerformanceEvents.ts +97 -0
- package/src/telemetry/performance/StubPerformanceClient.ts +0 -16
- package/src/telemetry/server/ServerTelemetryManager.ts +33 -44
- package/src/url/UrlString.ts +3 -12
- package/src/utils/Constants.ts +103 -146
- package/src/utils/FunctionWrappers.ts +28 -29
- package/src/utils/ProtocolUtils.ts +6 -6
- package/src/utils/UrlUtils.ts +2 -15
- package/dist/cache/entities/AccountEntity.mjs +0 -232
- package/dist/cache/entities/AccountEntity.mjs.map +0 -1
- package/dist/request/CommonClientCredentialRequest.d.ts +0 -18
- package/dist/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/dist/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/dist/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/dist/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/dist/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/dist/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/dist/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/lib/index-node-D8Iaiqq3.js.map +0 -1
- package/lib/types/request/CommonClientCredentialRequest.d.ts +0 -18
- package/lib/types/request/CommonClientCredentialRequest.d.ts.map +0 -1
- package/lib/types/request/CommonDeviceCodeRequest.d.ts +0 -22
- package/lib/types/request/CommonDeviceCodeRequest.d.ts.map +0 -1
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts +0 -14
- package/lib/types/request/CommonOnBehalfOfRequest.d.ts.map +0 -1
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts +0 -18
- package/lib/types/request/CommonUsernamePasswordRequest.d.ts.map +0 -1
- package/src/request/CommonClientCredentialRequest.ts +0 -23
- package/src/request/CommonDeviceCodeRequest.ts +0 -31
- package/src/request/CommonOnBehalfOfRequest.ts +0 -19
- package/src/request/CommonUsernamePasswordRequest.ts +0 -23
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
3
|
+
* Licensed under the MIT License.
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Time spent sending/waiting for the response of a request to the token endpoint
|
|
8
|
+
*/
|
|
9
|
+
export const NetworkClientSendPostRequestAsync =
|
|
10
|
+
"networkClientSendPostRequestAsync";
|
|
11
|
+
export const RefreshTokenClientExecutePostToTokenEndpoint =
|
|
12
|
+
"refreshTokenClientExecutePostToTokenEndpoint";
|
|
13
|
+
export const AuthorizationCodeClientExecutePostToTokenEndpoint =
|
|
14
|
+
"authorizationCodeClientExecutePostToTokenEndpoint";
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Time spent on the network for refresh token acquisition
|
|
18
|
+
*/
|
|
19
|
+
export const RefreshTokenClientExecuteTokenRequest =
|
|
20
|
+
"refreshTokenClientExecuteTokenRequest";
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Time taken for acquiring refresh token , records RT size
|
|
24
|
+
*/
|
|
25
|
+
export const RefreshTokenClientAcquireToken = "refreshTokenClientAcquireToken";
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Time taken for acquiring cached refresh token
|
|
29
|
+
*/
|
|
30
|
+
export const RefreshTokenClientAcquireTokenWithCachedRefreshToken =
|
|
31
|
+
"refreshTokenClientAcquireTokenWithCachedRefreshToken";
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* Helper function to create token request body in RefreshTokenClient (msal-common).
|
|
35
|
+
*/
|
|
36
|
+
export const RefreshTokenClientCreateTokenRequestBody =
|
|
37
|
+
"refreshTokenClientCreateTokenRequestBody";
|
|
38
|
+
|
|
39
|
+
export const SilentFlowClientGenerateResultFromCacheRecord =
|
|
40
|
+
"silentFlowClientGenerateResultFromCacheRecord";
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* getAuthCodeUrl API (msal-browser and msal-node).
|
|
44
|
+
*/
|
|
45
|
+
export const GetAuthCodeUrl = "getAuthCodeUrl";
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Functions from InteractionHandler (msal-browser)
|
|
49
|
+
*/
|
|
50
|
+
export const HandleCodeResponseFromServer = "handleCodeResponseFromServer";
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* APIs in Authorization Code Client (msal-common)
|
|
54
|
+
*/
|
|
55
|
+
export const AuthClientExecuteTokenRequest = "authClientExecuteTokenRequest";
|
|
56
|
+
export const AuthClientCreateTokenRequestBody =
|
|
57
|
+
"authClientCreateTokenRequestBody";
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Generate functions in PopTokenGenerator (msal-common)
|
|
61
|
+
*/
|
|
62
|
+
export const PopTokenGenerateCnf = "popTokenGenerateCnf";
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* handleServerTokenResponse API in ResponseHandler (msal-common)
|
|
66
|
+
*/
|
|
67
|
+
export const HandleServerTokenResponse = "handleServerTokenResponse";
|
|
68
|
+
|
|
69
|
+
/**
|
|
70
|
+
* Authority functions
|
|
71
|
+
*/
|
|
72
|
+
export const AuthorityResolveEndpointsAsync = "authorityResolveEndpointsAsync";
|
|
73
|
+
export const AuthorityGetCloudDiscoveryMetadataFromNetwork =
|
|
74
|
+
"authorityGetCloudDiscoveryMetadataFromNetwork";
|
|
75
|
+
export const AuthorityUpdateCloudDiscoveryMetadata =
|
|
76
|
+
"authorityUpdateCloudDiscoveryMetadata";
|
|
77
|
+
export const AuthorityGetEndpointMetadataFromNetwork =
|
|
78
|
+
"authorityGetEndpointMetadataFromNetwork";
|
|
79
|
+
export const AuthorityUpdateEndpointMetadata =
|
|
80
|
+
"authorityUpdateEndpointMetadata";
|
|
81
|
+
export const AuthorityUpdateMetadataWithRegionalInformation =
|
|
82
|
+
"authorityUpdateMetadataWithRegionalInformation";
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* Region Discovery functions
|
|
86
|
+
*/
|
|
87
|
+
export const RegionDiscoveryDetectRegion = "regionDiscoveryDetectRegion";
|
|
88
|
+
export const RegionDiscoveryGetRegionFromIMDS =
|
|
89
|
+
"regionDiscoveryGetRegionFromIMDS";
|
|
90
|
+
export const RegionDiscoveryGetCurrentVersion =
|
|
91
|
+
"regionDiscoveryGetCurrentVersion";
|
|
92
|
+
|
|
93
|
+
/**
|
|
94
|
+
* Cache operations
|
|
95
|
+
*/
|
|
96
|
+
export const CacheManagerGetRefreshToken = "cacheManagerGetRefreshToken";
|
|
97
|
+
export const SetUserData = "setUserData";
|
|
@@ -50,25 +50,9 @@ export class StubPerformanceClient implements IPerformanceClient {
|
|
|
50
50
|
startTimeMs: Date.now(),
|
|
51
51
|
correlationId: correlationId || "",
|
|
52
52
|
},
|
|
53
|
-
measurement: new StubPerformanceMeasurement(),
|
|
54
53
|
};
|
|
55
54
|
}
|
|
56
55
|
|
|
57
|
-
startPerformanceMeasurement(): IPerformanceMeasurement {
|
|
58
|
-
return new StubPerformanceMeasurement();
|
|
59
|
-
}
|
|
60
|
-
calculateQueuedTime(): number {
|
|
61
|
-
return 0;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
addQueueMeasurement(): void {
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
setPreQueueTime(): void {
|
|
69
|
-
return;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
56
|
endMeasurement(): PerformanceEvent | null {
|
|
73
57
|
return null;
|
|
74
58
|
}
|
|
@@ -3,14 +3,7 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
import
|
|
7
|
-
SERVER_TELEM_CONSTANTS,
|
|
8
|
-
Separators,
|
|
9
|
-
CacheOutcome,
|
|
10
|
-
Constants,
|
|
11
|
-
RegionDiscoverySources,
|
|
12
|
-
RegionDiscoveryOutcomes,
|
|
13
|
-
} from "../../utils/Constants.js";
|
|
6
|
+
import * as Constants from "../../utils/Constants.js";
|
|
14
7
|
import { CacheManager } from "../../cache/CacheManager.js";
|
|
15
8
|
import { AuthError } from "../../error/AuthError.js";
|
|
16
9
|
import { ServerTelemetryRequest } from "./ServerTelemetryRequest.js";
|
|
@@ -89,9 +82,10 @@ export class ServerTelemetryManager {
|
|
|
89
82
|
private wrapperSKU: String;
|
|
90
83
|
private wrapperVer: String;
|
|
91
84
|
private regionUsed: string | undefined;
|
|
92
|
-
private regionSource: RegionDiscoverySources | undefined;
|
|
93
|
-
private regionOutcome: RegionDiscoveryOutcomes | undefined;
|
|
94
|
-
private cacheOutcome: CacheOutcome =
|
|
85
|
+
private regionSource: Constants.RegionDiscoverySources | undefined;
|
|
86
|
+
private regionOutcome: Constants.RegionDiscoveryOutcomes | undefined;
|
|
87
|
+
private cacheOutcome: Constants.CacheOutcome =
|
|
88
|
+
Constants.CacheOutcome.NOT_APPLICABLE;
|
|
95
89
|
|
|
96
90
|
constructor(
|
|
97
91
|
telemetryRequest: ServerTelemetryRequest,
|
|
@@ -100,12 +94,12 @@ export class ServerTelemetryManager {
|
|
|
100
94
|
this.cacheManager = cacheManager;
|
|
101
95
|
this.apiId = telemetryRequest.apiId;
|
|
102
96
|
this.correlationId = telemetryRequest.correlationId;
|
|
103
|
-
this.wrapperSKU = telemetryRequest.wrapperSKU ||
|
|
104
|
-
this.wrapperVer = telemetryRequest.wrapperVer ||
|
|
97
|
+
this.wrapperSKU = telemetryRequest.wrapperSKU || "";
|
|
98
|
+
this.wrapperVer = telemetryRequest.wrapperVer || "";
|
|
105
99
|
|
|
106
100
|
this.telemetryCacheKey =
|
|
107
|
-
|
|
108
|
-
|
|
101
|
+
Constants.SERVER_TELEM_CACHE_KEY +
|
|
102
|
+
Constants.CACHE_KEY_SEPARATOR +
|
|
109
103
|
telemetryRequest.clientId;
|
|
110
104
|
}
|
|
111
105
|
|
|
@@ -113,26 +107,26 @@ export class ServerTelemetryManager {
|
|
|
113
107
|
* API to add MSER Telemetry to request
|
|
114
108
|
*/
|
|
115
109
|
generateCurrentRequestHeaderValue(): string {
|
|
116
|
-
const request = `${this.apiId}${
|
|
110
|
+
const request = `${this.apiId}${Constants.SERVER_TELEM_VALUE_SEPARATOR}${this.cacheOutcome}`;
|
|
117
111
|
const platformFieldsArr = [this.wrapperSKU, this.wrapperVer];
|
|
118
112
|
const nativeBrokerErrorCode = this.getNativeBrokerErrorCode();
|
|
119
113
|
if (nativeBrokerErrorCode?.length) {
|
|
120
114
|
platformFieldsArr.push(`broker_error=${nativeBrokerErrorCode}`);
|
|
121
115
|
}
|
|
122
116
|
const platformFields = platformFieldsArr.join(
|
|
123
|
-
|
|
117
|
+
Constants.SERVER_TELEM_VALUE_SEPARATOR
|
|
124
118
|
);
|
|
125
119
|
const regionDiscoveryFields = this.getRegionDiscoveryFields();
|
|
126
120
|
const requestWithRegionDiscoveryFields = [
|
|
127
121
|
request,
|
|
128
122
|
regionDiscoveryFields,
|
|
129
|
-
].join(
|
|
123
|
+
].join(Constants.SERVER_TELEM_VALUE_SEPARATOR);
|
|
130
124
|
|
|
131
125
|
return [
|
|
132
|
-
|
|
126
|
+
Constants.SERVER_TELEM_SCHEMA_VERSION,
|
|
133
127
|
requestWithRegionDiscoveryFields,
|
|
134
128
|
platformFields,
|
|
135
|
-
].join(
|
|
129
|
+
].join(Constants.SERVER_TELEM_CATEGORY_SEPARATOR);
|
|
136
130
|
}
|
|
137
131
|
|
|
138
132
|
/**
|
|
@@ -144,28 +138,28 @@ export class ServerTelemetryManager {
|
|
|
144
138
|
const maxErrors = ServerTelemetryManager.maxErrorsToSend(lastRequests);
|
|
145
139
|
const failedRequests = lastRequests.failedRequests
|
|
146
140
|
.slice(0, 2 * maxErrors)
|
|
147
|
-
.join(
|
|
141
|
+
.join(Constants.SERVER_TELEM_VALUE_SEPARATOR);
|
|
148
142
|
const errors = lastRequests.errors
|
|
149
143
|
.slice(0, maxErrors)
|
|
150
|
-
.join(
|
|
144
|
+
.join(Constants.SERVER_TELEM_VALUE_SEPARATOR);
|
|
151
145
|
const errorCount = lastRequests.errors.length;
|
|
152
146
|
|
|
153
147
|
// Indicate whether this header contains all data or partial data
|
|
154
148
|
const overflow =
|
|
155
149
|
maxErrors < errorCount
|
|
156
|
-
?
|
|
157
|
-
:
|
|
150
|
+
? Constants.SERVER_TELEM_OVERFLOW_TRUE
|
|
151
|
+
: Constants.SERVER_TELEM_OVERFLOW_FALSE;
|
|
158
152
|
const platformFields = [errorCount, overflow].join(
|
|
159
|
-
|
|
153
|
+
Constants.SERVER_TELEM_VALUE_SEPARATOR
|
|
160
154
|
);
|
|
161
155
|
|
|
162
156
|
return [
|
|
163
|
-
|
|
157
|
+
Constants.SERVER_TELEM_SCHEMA_VERSION,
|
|
164
158
|
lastRequests.cacheHits,
|
|
165
159
|
failedRequests,
|
|
166
160
|
errors,
|
|
167
161
|
platformFields,
|
|
168
|
-
].join(
|
|
162
|
+
].join(Constants.SERVER_TELEM_CATEGORY_SEPARATOR);
|
|
169
163
|
}
|
|
170
164
|
|
|
171
165
|
/**
|
|
@@ -176,7 +170,7 @@ export class ServerTelemetryManager {
|
|
|
176
170
|
const lastRequests = this.getLastRequests();
|
|
177
171
|
if (
|
|
178
172
|
lastRequests.errors.length >=
|
|
179
|
-
|
|
173
|
+
Constants.SERVER_TELEM_MAX_CACHED_ERRORS
|
|
180
174
|
) {
|
|
181
175
|
// Remove a cached error to make room, first in first out
|
|
182
176
|
lastRequests.failedRequests.shift(); // apiId
|
|
@@ -199,7 +193,7 @@ export class ServerTelemetryManager {
|
|
|
199
193
|
lastRequests.errors.push(error.toString());
|
|
200
194
|
}
|
|
201
195
|
} else {
|
|
202
|
-
lastRequests.errors.push(
|
|
196
|
+
lastRequests.errors.push(Constants.SERVER_TELEM_UNKNOWN_ERROR);
|
|
203
197
|
}
|
|
204
198
|
|
|
205
199
|
this.cacheManager.setServerTelemetry(
|
|
@@ -236,7 +230,8 @@ export class ServerTelemetryManager {
|
|
|
236
230
|
cacheHits: 0,
|
|
237
231
|
};
|
|
238
232
|
const lastRequests = this.cacheManager.getServerTelemetry(
|
|
239
|
-
this.telemetryCacheKey
|
|
233
|
+
this.telemetryCacheKey,
|
|
234
|
+
this.correlationId
|
|
240
235
|
) as ServerTelemetryEntity;
|
|
241
236
|
|
|
242
237
|
return lastRequests || initialValue;
|
|
@@ -287,14 +282,10 @@ export class ServerTelemetryManager {
|
|
|
287
282
|
const errorCount = serverTelemetryEntity.errors.length;
|
|
288
283
|
for (i = 0; i < errorCount; i++) {
|
|
289
284
|
// failedRequests parameter contains pairs of apiId and correlationId, multiply index by 2 to preserve pairs
|
|
290
|
-
const apiId =
|
|
291
|
-
serverTelemetryEntity.failedRequests[2 * i] ||
|
|
292
|
-
Constants.EMPTY_STRING;
|
|
285
|
+
const apiId = serverTelemetryEntity.failedRequests[2 * i] || "";
|
|
293
286
|
const correlationId =
|
|
294
|
-
serverTelemetryEntity.failedRequests[2 * i + 1] ||
|
|
295
|
-
|
|
296
|
-
const errorCode =
|
|
297
|
-
serverTelemetryEntity.errors[i] || Constants.EMPTY_STRING;
|
|
287
|
+
serverTelemetryEntity.failedRequests[2 * i + 1] || "";
|
|
288
|
+
const errorCode = serverTelemetryEntity.errors[i] || "";
|
|
298
289
|
|
|
299
290
|
// Count number of characters that would be added to header, each character is 1 byte. Add 3 at the end to account for separators
|
|
300
291
|
dataSize +=
|
|
@@ -303,7 +294,7 @@ export class ServerTelemetryManager {
|
|
|
303
294
|
errorCode.length +
|
|
304
295
|
3;
|
|
305
296
|
|
|
306
|
-
if (dataSize <
|
|
297
|
+
if (dataSize < Constants.SERVER_TELEM_MAX_LAST_HEADER_BYTES) {
|
|
307
298
|
// Adding this entry to the header would still keep header size below the limit
|
|
308
299
|
maxErrors += 1;
|
|
309
300
|
} else {
|
|
@@ -322,11 +313,9 @@ export class ServerTelemetryManager {
|
|
|
322
313
|
getRegionDiscoveryFields(): string {
|
|
323
314
|
const regionDiscoveryFields: string[] = [];
|
|
324
315
|
|
|
325
|
-
regionDiscoveryFields.push(this.regionUsed ||
|
|
326
|
-
regionDiscoveryFields.push(this.regionSource ||
|
|
327
|
-
regionDiscoveryFields.push(
|
|
328
|
-
this.regionOutcome || Constants.EMPTY_STRING
|
|
329
|
-
);
|
|
316
|
+
regionDiscoveryFields.push(this.regionUsed || "");
|
|
317
|
+
regionDiscoveryFields.push(this.regionSource || "");
|
|
318
|
+
regionDiscoveryFields.push(this.regionOutcome || "");
|
|
330
319
|
|
|
331
320
|
return regionDiscoveryFields.join(",");
|
|
332
321
|
}
|
|
@@ -348,7 +337,7 @@ export class ServerTelemetryManager {
|
|
|
348
337
|
/**
|
|
349
338
|
* Set cache outcome
|
|
350
339
|
*/
|
|
351
|
-
setCacheOutcome(cacheOutcome: CacheOutcome): void {
|
|
340
|
+
setCacheOutcome(cacheOutcome: Constants.CacheOutcome): void {
|
|
352
341
|
this.cacheOutcome = cacheOutcome;
|
|
353
342
|
}
|
|
354
343
|
|
package/src/url/UrlString.ts
CHANGED
|
@@ -9,8 +9,7 @@ import {
|
|
|
9
9
|
} from "../error/ClientConfigurationError.js";
|
|
10
10
|
import { StringUtils } from "../utils/StringUtils.js";
|
|
11
11
|
import { IUri } from "./IUri.js";
|
|
12
|
-
import
|
|
13
|
-
import * as UrlUtils from "../utils/UrlUtils.js";
|
|
12
|
+
import * as Constants from "../utils/Constants.js";
|
|
14
13
|
|
|
15
14
|
/**
|
|
16
15
|
* Url object class which can perform various transformations on url strings.
|
|
@@ -126,8 +125,8 @@ export class UrlString {
|
|
|
126
125
|
if (
|
|
127
126
|
tenantId &&
|
|
128
127
|
pathArray.length !== 0 &&
|
|
129
|
-
(pathArray[0] ===
|
|
130
|
-
pathArray[0] ===
|
|
128
|
+
(pathArray[0] === Constants.AADAuthority.COMMON ||
|
|
129
|
+
pathArray[0] === Constants.AADAuthority.ORGANIZATIONS)
|
|
131
130
|
) {
|
|
132
131
|
pathArray[0] = tenantId;
|
|
133
132
|
}
|
|
@@ -215,12 +214,4 @@ export class UrlString {
|
|
|
215
214
|
urlObject.PathSegments.join("/")
|
|
216
215
|
);
|
|
217
216
|
}
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* Check if the hash of the URL string contains known properties
|
|
221
|
-
* @deprecated This API will be removed in a future version
|
|
222
|
-
*/
|
|
223
|
-
static hashContainsKnownProperties(response: string): boolean {
|
|
224
|
-
return !!UrlUtils.getDeserializedResponse(response);
|
|
225
|
-
}
|
|
226
217
|
}
|
package/src/utils/Constants.ts
CHANGED
|
@@ -3,96 +3,78 @@
|
|
|
3
3
|
* Licensed under the MIT License.
|
|
4
4
|
*/
|
|
5
5
|
|
|
6
|
-
export const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
export const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
REQUEST_TIMEOUT: 408,
|
|
71
|
-
GONE: 410,
|
|
72
|
-
TOO_MANY_REQUESTS: 429,
|
|
73
|
-
CLIENT_ERROR_RANGE_END: 499,
|
|
74
|
-
SERVER_ERROR: 500,
|
|
75
|
-
SERVER_ERROR_RANGE_START: 500,
|
|
76
|
-
SERVICE_UNAVAILABLE: 503,
|
|
77
|
-
GATEWAY_TIMEOUT: 504,
|
|
78
|
-
SERVER_ERROR_RANGE_END: 599,
|
|
79
|
-
MULTI_SIDED_ERROR: 600,
|
|
80
|
-
} as const;
|
|
81
|
-
export type HttpStatus = (typeof HttpStatus)[keyof typeof HttpStatus];
|
|
82
|
-
|
|
83
|
-
export const HttpMethod = {
|
|
84
|
-
GET: "GET",
|
|
85
|
-
POST: "POST",
|
|
86
|
-
} as const;
|
|
87
|
-
export type HttpMethod = (typeof HttpMethod)[keyof typeof HttpMethod];
|
|
6
|
+
export const SKU = "msal.js.common";
|
|
7
|
+
// default authority
|
|
8
|
+
export const DEFAULT_AUTHORITY = "https://login.microsoftonline.com/common/";
|
|
9
|
+
export const DEFAULT_AUTHORITY_HOST = "login.microsoftonline.com";
|
|
10
|
+
export const DEFAULT_COMMON_TENANT = "common";
|
|
11
|
+
// ADFS String
|
|
12
|
+
export const ADFS = "adfs";
|
|
13
|
+
export const DSTS = "dstsv2";
|
|
14
|
+
// Default AAD Instance Discovery Endpoint
|
|
15
|
+
export const AAD_INSTANCE_DISCOVERY_ENDPT = `${DEFAULT_AUTHORITY}discovery/instance?api-version=1.1&authorization_endpoint=`;
|
|
16
|
+
// CIAM URL
|
|
17
|
+
export const CIAM_AUTH_URL = ".ciamlogin.com";
|
|
18
|
+
export const AAD_TENANT_DOMAIN_SUFFIX = ".onmicrosoft.com";
|
|
19
|
+
// Resource delimiter - used for certain cache entries
|
|
20
|
+
export const RESOURCE_DELIM = "|";
|
|
21
|
+
// Consumer UTID
|
|
22
|
+
export const CONSUMER_UTID = "9188040d-6c67-4c5b-b112-36a304b66dad";
|
|
23
|
+
// Default scopes
|
|
24
|
+
export const OPENID_SCOPE = "openid";
|
|
25
|
+
export const PROFILE_SCOPE = "profile";
|
|
26
|
+
export const OFFLINE_ACCESS_SCOPE = "offline_access";
|
|
27
|
+
export const EMAIL_SCOPE = "email";
|
|
28
|
+
export const CODE_GRANT_TYPE = "authorization_code";
|
|
29
|
+
export const S256_CODE_CHALLENGE_METHOD = "S256";
|
|
30
|
+
export const URL_FORM_CONTENT_TYPE =
|
|
31
|
+
"application/x-www-form-urlencoded;charset=utf-8";
|
|
32
|
+
export const AUTHORIZATION_PENDING = "authorization_pending";
|
|
33
|
+
export const NOT_APPLICABLE = "N/A";
|
|
34
|
+
export const NOT_AVAILABLE = "Not Available";
|
|
35
|
+
export const FORWARD_SLASH = "/";
|
|
36
|
+
export const IMDS_ENDPOINT =
|
|
37
|
+
"http://169.254.169.254/metadata/instance/compute/location";
|
|
38
|
+
export const IMDS_VERSION = "2020-06-01";
|
|
39
|
+
export const IMDS_TIMEOUT = 2000;
|
|
40
|
+
export const AZURE_REGION_AUTO_DISCOVER_FLAG = "TryAutoDetect";
|
|
41
|
+
export const REGIONAL_AUTH_PUBLIC_CLOUD_SUFFIX = "login.microsoft.com";
|
|
42
|
+
export const KNOWN_PUBLIC_CLOUDS = [
|
|
43
|
+
"login.microsoftonline.com",
|
|
44
|
+
"login.windows.net",
|
|
45
|
+
"login.microsoft.com",
|
|
46
|
+
"sts.windows.net",
|
|
47
|
+
];
|
|
48
|
+
export const SHR_NONCE_VALIDITY = 240;
|
|
49
|
+
export const INVALID_INSTANCE = "invalid_instance";
|
|
50
|
+
|
|
51
|
+
export const HTTP_SUCCESS: number = 200;
|
|
52
|
+
export const HTTP_SUCCESS_RANGE_START: number = 200;
|
|
53
|
+
export const HTTP_SUCCESS_RANGE_END: number = 299;
|
|
54
|
+
export const HTTP_REDIRECT: number = 302;
|
|
55
|
+
export const HTTP_CLIENT_ERROR: number = 400;
|
|
56
|
+
export const HTTP_CLIENT_ERROR_RANGE_START: number = 400;
|
|
57
|
+
export const HTTP_BAD_REQUEST: number = 400;
|
|
58
|
+
export const HTTP_UNAUTHORIZED: number = 401;
|
|
59
|
+
export const HTTP_NOT_FOUND: number = 404;
|
|
60
|
+
export const HTTP_REQUEST_TIMEOUT: number = 408;
|
|
61
|
+
export const HTTP_GONE: number = 410;
|
|
62
|
+
export const HTTP_TOO_MANY_REQUESTS: number = 429;
|
|
63
|
+
export const HTTP_CLIENT_ERROR_RANGE_END: number = 499;
|
|
64
|
+
export const HTTP_SERVER_ERROR: number = 500;
|
|
65
|
+
export const HTTP_SERVER_ERROR_RANGE_START: number = 500;
|
|
66
|
+
export const HTTP_SERVICE_UNAVAILABLE: number = 503;
|
|
67
|
+
export const HTTP_GATEWAY_TIMEOUT: number = 504;
|
|
68
|
+
export const HTTP_SERVER_ERROR_RANGE_END: number = 599;
|
|
69
|
+
export const HTTP_MULTI_SIDED_ERROR: number = 600;
|
|
88
70
|
|
|
89
71
|
export const OIDC_DEFAULT_SCOPES = [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
72
|
+
OPENID_SCOPE,
|
|
73
|
+
PROFILE_SCOPE,
|
|
74
|
+
OFFLINE_ACCESS_SCOPE,
|
|
93
75
|
];
|
|
94
76
|
|
|
95
|
-
export const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES,
|
|
77
|
+
export const OIDC_SCOPES = [...OIDC_DEFAULT_SCOPES, EMAIL_SCOPE];
|
|
96
78
|
|
|
97
79
|
/**
|
|
98
80
|
* Request header names
|
|
@@ -121,13 +103,12 @@ export type PersistentCacheKeys =
|
|
|
121
103
|
/**
|
|
122
104
|
* String constants related to AAD Authority
|
|
123
105
|
*/
|
|
124
|
-
export const
|
|
106
|
+
export const AADAuthority = {
|
|
125
107
|
COMMON: "common",
|
|
126
108
|
ORGANIZATIONS: "organizations",
|
|
127
109
|
CONSUMERS: "consumers",
|
|
128
110
|
} as const;
|
|
129
|
-
export type
|
|
130
|
-
(typeof AADAuthorityConstants)[keyof typeof AADAuthorityConstants];
|
|
111
|
+
export type AADAuthority = (typeof AADAuthority)[keyof typeof AADAuthority];
|
|
131
112
|
|
|
132
113
|
/**
|
|
133
114
|
* Claims request keys
|
|
@@ -172,17 +153,6 @@ export const OAuthResponseType = {
|
|
|
172
153
|
export type OAuthResponseType =
|
|
173
154
|
(typeof OAuthResponseType)[keyof typeof OAuthResponseType];
|
|
174
155
|
|
|
175
|
-
/**
|
|
176
|
-
* allowed values for server response type
|
|
177
|
-
* @deprecated Use ResponseMode instead
|
|
178
|
-
*/
|
|
179
|
-
export const ServerResponseType = {
|
|
180
|
-
QUERY: "query",
|
|
181
|
-
FRAGMENT: "fragment",
|
|
182
|
-
} as const;
|
|
183
|
-
export type ServerResponseType =
|
|
184
|
-
(typeof ServerResponseType)[keyof typeof ServerResponseType];
|
|
185
|
-
|
|
186
156
|
/**
|
|
187
157
|
* allowed values for response_mode
|
|
188
158
|
*/
|
|
@@ -210,23 +180,16 @@ export type GrantType = (typeof GrantType)[keyof typeof GrantType];
|
|
|
210
180
|
/**
|
|
211
181
|
* Account types in Cache
|
|
212
182
|
*/
|
|
213
|
-
export const
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
GENERIC_ACCOUNT_TYPE: "Generic", // NTLM, Kerberos, FBA, Basic etc
|
|
218
|
-
} as const;
|
|
219
|
-
export type CacheAccountType =
|
|
220
|
-
(typeof CacheAccountType)[keyof typeof CacheAccountType];
|
|
183
|
+
export const CACHE_ACCOUNT_TYPE_MSSTS: string = "MSSTS";
|
|
184
|
+
export const CACHE_ACCOUNT_TYPE_ADFS: string = "ADFS";
|
|
185
|
+
export const CACHE_ACCOUNT_TYPE_MSAV1: string = "MSA";
|
|
186
|
+
export const CACHE_ACCOUNT_TYPE_GENERIC: string = "Generic";
|
|
221
187
|
|
|
222
188
|
/**
|
|
223
189
|
* Separators used in cache
|
|
224
190
|
*/
|
|
225
|
-
export const
|
|
226
|
-
|
|
227
|
-
CLIENT_INFO_SEPARATOR: ".",
|
|
228
|
-
} as const;
|
|
229
|
-
export type Separators = (typeof Separators)[keyof typeof Separators];
|
|
191
|
+
export const CACHE_KEY_SEPARATOR: string = "-";
|
|
192
|
+
export const CLIENT_INFO_SEPARATOR: string = ".";
|
|
230
193
|
|
|
231
194
|
/**
|
|
232
195
|
* Credential Type stored in the cache
|
|
@@ -259,14 +222,12 @@ export type CacheType = (typeof CacheType)[keyof typeof CacheType];
|
|
|
259
222
|
/**
|
|
260
223
|
* More Cache related constants
|
|
261
224
|
*/
|
|
262
|
-
export const APP_METADATA = "appmetadata";
|
|
263
|
-
export const CLIENT_INFO = "client_info";
|
|
264
|
-
export const THE_FAMILY_ID = "1";
|
|
225
|
+
export const APP_METADATA: string = "appmetadata";
|
|
226
|
+
export const CLIENT_INFO: string = "client_info";
|
|
227
|
+
export const THE_FAMILY_ID: string = "1";
|
|
265
228
|
|
|
266
|
-
export const
|
|
267
|
-
|
|
268
|
-
REFRESH_TIME_SECONDS: 3600 * 24, // 24 Hours
|
|
269
|
-
};
|
|
229
|
+
export const AUTHORITY_METADATA_CACHE_KEY: string = "authority-metadata";
|
|
230
|
+
export const AUTHORITY_METADATA_REFRESH_TIME_SECONDS: number = 3600 * 24; // 24 Hours
|
|
270
231
|
|
|
271
232
|
export const AuthorityMetadataSource = {
|
|
272
233
|
CONFIG: "config",
|
|
@@ -277,18 +238,16 @@ export const AuthorityMetadataSource = {
|
|
|
277
238
|
export type AuthorityMetadataSource =
|
|
278
239
|
(typeof AuthorityMetadataSource)[keyof typeof AuthorityMetadataSource];
|
|
279
240
|
|
|
280
|
-
export const
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
UNKNOWN_ERROR: "unknown_error",
|
|
291
|
-
};
|
|
241
|
+
export const SERVER_TELEM_SCHEMA_VERSION: number = 5;
|
|
242
|
+
export const SERVER_TELEM_MAX_CUR_HEADER_BYTES: number = 80; // ESTS limit is 100B, set to 80 to provide a 20B buffer
|
|
243
|
+
export const SERVER_TELEM_MAX_LAST_HEADER_BYTES: number = 330; // ESTS limit is 350B, set to 330 to provide a 20B buffer,
|
|
244
|
+
export const SERVER_TELEM_MAX_CACHED_ERRORS: number = 50; // Limit the number of errors that can be stored to prevent uncontrolled size gains
|
|
245
|
+
export const SERVER_TELEM_CACHE_KEY: string = "server-telemetry";
|
|
246
|
+
export const SERVER_TELEM_CATEGORY_SEPARATOR: string = "|";
|
|
247
|
+
export const SERVER_TELEM_VALUE_SEPARATOR: string = ",";
|
|
248
|
+
export const SERVER_TELEM_OVERFLOW_TRUE: string = "1";
|
|
249
|
+
export const SERVER_TELEM_OVERFLOW_FALSE: string = "0";
|
|
250
|
+
export const SERVER_TELEM_UNKNOWN_ERROR: string = "unknown_error";
|
|
292
251
|
|
|
293
252
|
/**
|
|
294
253
|
* Type of the authentication request
|
|
@@ -304,21 +263,19 @@ export type AuthenticationScheme =
|
|
|
304
263
|
/**
|
|
305
264
|
* Constants related to throttling
|
|
306
265
|
*/
|
|
307
|
-
export const
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
// Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling
|
|
315
|
-
X_MS_LIB_CAPABILITY_VALUE: "retry-after, h429",
|
|
316
|
-
};
|
|
266
|
+
export const DEFAULT_THROTTLE_TIME_SECONDS: number = 60;
|
|
267
|
+
// Default maximum time to throttle in seconds, overrides what the server sends back
|
|
268
|
+
export const DEFAULT_MAX_THROTTLE_TIME_SECONDS: number = 3600;
|
|
269
|
+
// Prefix for storing throttling entries
|
|
270
|
+
export const THROTTLING_PREFIX: string = "throttling";
|
|
271
|
+
// Value assigned to the x-ms-lib-capability header to indicate to the server the library supports throttling
|
|
272
|
+
export const X_MS_LIB_CAPABILITY_VALUE: string = "retry-after, h429";
|
|
317
273
|
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
274
|
+
/**
|
|
275
|
+
* Errors
|
|
276
|
+
*/
|
|
277
|
+
export const INVALID_GRANT_ERROR: string = "invalid_grant";
|
|
278
|
+
export const CLIENT_MISMATCH_ERROR: string = "client_mismatch";
|
|
322
279
|
|
|
323
280
|
/**
|
|
324
281
|
* Password grant parameters
|