@azure/msal-node 2.13.1 → 2.14.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/cache/ITokenCache.d.ts +1 -1
- package/dist/cache/ITokenCache.d.ts.map +1 -1
- package/dist/cache/NodeStorage.d.ts +1 -1
- package/dist/cache/NodeStorage.d.ts.map +1 -1
- package/dist/cache/NodeStorage.mjs +2 -2
- package/dist/cache/TokenCache.d.ts +1 -1
- package/dist/cache/TokenCache.d.ts.map +1 -1
- package/dist/cache/TokenCache.mjs +2 -2
- package/dist/cache/distributed/DistributedCachePlugin.d.ts +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.d.ts.map +1 -1
- package/dist/cache/distributed/DistributedCachePlugin.mjs +2 -2
- package/dist/cache/distributed/IPartitionManager.d.ts +1 -1
- package/dist/cache/distributed/IPartitionManager.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.d.ts +1 -1
- package/dist/cache/serializer/Deserializer.d.ts.map +1 -1
- package/dist/cache/serializer/Deserializer.mjs +2 -2
- package/dist/cache/serializer/Serializer.d.ts +1 -1
- package/dist/cache/serializer/Serializer.d.ts.map +1 -1
- package/dist/cache/serializer/Serializer.mjs +1 -1
- package/dist/cache/serializer/SerializerTypes.d.ts +1 -1
- package/dist/cache/serializer/SerializerTypes.d.ts.map +1 -1
- package/dist/client/ClientApplication.d.ts +1 -1
- package/dist/client/ClientApplication.d.ts.map +1 -1
- package/dist/client/ClientApplication.mjs +2 -2
- package/dist/client/ClientAssertion.mjs +2 -2
- package/dist/client/ClientCredentialClient.d.ts +2 -2
- package/dist/client/ClientCredentialClient.d.ts.map +1 -1
- package/dist/client/ClientCredentialClient.mjs +2 -2
- package/dist/client/ConfidentialClientApplication.d.ts +1 -1
- package/dist/client/ConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/ConfidentialClientApplication.mjs +2 -2
- package/dist/client/DeviceCodeClient.d.ts +1 -1
- package/dist/client/DeviceCodeClient.d.ts.map +1 -1
- package/dist/client/DeviceCodeClient.mjs +2 -2
- package/dist/client/IConfidentialClientApplication.d.ts +1 -1
- package/dist/client/IConfidentialClientApplication.d.ts.map +1 -1
- package/dist/client/IPublicClientApplication.d.ts +1 -1
- package/dist/client/IPublicClientApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.d.ts +4 -4
- package/dist/client/ManagedIdentityApplication.d.ts.map +1 -1
- package/dist/client/ManagedIdentityApplication.mjs +2 -2
- package/dist/client/ManagedIdentityClient.d.ts +6 -6
- package/dist/client/ManagedIdentityClient.d.ts.map +1 -1
- package/dist/client/ManagedIdentityClient.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AppService.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/AppService.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AppService.mjs +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts +7 -7
- package/dist/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/AzureArc.mjs +2 -2
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +8 -8
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.mjs +2 -2
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/CloudShell.mjs +1 -1
- package/dist/client/ManagedIdentitySources/Imds.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/Imds.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/Imds.mjs +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts +6 -6
- package/dist/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.mjs +1 -1
- package/dist/client/OnBehalfOfClient.d.ts +1 -1
- package/dist/client/OnBehalfOfClient.d.ts.map +1 -1
- package/dist/client/OnBehalfOfClient.mjs +2 -2
- package/dist/client/PublicClientApplication.d.ts +1 -1
- package/dist/client/PublicClientApplication.d.ts.map +1 -1
- package/dist/client/PublicClientApplication.mjs +2 -2
- package/dist/client/UsernamePasswordClient.d.ts +1 -1
- package/dist/client/UsernamePasswordClient.d.ts.map +1 -1
- package/dist/client/UsernamePasswordClient.mjs +2 -2
- package/dist/config/Configuration.d.ts +3 -3
- package/dist/config/Configuration.d.ts.map +1 -1
- package/dist/config/Configuration.mjs +2 -2
- package/dist/config/ManagedIdentityId.d.ts +2 -2
- package/dist/config/ManagedIdentityId.d.ts.map +1 -1
- package/dist/config/ManagedIdentityId.mjs +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts +1 -1
- package/dist/config/ManagedIdentityRequestParameters.d.ts.map +1 -1
- package/dist/config/ManagedIdentityRequestParameters.mjs +2 -2
- package/dist/crypto/CryptoProvider.d.ts +1 -1
- package/dist/crypto/CryptoProvider.d.ts.map +1 -1
- package/dist/crypto/CryptoProvider.mjs +1 -1
- package/dist/crypto/GuidGenerator.d.ts +1 -1
- package/dist/crypto/GuidGenerator.d.ts.map +1 -1
- package/dist/crypto/GuidGenerator.mjs +1 -1
- package/dist/crypto/HashUtils.d.ts +1 -1
- package/dist/crypto/HashUtils.mjs +1 -1
- package/dist/crypto/PkceGenerator.d.ts +1 -1
- package/dist/crypto/PkceGenerator.d.ts.map +1 -1
- package/dist/crypto/PkceGenerator.mjs +2 -2
- package/dist/error/ManagedIdentityError.d.ts +2 -2
- package/dist/error/ManagedIdentityError.d.ts.map +1 -1
- package/dist/error/ManagedIdentityError.mjs +2 -2
- package/dist/error/ManagedIdentityErrorCodes.mjs +1 -1
- package/dist/error/NodeAuthError.d.ts +1 -1
- package/dist/error/NodeAuthError.d.ts.map +1 -1
- package/dist/error/NodeAuthError.mjs +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/internals.mjs +1 -1
- package/dist/network/HttpClient.d.ts +3 -3
- package/dist/network/HttpClient.d.ts.map +1 -1
- package/dist/network/HttpClient.mjs +2 -2
- package/dist/network/HttpClientWithRetries.d.ts +2 -2
- package/dist/network/HttpClientWithRetries.d.ts.map +1 -1
- package/dist/network/HttpClientWithRetries.mjs +2 -2
- package/dist/network/ILoopbackClient.d.ts +1 -1
- package/dist/network/ILoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.d.ts +1 -1
- package/dist/network/LoopbackClient.d.ts.map +1 -1
- package/dist/network/LoopbackClient.mjs +2 -2
- package/dist/packageMetadata.d.ts +1 -1
- package/dist/packageMetadata.mjs +2 -2
- package/dist/request/AuthorizationCodeRequest.d.ts +1 -1
- package/dist/request/AuthorizationCodeRequest.d.ts.map +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts +1 -1
- package/dist/request/AuthorizationUrlRequest.d.ts.map +1 -1
- package/dist/request/ClientCredentialRequest.d.ts +1 -1
- package/dist/request/ClientCredentialRequest.d.ts.map +1 -1
- package/dist/request/DeviceCodeRequest.d.ts +1 -1
- package/dist/request/DeviceCodeRequest.d.ts.map +1 -1
- package/dist/request/InteractiveRequest.d.ts +1 -1
- package/dist/request/ManagedIdentityRequest.d.ts +2 -2
- package/dist/request/ManagedIdentityRequest.d.ts.map +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts +1 -1
- package/dist/request/OnBehalfOfRequest.d.ts.map +1 -1
- package/dist/request/RefreshTokenRequest.d.ts +1 -1
- package/dist/request/RefreshTokenRequest.d.ts.map +1 -1
- package/dist/request/SignOutRequest.d.ts +1 -1
- package/dist/request/SignOutRequest.d.ts.map +1 -1
- package/dist/request/SilentFlowRequest.d.ts +1 -1
- package/dist/request/SilentFlowRequest.d.ts.map +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts +1 -1
- package/dist/request/UsernamePasswordRequest.d.ts.map +1 -1
- package/dist/response/ManagedIdentityTokenResponse.d.ts +1 -1
- package/dist/response/ManagedIdentityTokenResponse.d.ts.map +1 -1
- package/dist/retry/IHttpRetryPolicy.d.ts +1 -1
- package/dist/retry/LinearRetryPolicy.d.ts +2 -2
- package/dist/retry/LinearRetryPolicy.d.ts.map +1 -1
- package/dist/retry/LinearRetryPolicy.mjs +1 -1
- package/dist/utils/Constants.mjs +2 -2
- package/dist/utils/EncodingUtils.d.ts +1 -1
- package/dist/utils/EncodingUtils.mjs +2 -2
- package/dist/utils/NetworkUtils.d.ts +1 -1
- package/dist/utils/NetworkUtils.d.ts.map +1 -1
- package/dist/utils/NetworkUtils.mjs +1 -1
- package/dist/utils/NetworkUtils.mjs.map +1 -1
- package/lib/msal-node.cjs +12362 -0
- package/lib/msal-node.cjs.map +1 -0
- package/lib/package.json +1 -0
- package/lib/types/cache/ITokenCache.d.ts +16 -0
- package/lib/types/cache/ITokenCache.d.ts.map +1 -0
- package/lib/types/cache/NodeStorage.d.ts +194 -0
- package/lib/types/cache/NodeStorage.d.ts.map +1 -0
- package/lib/types/cache/TokenCache.d.ts +91 -0
- package/lib/types/cache/TokenCache.d.ts.map +1 -0
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts +11 -0
- package/lib/types/cache/distributed/DistributedCachePlugin.d.ts.map +1 -0
- package/lib/types/cache/distributed/ICacheClient.d.ts +18 -0
- package/lib/types/cache/distributed/ICacheClient.d.ts.map +1 -0
- package/lib/types/cache/distributed/IPartitionManager.d.ts +29 -0
- package/lib/types/cache/distributed/IPartitionManager.d.ts.map +1 -0
- package/lib/types/cache/serializer/Deserializer.d.ts +43 -0
- package/lib/types/cache/serializer/Deserializer.d.ts.map +1 -0
- package/lib/types/cache/serializer/Serializer.d.ts +40 -0
- package/lib/types/cache/serializer/Serializer.d.ts.map +1 -0
- package/lib/types/cache/serializer/SerializerTypes.d.ts +103 -0
- package/lib/types/cache/serializer/SerializerTypes.d.ts.map +1 -0
- package/lib/types/client/ClientApplication.d.ts +144 -0
- package/lib/types/client/ClientApplication.d.ts.map +1 -0
- package/lib/types/client/ClientAssertion.d.ts +56 -0
- package/lib/types/client/ClientAssertion.d.ts.map +1 -0
- package/lib/types/client/ClientCredentialClient.d.ts +34 -0
- package/lib/types/client/ClientCredentialClient.d.ts.map +1 -0
- package/lib/types/client/ConfidentialClientApplication.d.ts +59 -0
- package/lib/types/client/ConfidentialClientApplication.d.ts.map +1 -0
- package/lib/types/client/DeviceCodeClient.d.ts +54 -0
- package/lib/types/client/DeviceCodeClient.d.ts.map +1 -0
- package/lib/types/client/IConfidentialClientApplication.d.ts +40 -0
- package/lib/types/client/IConfidentialClientApplication.d.ts.map +1 -0
- package/lib/types/client/IPublicClientApplication.d.ts +43 -0
- package/lib/types/client/IPublicClientApplication.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentityApplication.d.ts +31 -0
- package/lib/types/client/ManagedIdentityApplication.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentityClient.d.ts +28 -0
- package/lib/types/client/ManagedIdentityClient.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts +18 -0
- package/lib/types/client/ManagedIdentitySources/AppService.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts +28 -0
- package/lib/types/client/ManagedIdentitySources/AzureArc.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts +31 -0
- package/lib/types/client/ManagedIdentitySources/BaseManagedIdentitySource.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts +17 -0
- package/lib/types/client/ManagedIdentitySources/CloudShell.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts +13 -0
- package/lib/types/client/ManagedIdentitySources/Imds.d.ts.map +1 -0
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts +18 -0
- package/lib/types/client/ManagedIdentitySources/ServiceFabric.d.ts.map +1 -0
- package/lib/types/client/OnBehalfOfClient.d.ts +48 -0
- package/lib/types/client/OnBehalfOfClient.d.ts.map +1 -0
- package/lib/types/client/PublicClientApplication.d.ts +73 -0
- package/lib/types/client/PublicClientApplication.d.ts.map +1 -0
- package/lib/types/client/UsernamePasswordClient.d.ts +26 -0
- package/lib/types/client/UsernamePasswordClient.d.ts.map +1 -0
- package/lib/types/config/Configuration.d.ts +132 -0
- package/lib/types/config/Configuration.d.ts.map +1 -0
- package/lib/types/config/ManagedIdentityId.d.ts +12 -0
- package/lib/types/config/ManagedIdentityId.d.ts.map +1 -0
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts +12 -0
- package/lib/types/config/ManagedIdentityRequestParameters.d.ts.map +1 -0
- package/lib/types/crypto/CryptoProvider.d.ts +63 -0
- package/lib/types/crypto/CryptoProvider.d.ts.map +1 -0
- package/lib/types/crypto/GuidGenerator.d.ts +15 -0
- package/lib/types/crypto/GuidGenerator.d.ts.map +1 -0
- package/lib/types/crypto/HashUtils.d.ts +9 -0
- package/lib/types/crypto/HashUtils.d.ts.map +1 -0
- package/lib/types/crypto/PkceGenerator.d.ts +23 -0
- package/lib/types/crypto/PkceGenerator.d.ts.map +1 -0
- package/lib/types/error/ManagedIdentityError.d.ts +31 -0
- package/lib/types/error/ManagedIdentityError.d.ts.map +1 -0
- package/lib/types/error/ManagedIdentityErrorCodes.d.ts +23 -0
- package/lib/types/error/ManagedIdentityErrorCodes.d.ts.map +1 -0
- package/lib/types/error/NodeAuthError.d.ts +74 -0
- package/lib/types/error/NodeAuthError.d.ts.map +1 -0
- package/lib/types/index.d.ts +46 -0
- package/lib/types/index.d.ts.map +1 -0
- package/lib/types/internals.d.ts +7 -0
- package/lib/types/internals.d.ts.map +1 -0
- package/lib/types/network/HttpClient.d.ts +26 -0
- package/lib/types/network/HttpClient.d.ts.map +1 -0
- package/lib/types/network/HttpClientWithRetries.d.ts +12 -0
- package/lib/types/network/HttpClientWithRetries.d.ts.map +1 -0
- package/lib/types/network/ILoopbackClient.d.ts +11 -0
- package/lib/types/network/ILoopbackClient.d.ts.map +1 -0
- package/lib/types/network/LoopbackClient.d.ts +22 -0
- package/lib/types/network/LoopbackClient.d.ts.map +1 -0
- package/lib/types/packageMetadata.d.ts +3 -0
- package/lib/types/packageMetadata.d.ts.map +1 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts +22 -0
- package/lib/types/request/AuthorizationCodeRequest.d.ts.map +1 -0
- package/lib/types/request/AuthorizationUrlRequest.d.ts +34 -0
- package/lib/types/request/AuthorizationUrlRequest.d.ts.map +1 -0
- package/lib/types/request/ClientCredentialRequest.d.ts +15 -0
- package/lib/types/request/ClientCredentialRequest.d.ts.map +1 -0
- package/lib/types/request/DeviceCodeRequest.d.ts +16 -0
- package/lib/types/request/DeviceCodeRequest.d.ts.map +1 -0
- package/lib/types/request/InteractiveRequest.d.ts +23 -0
- package/lib/types/request/InteractiveRequest.d.ts.map +1 -0
- package/lib/types/request/ManagedIdentityRequest.d.ts +9 -0
- package/lib/types/request/ManagedIdentityRequest.d.ts.map +1 -0
- package/lib/types/request/ManagedIdentityRequestParams.d.ts +10 -0
- package/lib/types/request/ManagedIdentityRequestParams.d.ts.map +1 -0
- package/lib/types/request/OnBehalfOfRequest.d.ts +15 -0
- package/lib/types/request/OnBehalfOfRequest.d.ts.map +1 -0
- package/lib/types/request/RefreshTokenRequest.d.ts +18 -0
- package/lib/types/request/RefreshTokenRequest.d.ts.map +1 -0
- package/lib/types/request/SignOutRequest.d.ts +6 -0
- package/lib/types/request/SignOutRequest.d.ts.map +1 -0
- package/lib/types/request/SilentFlowRequest.d.ts +17 -0
- package/lib/types/request/SilentFlowRequest.d.ts.map +1 -0
- package/lib/types/request/UsernamePasswordRequest.d.ts +20 -0
- package/lib/types/request/UsernamePasswordRequest.d.ts.map +1 -0
- package/lib/types/response/ManagedIdentityTokenResponse.d.ts +35 -0
- package/lib/types/response/ManagedIdentityTokenResponse.d.ts.map +1 -0
- package/lib/types/retry/IHttpRetryPolicy.d.ts +6 -0
- package/lib/types/retry/IHttpRetryPolicy.d.ts.map +1 -0
- package/lib/types/retry/LinearRetryPolicy.d.ts +12 -0
- package/lib/types/retry/LinearRetryPolicy.d.ts.map +1 -0
- package/lib/types/utils/Constants.d.ts +142 -0
- package/lib/types/utils/Constants.d.ts.map +1 -0
- package/lib/types/utils/EncodingUtils.d.ts +27 -0
- package/lib/types/utils/EncodingUtils.d.ts.map +1 -0
- package/lib/types/utils/NetworkUtils.d.ts +6 -0
- package/lib/types/utils/NetworkUtils.d.ts.map +1 -0
- package/package.json +13 -10
- package/src/cache/ITokenCache.ts +1 -1
- package/src/cache/NodeStorage.ts +1 -1
- package/src/cache/TokenCache.ts +1 -1
- package/src/cache/distributed/DistributedCachePlugin.ts +1 -1
- package/src/cache/distributed/IPartitionManager.ts +1 -1
- package/src/cache/serializer/Deserializer.ts +1 -1
- package/src/cache/serializer/Serializer.ts +1 -1
- package/src/cache/serializer/SerializerTypes.ts +1 -1
- package/src/client/ClientApplication.ts +1 -1
- package/src/client/ClientAssertion.ts +1 -1
- package/src/client/ClientCredentialClient.ts +2 -2
- package/src/client/ConfidentialClientApplication.ts +1 -1
- package/src/client/DeviceCodeClient.ts +1 -1
- package/src/client/IConfidentialClientApplication.ts +1 -1
- package/src/client/IPublicClientApplication.ts +5 -1
- package/src/client/ManagedIdentityApplication.ts +9 -9
- package/src/client/ManagedIdentityClient.ts +13 -13
- package/src/client/ManagedIdentitySources/AppService.ts +7 -7
- package/src/client/ManagedIdentitySources/AzureArc.ts +9 -9
- package/src/client/ManagedIdentitySources/BaseManagedIdentitySource.ts +9 -9
- package/src/client/ManagedIdentitySources/CloudShell.ts +8 -8
- package/src/client/ManagedIdentitySources/Imds.ts +7 -7
- package/src/client/ManagedIdentitySources/ServiceFabric.ts +7 -7
- package/src/client/OnBehalfOfClient.ts +2 -2
- package/src/client/PublicClientApplication.ts +2 -2
- package/src/client/UsernamePasswordClient.ts +1 -1
- package/src/config/Configuration.ts +1 -1
- package/src/config/ManagedIdentityId.ts +3 -3
- package/src/config/ManagedIdentityRequestParameters.ts +2 -2
- package/src/crypto/CryptoProvider.ts +1 -1
- package/src/crypto/GuidGenerator.ts +1 -1
- package/src/crypto/PkceGenerator.ts +1 -1
- package/src/error/ManagedIdentityError.ts +3 -3
- package/src/error/ManagedIdentityErrorCodes.ts +1 -1
- package/src/error/NodeAuthError.ts +1 -1
- package/src/index.ts +1 -1
- package/src/network/HttpClient.ts +1 -1
- package/src/network/HttpClientWithRetries.ts +3 -3
- package/src/network/ILoopbackClient.ts +1 -1
- package/src/network/LoopbackClient.ts +1 -1
- package/src/packageMetadata.ts +1 -1
- package/src/request/AuthorizationCodeRequest.ts +1 -1
- package/src/request/AuthorizationUrlRequest.ts +1 -1
- package/src/request/ClientCredentialRequest.ts +1 -1
- package/src/request/DeviceCodeRequest.ts +1 -1
- package/src/request/ManagedIdentityRequest.ts +2 -2
- package/src/request/OnBehalfOfRequest.ts +1 -1
- package/src/request/RefreshTokenRequest.ts +1 -1
- package/src/request/SignOutRequest.ts +1 -1
- package/src/request/SilentFlowRequest.ts +1 -1
- package/src/request/UsernamePasswordRequest.ts +1 -1
- package/src/response/ManagedIdentityTokenResponse.ts +1 -1
- package/src/retry/LinearRetryPolicy.ts +1 -1
- package/src/utils/Constants.ts +1 -1
- package/src/utils/EncodingUtils.ts +1 -1
- package/src/utils/NetworkUtils.ts +4 -1
- package/dist/cache/NodeStorage.cjs +0 -434
- package/dist/cache/NodeStorage.cjs.map +0 -1
- package/dist/cache/TokenCache.cjs +0 -276
- package/dist/cache/TokenCache.cjs.map +0 -1
- package/dist/cache/distributed/DistributedCachePlugin.cjs +0 -35
- package/dist/cache/distributed/DistributedCachePlugin.cjs.map +0 -1
- package/dist/cache/serializer/Deserializer.cjs +0 -176
- package/dist/cache/serializer/Deserializer.cjs.map +0 -1
- package/dist/cache/serializer/Serializer.cjs +0 -144
- package/dist/cache/serializer/Serializer.cjs.map +0 -1
- package/dist/client/ClientApplication.cjs +0 -352
- package/dist/client/ClientApplication.cjs.map +0 -1
- package/dist/client/ClientAssertion.cjs +0 -155
- package/dist/client/ClientAssertion.cjs.map +0 -1
- package/dist/client/ClientCredentialClient.cjs +0 -203
- package/dist/client/ClientCredentialClient.cjs.map +0 -1
- package/dist/client/ConfidentialClientApplication.cjs +0 -183
- package/dist/client/ConfidentialClientApplication.cjs.map +0 -1
- package/dist/client/DeviceCodeClient.cjs +0 -216
- package/dist/client/DeviceCodeClient.cjs.map +0 -1
- package/dist/client/ManagedIdentityApplication.cjs +0 -100
- package/dist/client/ManagedIdentityApplication.cjs.map +0 -1
- package/dist/client/ManagedIdentityClient.cjs +0 -76
- package/dist/client/ManagedIdentityClient.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/AppService.cjs +0 -56
- package/dist/client/ManagedIdentitySources/AppService.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/AzureArc.cjs +0 -173
- package/dist/client/ManagedIdentitySources/AzureArc.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs +0 -135
- package/dist/client/ManagedIdentitySources/BaseManagedIdentitySource.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/CloudShell.cjs +0 -51
- package/dist/client/ManagedIdentitySources/CloudShell.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/Imds.cjs +0 -54
- package/dist/client/ManagedIdentitySources/Imds.cjs.map +0 -1
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs +0 -65
- package/dist/client/ManagedIdentitySources/ServiceFabric.cjs.map +0 -1
- package/dist/client/OnBehalfOfClient.cjs +0 -212
- package/dist/client/OnBehalfOfClient.cjs.map +0 -1
- package/dist/client/PublicClientApplication.cjs +0 -252
- package/dist/client/PublicClientApplication.cjs.map +0 -1
- package/dist/client/UsernamePasswordClient.cjs +0 -104
- package/dist/client/UsernamePasswordClient.cjs.map +0 -1
- package/dist/config/Configuration.cjs +0 -122
- package/dist/config/Configuration.cjs.map +0 -1
- package/dist/config/ManagedIdentityId.cjs +0 -59
- package/dist/config/ManagedIdentityId.cjs.map +0 -1
- package/dist/config/ManagedIdentityRequestParameters.cjs +0 -37
- package/dist/config/ManagedIdentityRequestParameters.cjs.map +0 -1
- package/dist/crypto/CryptoProvider.cjs +0 -101
- package/dist/crypto/CryptoProvider.cjs.map +0 -1
- package/dist/crypto/GuidGenerator.cjs +0 -31
- package/dist/crypto/GuidGenerator.cjs.map +0 -1
- package/dist/crypto/HashUtils.cjs +0 -23
- package/dist/crypto/HashUtils.cjs.map +0 -1
- package/dist/crypto/PkceGenerator.cjs +0 -62
- package/dist/crypto/PkceGenerator.cjs.map +0 -1
- package/dist/error/ManagedIdentityError.cjs +0 -54
- package/dist/error/ManagedIdentityError.cjs.map +0 -1
- package/dist/error/ManagedIdentityErrorCodes.cjs +0 -47
- package/dist/error/ManagedIdentityErrorCodes.cjs.map +0 -1
- package/dist/error/NodeAuthError.cjs +0 -105
- package/dist/error/NodeAuthError.cjs.map +0 -1
- package/dist/index.cjs +0 -123
- package/dist/index.cjs.map +0 -1
- package/dist/internals.cjs +0 -19
- package/dist/internals.cjs.map +0 -1
- package/dist/network/HttpClient.cjs +0 -294
- package/dist/network/HttpClient.cjs.map +0 -1
- package/dist/network/HttpClientWithRetries.cjs +0 -44
- package/dist/network/HttpClientWithRetries.cjs.map +0 -1
- package/dist/network/LoopbackClient.cjs +0 -93
- package/dist/network/LoopbackClient.cjs.map +0 -1
- package/dist/packageMetadata.cjs +0 -11
- package/dist/packageMetadata.cjs.map +0 -1
- package/dist/retry/LinearRetryPolicy.cjs +0 -47
- package/dist/retry/LinearRetryPolicy.cjs.map +0 -1
- package/dist/utils/Constants.cjs +0 -170
- package/dist/utils/Constants.cjs.map +0 -1
- package/dist/utils/EncodingUtils.cjs +0 -53
- package/dist/utils/EncodingUtils.cjs.map +0 -1
- package/dist/utils/NetworkUtils.cjs +0 -45
- package/dist/utils/NetworkUtils.cjs.map +0 -1
|
@@ -1,294 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var msalCommon = require('@azure/msal-common');
|
|
6
|
-
var Constants = require('../utils/Constants.cjs');
|
|
7
|
-
var NetworkUtils = require('../utils/NetworkUtils.cjs');
|
|
8
|
-
var http = require('http');
|
|
9
|
-
var https = require('https');
|
|
10
|
-
|
|
11
|
-
/*
|
|
12
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
13
|
-
* Licensed under the MIT License.
|
|
14
|
-
*/
|
|
15
|
-
/**
|
|
16
|
-
* This class implements the API for network requests.
|
|
17
|
-
*/
|
|
18
|
-
class HttpClient {
|
|
19
|
-
constructor(proxyUrl, customAgentOptions) {
|
|
20
|
-
this.proxyUrl = proxyUrl || "";
|
|
21
|
-
this.customAgentOptions = customAgentOptions || {};
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Http Get request
|
|
25
|
-
* @param url
|
|
26
|
-
* @param options
|
|
27
|
-
*/
|
|
28
|
-
async sendGetRequestAsync(url, options, timeout) {
|
|
29
|
-
if (this.proxyUrl) {
|
|
30
|
-
return networkRequestViaProxy(url, this.proxyUrl, Constants.HttpMethod.GET, options, this.customAgentOptions, timeout);
|
|
31
|
-
}
|
|
32
|
-
else {
|
|
33
|
-
return networkRequestViaHttps(url, Constants.HttpMethod.GET, options, this.customAgentOptions, timeout);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
/**
|
|
37
|
-
* Http Post request
|
|
38
|
-
* @param url
|
|
39
|
-
* @param options
|
|
40
|
-
*/
|
|
41
|
-
async sendPostRequestAsync(url, options) {
|
|
42
|
-
if (this.proxyUrl) {
|
|
43
|
-
return networkRequestViaProxy(url, this.proxyUrl, Constants.HttpMethod.POST, options, this.customAgentOptions);
|
|
44
|
-
}
|
|
45
|
-
else {
|
|
46
|
-
return networkRequestViaHttps(url, Constants.HttpMethod.POST, options, this.customAgentOptions);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
const networkRequestViaProxy = (destinationUrlString, proxyUrlString, httpMethod, options, agentOptions, timeout) => {
|
|
51
|
-
const destinationUrl = new URL(destinationUrlString);
|
|
52
|
-
const proxyUrl = new URL(proxyUrlString);
|
|
53
|
-
// "method: connect" must be used to establish a connection to the proxy
|
|
54
|
-
const headers = options?.headers || {};
|
|
55
|
-
const tunnelRequestOptions = {
|
|
56
|
-
host: proxyUrl.hostname,
|
|
57
|
-
port: proxyUrl.port,
|
|
58
|
-
method: "CONNECT",
|
|
59
|
-
path: destinationUrl.hostname,
|
|
60
|
-
headers: headers,
|
|
61
|
-
};
|
|
62
|
-
if (agentOptions && Object.keys(agentOptions).length) {
|
|
63
|
-
tunnelRequestOptions.agent = new http.Agent(agentOptions);
|
|
64
|
-
}
|
|
65
|
-
// compose a request string for the socket
|
|
66
|
-
let postRequestStringContent = "";
|
|
67
|
-
if (httpMethod === Constants.HttpMethod.POST) {
|
|
68
|
-
const body = options?.body || "";
|
|
69
|
-
postRequestStringContent =
|
|
70
|
-
"Content-Type: application/x-www-form-urlencoded\r\n" +
|
|
71
|
-
`Content-Length: ${body.length}\r\n` +
|
|
72
|
-
`\r\n${body}`;
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
// optional timeout is only for get requests (regionDiscovery, for example)
|
|
76
|
-
if (timeout) {
|
|
77
|
-
tunnelRequestOptions.timeout = timeout;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
const outgoingRequestString = `${httpMethod.toUpperCase()} ${destinationUrl.href} HTTP/1.1\r\n` +
|
|
81
|
-
`Host: ${destinationUrl.host}\r\n` +
|
|
82
|
-
"Connection: close\r\n" +
|
|
83
|
-
postRequestStringContent +
|
|
84
|
-
"\r\n";
|
|
85
|
-
return new Promise((resolve, reject) => {
|
|
86
|
-
const request = http.request(tunnelRequestOptions);
|
|
87
|
-
if (timeout) {
|
|
88
|
-
request.on("timeout", () => {
|
|
89
|
-
request.destroy();
|
|
90
|
-
reject(new Error("Request time out"));
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
request.end();
|
|
94
|
-
// establish connection to the proxy
|
|
95
|
-
request.on("connect", (response, socket) => {
|
|
96
|
-
const proxyStatusCode = response?.statusCode || Constants.ProxyStatus.SERVER_ERROR;
|
|
97
|
-
if (proxyStatusCode < Constants.ProxyStatus.SUCCESS_RANGE_START ||
|
|
98
|
-
proxyStatusCode > Constants.ProxyStatus.SUCCESS_RANGE_END) {
|
|
99
|
-
request.destroy();
|
|
100
|
-
socket.destroy();
|
|
101
|
-
reject(new Error(`Error connecting to proxy. Http status code: ${response.statusCode}. Http status message: ${response?.statusMessage || "Unknown"}`));
|
|
102
|
-
}
|
|
103
|
-
// make a request over an HTTP tunnel
|
|
104
|
-
socket.write(outgoingRequestString);
|
|
105
|
-
const data = [];
|
|
106
|
-
socket.on("data", (chunk) => {
|
|
107
|
-
data.push(chunk);
|
|
108
|
-
});
|
|
109
|
-
socket.on("end", () => {
|
|
110
|
-
// combine all received buffer streams into one buffer, and then into a string
|
|
111
|
-
const dataString = Buffer.concat([...data]).toString();
|
|
112
|
-
// separate each line into it's own entry in an arry
|
|
113
|
-
const dataStringArray = dataString.split("\r\n");
|
|
114
|
-
// the first entry will contain the statusCode and statusMessage
|
|
115
|
-
const httpStatusCode = parseInt(dataStringArray[0].split(" ")[1]);
|
|
116
|
-
// remove "HTTP/1.1" and the status code to get the status message
|
|
117
|
-
const statusMessage = dataStringArray[0]
|
|
118
|
-
.split(" ")
|
|
119
|
-
.slice(2)
|
|
120
|
-
.join(" ");
|
|
121
|
-
// the last entry will contain the body
|
|
122
|
-
const body = dataStringArray[dataStringArray.length - 1];
|
|
123
|
-
// everything in between the first and last entries are the headers
|
|
124
|
-
const headersArray = dataStringArray.slice(1, dataStringArray.length - 2);
|
|
125
|
-
// build an object out of all the headers
|
|
126
|
-
const entries = new Map();
|
|
127
|
-
headersArray.forEach((header) => {
|
|
128
|
-
/**
|
|
129
|
-
* the header might look like "Content-Length: 1531", but that is just a string
|
|
130
|
-
* it needs to be converted to a key/value pair
|
|
131
|
-
* split the string at the first instance of ":"
|
|
132
|
-
* there may be more than one ":" if the value of the header is supposed to be a JSON object
|
|
133
|
-
*/
|
|
134
|
-
const headerKeyValue = header.split(new RegExp(/:\s(.*)/s));
|
|
135
|
-
const headerKey = headerKeyValue[0];
|
|
136
|
-
let headerValue = headerKeyValue[1];
|
|
137
|
-
// check if the value of the header is supposed to be a JSON object
|
|
138
|
-
try {
|
|
139
|
-
const object = JSON.parse(headerValue);
|
|
140
|
-
// if it is, then convert it from a string to a JSON object
|
|
141
|
-
if (object && typeof object === "object") {
|
|
142
|
-
headerValue = object;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
catch (e) {
|
|
146
|
-
// otherwise, leave it as a string
|
|
147
|
-
}
|
|
148
|
-
entries.set(headerKey, headerValue);
|
|
149
|
-
});
|
|
150
|
-
const headers = Object.fromEntries(entries);
|
|
151
|
-
const parsedHeaders = headers;
|
|
152
|
-
const networkResponse = NetworkUtils.NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(httpStatusCode, statusMessage, parsedHeaders, body), httpStatusCode);
|
|
153
|
-
if ((httpStatusCode < msalCommon.HttpStatus.SUCCESS_RANGE_START ||
|
|
154
|
-
httpStatusCode > msalCommon.HttpStatus.SUCCESS_RANGE_END) &&
|
|
155
|
-
// do not destroy the request for the device code flow
|
|
156
|
-
networkResponse.body["error"] !==
|
|
157
|
-
Constants.Constants.AUTHORIZATION_PENDING) {
|
|
158
|
-
request.destroy();
|
|
159
|
-
}
|
|
160
|
-
resolve(networkResponse);
|
|
161
|
-
});
|
|
162
|
-
socket.on("error", (chunk) => {
|
|
163
|
-
request.destroy();
|
|
164
|
-
socket.destroy();
|
|
165
|
-
reject(new Error(chunk.toString()));
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
request.on("error", (chunk) => {
|
|
169
|
-
request.destroy();
|
|
170
|
-
reject(new Error(chunk.toString()));
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
};
|
|
174
|
-
const networkRequestViaHttps = (urlString, httpMethod, options, agentOptions, timeout) => {
|
|
175
|
-
const isPostRequest = httpMethod === Constants.HttpMethod.POST;
|
|
176
|
-
const body = options?.body || "";
|
|
177
|
-
const url = new URL(urlString);
|
|
178
|
-
const headers = options?.headers || {};
|
|
179
|
-
const customOptions = {
|
|
180
|
-
method: httpMethod,
|
|
181
|
-
headers: headers,
|
|
182
|
-
...NetworkUtils.NetworkUtils.urlToHttpOptions(url),
|
|
183
|
-
};
|
|
184
|
-
if (agentOptions && Object.keys(agentOptions).length) {
|
|
185
|
-
customOptions.agent = new https.Agent(agentOptions);
|
|
186
|
-
}
|
|
187
|
-
if (isPostRequest) {
|
|
188
|
-
// needed for post request to work
|
|
189
|
-
customOptions.headers = {
|
|
190
|
-
...customOptions.headers,
|
|
191
|
-
"Content-Length": body.length,
|
|
192
|
-
};
|
|
193
|
-
}
|
|
194
|
-
else {
|
|
195
|
-
// optional timeout is only for get requests (regionDiscovery, for example)
|
|
196
|
-
if (timeout) {
|
|
197
|
-
customOptions.timeout = timeout;
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
return new Promise((resolve, reject) => {
|
|
201
|
-
let request;
|
|
202
|
-
// managed identity sources use http instead of https
|
|
203
|
-
if (customOptions.protocol === "http:") {
|
|
204
|
-
request = http.request(customOptions);
|
|
205
|
-
}
|
|
206
|
-
else {
|
|
207
|
-
request = https.request(customOptions);
|
|
208
|
-
}
|
|
209
|
-
if (isPostRequest) {
|
|
210
|
-
request.write(body);
|
|
211
|
-
}
|
|
212
|
-
if (timeout) {
|
|
213
|
-
request.on("timeout", () => {
|
|
214
|
-
request.destroy();
|
|
215
|
-
reject(new Error("Request time out"));
|
|
216
|
-
});
|
|
217
|
-
}
|
|
218
|
-
request.end();
|
|
219
|
-
request.on("response", (response) => {
|
|
220
|
-
const headers = response.headers;
|
|
221
|
-
const statusCode = response.statusCode;
|
|
222
|
-
const statusMessage = response.statusMessage;
|
|
223
|
-
const data = [];
|
|
224
|
-
response.on("data", (chunk) => {
|
|
225
|
-
data.push(chunk);
|
|
226
|
-
});
|
|
227
|
-
response.on("end", () => {
|
|
228
|
-
// combine all received buffer streams into one buffer, and then into a string
|
|
229
|
-
const body = Buffer.concat([...data]).toString();
|
|
230
|
-
const parsedHeaders = headers;
|
|
231
|
-
const networkResponse = NetworkUtils.NetworkUtils.getNetworkResponse(parsedHeaders, parseBody(statusCode, statusMessage, parsedHeaders, body), statusCode);
|
|
232
|
-
if ((statusCode < msalCommon.HttpStatus.SUCCESS_RANGE_START ||
|
|
233
|
-
statusCode > msalCommon.HttpStatus.SUCCESS_RANGE_END) &&
|
|
234
|
-
// do not destroy the request for the device code flow
|
|
235
|
-
networkResponse.body["error"] !==
|
|
236
|
-
Constants.Constants.AUTHORIZATION_PENDING) {
|
|
237
|
-
request.destroy();
|
|
238
|
-
}
|
|
239
|
-
resolve(networkResponse);
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
request.on("error", (chunk) => {
|
|
243
|
-
request.destroy();
|
|
244
|
-
reject(new Error(chunk.toString()));
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
};
|
|
248
|
-
/**
|
|
249
|
-
* Check if extra parsing is needed on the repsonse from the server
|
|
250
|
-
* @param statusCode {number} the status code of the response from the server
|
|
251
|
-
* @param statusMessage {string | undefined} the status message of the response from the server
|
|
252
|
-
* @param headers {Record<string, string>} the headers of the response from the server
|
|
253
|
-
* @param body {string} the body from the response of the server
|
|
254
|
-
* @returns {Object} JSON parsed body or error object
|
|
255
|
-
*/
|
|
256
|
-
const parseBody = (statusCode, statusMessage, headers, body) => {
|
|
257
|
-
/*
|
|
258
|
-
* Informational responses (100 – 199)
|
|
259
|
-
* Successful responses (200 – 299)
|
|
260
|
-
* Redirection messages (300 – 399)
|
|
261
|
-
* Client error responses (400 – 499)
|
|
262
|
-
* Server error responses (500 – 599)
|
|
263
|
-
*/
|
|
264
|
-
let parsedBody;
|
|
265
|
-
try {
|
|
266
|
-
parsedBody = JSON.parse(body);
|
|
267
|
-
}
|
|
268
|
-
catch (error) {
|
|
269
|
-
let errorType;
|
|
270
|
-
let errorDescriptionHelper;
|
|
271
|
-
if (statusCode >= msalCommon.HttpStatus.CLIENT_ERROR_RANGE_START &&
|
|
272
|
-
statusCode <= msalCommon.HttpStatus.CLIENT_ERROR_RANGE_END) {
|
|
273
|
-
errorType = "client_error";
|
|
274
|
-
errorDescriptionHelper = "A client";
|
|
275
|
-
}
|
|
276
|
-
else if (statusCode >= msalCommon.HttpStatus.SERVER_ERROR_RANGE_START &&
|
|
277
|
-
statusCode <= msalCommon.HttpStatus.SERVER_ERROR_RANGE_END) {
|
|
278
|
-
errorType = "server_error";
|
|
279
|
-
errorDescriptionHelper = "A server";
|
|
280
|
-
}
|
|
281
|
-
else {
|
|
282
|
-
errorType = "unknown_error";
|
|
283
|
-
errorDescriptionHelper = "An unknown";
|
|
284
|
-
}
|
|
285
|
-
parsedBody = {
|
|
286
|
-
error: errorType,
|
|
287
|
-
error_description: `${errorDescriptionHelper} error occured.\nHttp status code: ${statusCode}\nHttp status message: ${statusMessage || "Unknown"}\nHeaders: ${JSON.stringify(headers)}`,
|
|
288
|
-
};
|
|
289
|
-
}
|
|
290
|
-
return parsedBody;
|
|
291
|
-
};
|
|
292
|
-
|
|
293
|
-
exports.HttpClient = HttpClient;
|
|
294
|
-
//# sourceMappingURL=HttpClient.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClient.cjs","sources":["../../src/network/HttpClient.ts"],"sourcesContent":[null],"names":["HttpMethod","ProxyStatus","NetworkUtils","HttpStatus","Constants"],"mappings":";;;;;;;;;;AAAA;;;AAGG;AAaH;;AAEG;MACU,UAAU,CAAA;IAInB,WACI,CAAA,QAAiB,EACjB,kBAA2D,EAAA;AAE3D,QAAA,IAAI,CAAC,QAAQ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SAC1C,CAAC;AACL,KAAA;AAED,IAAA,OAAO,UAAU,CAAC;AACtB,CAAC;;;;"}
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var msalCommon = require('@azure/msal-common');
|
|
6
|
-
var Constants = require('../utils/Constants.cjs');
|
|
7
|
-
|
|
8
|
-
/*
|
|
9
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
10
|
-
* Licensed under the MIT License.
|
|
11
|
-
*/
|
|
12
|
-
class HttpClientWithRetries {
|
|
13
|
-
constructor(httpClientNoRetries, retryPolicy) {
|
|
14
|
-
this.httpClientNoRetries = httpClientNoRetries;
|
|
15
|
-
this.retryPolicy = retryPolicy;
|
|
16
|
-
}
|
|
17
|
-
async sendNetworkRequestAsyncHelper(httpMethod, url, options) {
|
|
18
|
-
if (httpMethod === Constants.HttpMethod.GET) {
|
|
19
|
-
return this.httpClientNoRetries.sendGetRequestAsync(url, options);
|
|
20
|
-
}
|
|
21
|
-
else {
|
|
22
|
-
return this.httpClientNoRetries.sendPostRequestAsync(url, options);
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
async sendNetworkRequestAsync(httpMethod, url, options) {
|
|
26
|
-
// the underlying network module (custom or HttpClient) will make the call
|
|
27
|
-
let response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
28
|
-
let currentRetry = 0;
|
|
29
|
-
while (await this.retryPolicy.pauseForRetry(response.status, currentRetry, response.headers[msalCommon.HeaderNames.RETRY_AFTER])) {
|
|
30
|
-
response = await this.sendNetworkRequestAsyncHelper(httpMethod, url, options);
|
|
31
|
-
currentRetry++;
|
|
32
|
-
}
|
|
33
|
-
return response;
|
|
34
|
-
}
|
|
35
|
-
async sendGetRequestAsync(url, options) {
|
|
36
|
-
return this.sendNetworkRequestAsync(Constants.HttpMethod.GET, url, options);
|
|
37
|
-
}
|
|
38
|
-
async sendPostRequestAsync(url, options) {
|
|
39
|
-
return this.sendNetworkRequestAsync(Constants.HttpMethod.POST, url, options);
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
exports.HttpClientWithRetries = HttpClientWithRetries;
|
|
44
|
-
//# sourceMappingURL=HttpClientWithRetries.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"HttpClientWithRetries.cjs","sources":["../../src/network/HttpClientWithRetries.ts"],"sourcesContent":[null],"names":["HttpMethod","HeaderNames"],"mappings":";;;;;;;AAAA;;;AAGG;MAWU,qBAAqB,CAAA;IAI9B,WACI,CAAA,mBAAmC,EACnC,WAA6B,EAAA;AAE7B,QAAA,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;AAC/C,QAAA,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;KAClC;AAEO,IAAA,MAAM,6BAA6B,CACvC,UAAsB,EACtB,GAAW,EACX,OAA+B,EAAA;AAE/B,QAAA,IAAI,UAAU,KAAKA,oBAAU,CAAC,GAAG,EAAE;YAC/B,OAAO,IAAI,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACrE,SAAA;AAAM,aAAA;YACH,OAAO,IAAI,CAAC,mBAAmB,CAAC,oBAAoB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;AACtE,SAAA;KACJ;AAEO,IAAA,MAAM,uBAAuB,CACjC,UAAsB,EACtB,GAAW,EACX,OAA+B,EAAA;;AAG/B,QAAA,IAAI,QAAQ,GACR,MAAM,IAAI,CAAC,6BAA6B,CAAC,UAAU,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;QAEvE,IAAI,YAAY,GAAW,CAAC,CAAC;QAC7B,OACI,MAAM,IAAI,CAAC,WAAW,CAAC,aAAa,CAChC,QAAQ,CAAC,MAAM,EACf,YAAY,EACZ,QAAQ,CAAC,OAAO,CAACC,sBAAW,CAAC,WAAW,CAAC,CAC5C,EACH;AACE,YAAA,QAAQ,GAAG,MAAM,IAAI,CAAC,6BAA6B,CAC/C,UAAU,EACV,GAAG,EACH,OAAO,CACV,CAAC;AACF,YAAA,YAAY,EAAE,CAAC;AAClB,SAAA;AAED,QAAA,OAAO,QAAQ,CAAC;KACnB;AAEM,IAAA,MAAM,mBAAmB,CAC5B,GAAW,EACX,OAA+B,EAAA;AAE/B,QAAA,OAAO,IAAI,CAAC,uBAAuB,CAACD,oBAAU,CAAC,GAAG,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KACrE;AAEM,IAAA,MAAM,oBAAoB,CAC7B,GAAW,EACX,OAA+B,EAAA;AAE/B,QAAA,OAAO,IAAI,CAAC,uBAAuB,CAACA,oBAAU,CAAC,IAAI,EAAE,GAAG,EAAE,OAAO,CAAC,CAAC;KACtE;AACJ;;;;"}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
var msalCommon = require('@azure/msal-common');
|
|
6
|
-
var http = require('http');
|
|
7
|
-
var NodeAuthError = require('../error/NodeAuthError.cjs');
|
|
8
|
-
var Constants = require('../utils/Constants.cjs');
|
|
9
|
-
|
|
10
|
-
/*
|
|
11
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
12
|
-
* Licensed under the MIT License.
|
|
13
|
-
*/
|
|
14
|
-
class LoopbackClient {
|
|
15
|
-
/**
|
|
16
|
-
* Spins up a loopback server which returns the server response when the localhost redirectUri is hit
|
|
17
|
-
* @param successTemplate
|
|
18
|
-
* @param errorTemplate
|
|
19
|
-
* @returns
|
|
20
|
-
*/
|
|
21
|
-
async listenForAuthCode(successTemplate, errorTemplate) {
|
|
22
|
-
if (this.server) {
|
|
23
|
-
throw NodeAuthError.NodeAuthError.createLoopbackServerAlreadyExistsError();
|
|
24
|
-
}
|
|
25
|
-
return new Promise((resolve, reject) => {
|
|
26
|
-
this.server = http.createServer((req, res) => {
|
|
27
|
-
const url = req.url;
|
|
28
|
-
if (!url) {
|
|
29
|
-
res.end(errorTemplate ||
|
|
30
|
-
"Error occurred loading redirectUrl");
|
|
31
|
-
reject(NodeAuthError.NodeAuthError.createUnableToLoadRedirectUrlError());
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
else if (url === msalCommon.Constants.FORWARD_SLASH) {
|
|
35
|
-
res.end(successTemplate ||
|
|
36
|
-
"Auth code was successfully acquired. You can close this window now.");
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
const redirectUri = this.getRedirectUri();
|
|
40
|
-
const parsedUrl = new URL(url, redirectUri);
|
|
41
|
-
const authCodeResponse = msalCommon.UrlUtils.getDeserializedResponse(parsedUrl.search) || {};
|
|
42
|
-
if (authCodeResponse.code) {
|
|
43
|
-
res.writeHead(msalCommon.HttpStatus.REDIRECT, {
|
|
44
|
-
location: redirectUri,
|
|
45
|
-
}); // Prevent auth code from being saved in the browser history
|
|
46
|
-
res.end();
|
|
47
|
-
}
|
|
48
|
-
if (authCodeResponse.error) {
|
|
49
|
-
res.end(errorTemplate ||
|
|
50
|
-
`Error occurred: ${authCodeResponse.error}`);
|
|
51
|
-
}
|
|
52
|
-
resolve(authCodeResponse);
|
|
53
|
-
});
|
|
54
|
-
this.server.listen(0, "127.0.0.1"); // Listen on any available port
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Get the port that the loopback server is running on
|
|
59
|
-
* @returns
|
|
60
|
-
*/
|
|
61
|
-
getRedirectUri() {
|
|
62
|
-
if (!this.server || !this.server.listening) {
|
|
63
|
-
throw NodeAuthError.NodeAuthError.createNoLoopbackServerExistsError();
|
|
64
|
-
}
|
|
65
|
-
const address = this.server.address();
|
|
66
|
-
if (!address || typeof address === "string" || !address.port) {
|
|
67
|
-
this.closeServer();
|
|
68
|
-
throw NodeAuthError.NodeAuthError.createInvalidLoopbackAddressTypeError();
|
|
69
|
-
}
|
|
70
|
-
const port = address && address.port;
|
|
71
|
-
return `${Constants.Constants.HTTP_PROTOCOL}${Constants.Constants.LOCALHOST}:${port}`;
|
|
72
|
-
}
|
|
73
|
-
/**
|
|
74
|
-
* Close the loopback server
|
|
75
|
-
*/
|
|
76
|
-
closeServer() {
|
|
77
|
-
if (this.server) {
|
|
78
|
-
// Only stops accepting new connections, server will close once open/idle connections are closed.
|
|
79
|
-
this.server.close();
|
|
80
|
-
if (typeof this.server.closeAllConnections === "function") {
|
|
81
|
-
/*
|
|
82
|
-
* Close open/idle connections. This API is available in Node versions 18.2 and higher
|
|
83
|
-
*/
|
|
84
|
-
this.server.closeAllConnections();
|
|
85
|
-
}
|
|
86
|
-
this.server.unref();
|
|
87
|
-
this.server = undefined;
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
exports.LoopbackClient = LoopbackClient;
|
|
93
|
-
//# sourceMappingURL=LoopbackClient.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LoopbackClient.cjs","sources":["../../src/network/LoopbackClient.ts"],"sourcesContent":[null],"names":["NodeAuthError","CommonConstants","UrlUtils","HttpStatus","Constants"],"mappings":";;;;;;;;;AAAA;;;AAGG;MAaU,cAAc,CAAA;AAGvB;;;;;AAKG;AACH,IAAA,MAAM,iBAAiB,CACnB,eAAwB,EACxB,aAAsB,EAAA;QAEtB,IAAI,IAAI,CAAC,MAAM,EAAE;AACb,YAAA,MAAMA,2BAAa,CAAC,sCAAsC,EAAE,CAAC;AAChE,SAAA;QAED,OAAO,IAAI,OAAO,CACd,CAAC,OAAO,EAAE,MAAM,KAAI;AAChB,YAAA,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,YAAY,CAC3B,CAAC,GAAyB,EAAE,GAAwB,KAAI;AACpD,gBAAA,MAAM,GAAG,GAAG,GAAG,CAAC,GAAG,CAAC;gB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YAAA,MAAMH,2BAAa,CAAC,iCAAiC,EAAE,CAAC;AAC3D,SAAA;QAED,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;AACtC,QAAA,IAAI,CAAC,OAAO,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,OAAO,CAAC,IAAI,EAAE;YAC1D,IAAI,CAAC,WAAW,EAAE,CAAC;AACnB,YAAA,MAAMA,2BAAa,CAAC,qCAAqC,EAAE,CAAC;AAC/D,SAAA;AAED,QAAA,MAAM,IAAI,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;QAErC,OAAO,CAAA,EAAGI,mBAAS,CAAC,aAAa,CAAA,EAAGA,mBAAS,CAAC,SAAS,CAAA,CAAA,EAAI,IAAI,CAAA,CAAE,CAAC;KACrE;AAED;;AAEG;IACH,WAAW,GAAA;QACP,IAAI,IAAI,CAAC,MAAM,EAAE;;AAEb,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;YAEpB,IAAI,OAAO,IAAI,CAAC,MAAM,CAAC,mBAAmB,KAAK,UAAU,EAAE;AACvD;;AAEG;AACH,gBAAA,IAAI,CAAC,MAAM,CAAC,mBAAmB,EAAE,CAAC;AACrC,aAAA;AACD,YAAA,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE,CAAC;AACpB,YAAA,IAAI,CAAC,MAAM,GAAG,SAAS,CAAC;AAC3B,SAAA;KACJ;AACJ;;;;"}
|
package/dist/packageMetadata.cjs
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
/* eslint-disable header/header */
|
|
6
|
-
const name = "@azure/msal-node";
|
|
7
|
-
const version = "2.13.1";
|
|
8
|
-
|
|
9
|
-
exports.name = name;
|
|
10
|
-
exports.version = version;
|
|
11
|
-
//# sourceMappingURL=packageMetadata.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"packageMetadata.cjs","sources":["../src/packageMetadata.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;AACO,MAAM,IAAI,GAAG,mBAAmB;AAChC,MAAM,OAAO,GAAG;;;;;"}
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/*! @azure/msal-node v2.13.1 2024-08-29 */
|
|
2
|
-
'use strict';
|
|
3
|
-
'use strict';
|
|
4
|
-
|
|
5
|
-
/*
|
|
6
|
-
* Copyright (c) Microsoft Corporation. All rights reserved.
|
|
7
|
-
* Licensed under the MIT License.
|
|
8
|
-
*/
|
|
9
|
-
class LinearRetryPolicy {
|
|
10
|
-
constructor(maxRetries, retryDelay, httpStatusCodesToRetryOn) {
|
|
11
|
-
this.maxRetries = maxRetries;
|
|
12
|
-
this.retryDelay = retryDelay;
|
|
13
|
-
this.httpStatusCodesToRetryOn = httpStatusCodesToRetryOn;
|
|
14
|
-
}
|
|
15
|
-
retryAfterMillisecondsToSleep(retryHeader) {
|
|
16
|
-
if (!retryHeader) {
|
|
17
|
-
return 0;
|
|
18
|
-
}
|
|
19
|
-
// retry-after header is in seconds
|
|
20
|
-
let millisToSleep = Math.round(parseFloat(retryHeader) * 1000);
|
|
21
|
-
/*
|
|
22
|
-
* retry-after header is in HTTP Date format
|
|
23
|
-
* <day-name>, <day> <month> <year> <hour>:<minute>:<second> GMT
|
|
24
|
-
*/
|
|
25
|
-
if (isNaN(millisToSleep)) {
|
|
26
|
-
millisToSleep = Math.max(0,
|
|
27
|
-
// .valueOf() is needed to subtract dates in TypeScript
|
|
28
|
-
new Date(retryHeader).valueOf() - new Date().valueOf());
|
|
29
|
-
}
|
|
30
|
-
return millisToSleep;
|
|
31
|
-
}
|
|
32
|
-
async pauseForRetry(httpStatusCode, currentRetry, retryAfterHeader) {
|
|
33
|
-
if (this.httpStatusCodesToRetryOn.includes(httpStatusCode) &&
|
|
34
|
-
currentRetry < this.maxRetries) {
|
|
35
|
-
const retryAfterDelay = this.retryAfterMillisecondsToSleep(retryAfterHeader);
|
|
36
|
-
await new Promise((resolve) => {
|
|
37
|
-
// retryAfterHeader value of 0 evaluates to false, and this.retryDelay will be used
|
|
38
|
-
return setTimeout(resolve, retryAfterDelay || this.retryDelay);
|
|
39
|
-
});
|
|
40
|
-
return true;
|
|
41
|
-
}
|
|
42
|
-
return false;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
exports.LinearRetryPolicy = LinearRetryPolicy;
|
|
47
|
-
//# sourceMappingURL=LinearRetryPolicy.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"LinearRetryPolicy.cjs","sources":["../../src/retry/LinearRetryPolicy.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAAA;;;AAGG;MAKU,iBAAiB,CAAA;AAK1B,IAAA,WAAA,CACI,UAAkB,EAClB,UAAkB,EAClB,wBAAuC,EAAA;AAEvC,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;AAC7B,QAAA,IAAI,CAAC,wBAAwB,GAAG,wBAAwB,CAAC;KAC5D;AAEO,IAAA,6BAA6B,CACjC,WAAoD,EAAA;QAEpD,IAAI,CAAC,WAAW,EAAE;AACd,YAAA,OAAO,CAAC,CAAC;AACZ,SAAA;;AAGD,QAAA,IAAI,aAAa,GAAG,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,WAAW,CAAC,GAAG,IAAI,CAAC,CAAC;AAE/D;;;AAGG;AACH,QAAA,IAAI,KAAK,CAAC,aAAa,CAAC,EAAE;AACtB,YAAA,aAAa,GAAG,IAAI,CAAC,GAAG,CACpB,CAAC;;AAED,YAAA,IAAI,IAAI,CAAC,WAAW,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,IAAI,EAAE,CAAC,OAAO,EAAE,CACzD,CAAC;AACL,S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