Skip to content

Commit

Permalink
Remove generated REST client which depends on deprecated package.
Browse files Browse the repository at this point in the history
* For `RestHealthCheckService` (not really used now), the HttpClient timeout is not impacted by user settings.
* For `ServiceManager.IsServiceHeathy`, the http client timeout is impacted by user settings.
* For AAD related REST API calls, because they uses a static `HttpClientFactory` instance, they have never impacted by the user settings.
  • Loading branch information
Y-Sindo committed Oct 25, 2023
1 parent b708962 commit 23ed13e
Show file tree
Hide file tree
Showing 29 changed files with 315 additions and 1,135 deletions.
1 change: 0 additions & 1 deletion Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@
<SignedPackageFile Include="$(PublishDir)Microsoft.IdentityModel.Protocols.OpenIdConnect.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)Microsoft.IdentityModel.Protocols.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)Microsoft.IdentityModel.Tokens.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)Microsoft.Rest.ClientRuntime.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)Newtonsoft.Json.Bson.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)Newtonsoft.Json.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
<SignedPackageFile Include="$(PublishDir)System.IO.Pipelines.dll" Certificate="$(AssemblySigningCertName)" Visible="false" />
Expand Down
1 change: 0 additions & 1 deletion build/dependencies.props
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
<MicrosoftExtensionsLoggingPackageVersion>2.1.0</MicrosoftExtensionsLoggingPackageVersion>
<MicrosoftExtensionsPrimitivesPackageVersion>2.1.1</MicrosoftExtensionsPrimitivesPackageVersion>
<MicrosoftAspNetCoreSignalRClient>1.1.0</MicrosoftAspNetCoreSignalRClient>
<MicrosoftRestClientRuntimePackageVersion>2.3.21</MicrosoftRestClientRuntimePackageVersion>

<!--Security Patch-->
<!-- Fix risks from Microsoft.AspNetCore.SignalR 1.0.0-->
Expand Down
1 change: 0 additions & 1 deletion src/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@

<ItemGroup Condition=" '$(OutputType)' != 'Exe'">
<PackageReference Include="Microsoft.Extensions.Http" Version="$(MicrosoftExtensionHttpVersion)" />
<PackageReference Include="Microsoft.Rest.ClientRuntime" Version="$(MicrosoftRestClientRuntimePackageVersion)" />
<PackageReference Include="Azure.Identity" Version="$(AzureIdentityPackageVersion)" />
<PackageReference Include="System.IdentityModel.Tokens.Jwt" Version="$(SystemIdentityModelTokensJwtPackageVersion)" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
Expand Down
2 changes: 2 additions & 0 deletions src/Microsoft.Azure.SignalR.Common/Constants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ public static class HttpClientNames
{
public const string Resilient = "Resilient";
public const string MessageResilient = "MessageResilient";
public const string UserDefault = "UserDefault";
public const string InternalDefault = "InternalDefault";
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,12 @@
// Licensed under the MIT license. See LICENSE file in the project root for full license information.

using System;
using System.Net;
using System.Net.Http;
using System.Net.WebSockets;

using Microsoft.Rest;

namespace Microsoft.Azure.SignalR.Common
{
internal static class ExceptionExtensions
{
internal static Exception WrapAsAzureSignalRException(this Exception e, Uri baseUri)
{
switch (e)
{
case HttpOperationException operationException:
var response = operationException.Response;
var request = operationException.Request;
var detail = response.Content;

var innerException = new HttpRequestException(
$"Response status code does not indicate success: {(int)response.StatusCode} ({response.ReasonPhrase})", operationException);

return response.StatusCode switch
{
HttpStatusCode.BadRequest => new AzureSignalRInvalidArgumentException(request.RequestUri.ToString(), innerException, detail),
HttpStatusCode.Unauthorized => new AzureSignalRUnauthorizedException(request.RequestUri.ToString(), innerException),
HttpStatusCode.NotFound => new AzureSignalRInaccessibleEndpointException(request.RequestUri.ToString(), innerException),
_ => new AzureSignalRRuntimeException(baseUri.ToString(), innerException),
};
case HttpRequestException requestException:
return new AzureSignalRInaccessibleEndpointException(baseUri.ToString(), requestException);
default:
return e;
}
}

internal static Exception WrapAsAzureSignalRException(this Exception e)
{
switch (e)
Expand Down
157 changes: 0 additions & 157 deletions src/Microsoft.Azure.SignalR.Common/RestClients/Generated/HealthApi.cs

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 23ed13e

Please sign in to comment.