From 66745bc4aee03a7bdc1150e72c67d7366056beb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A9vin=20Chalet?= Date: Thu, 7 Apr 2022 23:53:37 +0200 Subject: [PATCH] Update CodeAnalysis.ruleset to ignore CA2254 information messages --- eng/CodeAnalysis.ruleset | 1 + .../OpenIddictClientAspNetCoreHandlers.cs | 5 ----- .../OpenIddictServerAspNetCoreHandlers.cs | 5 ----- src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs | 5 ----- 4 files changed, 1 insertion(+), 15 deletions(-) diff --git a/eng/CodeAnalysis.ruleset b/eng/CodeAnalysis.ruleset index cb3ed733..67b003d8 100644 --- a/eng/CodeAnalysis.ruleset +++ b/eng/CodeAnalysis.ruleset @@ -155,6 +155,7 @@ + diff --git a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs index 002693f6..902f45e6 100644 --- a/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs +++ b/src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs @@ -647,11 +647,6 @@ public static partial class OpenIddictClientAspNetCoreHandlers /// public ValueTask HandleAsync(TContext context!!) { - // This handler only applies to ASP.NET Core requests. If the HTTP context cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetHttpRequest()?.HttpContext.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0114)); - Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); if (string.IsNullOrEmpty(context.Transaction.Response.Error)) diff --git a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs index 34a80ce2..cd8b5fe3 100644 --- a/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs +++ b/src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs @@ -1083,11 +1083,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers /// public ValueTask HandleAsync(TContext context!!) { - // This handler only applies to ASP.NET Core requests. If the HTTP context cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetHttpRequest()?.HttpContext.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0114)); - Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); if (string.IsNullOrEmpty(context.Transaction.Response.Error)) diff --git a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs index 50cc2d38..5bc324da 100644 --- a/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs +++ b/src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs @@ -966,11 +966,6 @@ public static partial class OpenIddictServerOwinHandlers { Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007)); - // This handler only applies to OWIN requests. If The OWIN request cannot be resolved, - // this may indicate that the request was incorrectly processed by another server stack. - var response = context.Transaction.GetOwinRequest()?.Context.Response ?? - throw new InvalidOperationException(SR.GetResourceString(SR.ID0120)); - if (string.IsNullOrEmpty(context.Transaction.Response.Error)) { return default;