Browse Source

Update CodeAnalysis.ruleset to ignore CA2254 information messages

pull/1412/head
Kévin Chalet 4 years ago
parent
commit
66745bc4ae
  1. 1
      eng/CodeAnalysis.ruleset
  2. 5
      src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs
  3. 5
      src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs
  4. 5
      src/OpenIddict.Server.Owin/OpenIddictServerOwinHandlers.cs

1
eng/CodeAnalysis.ruleset

@ -155,6 +155,7 @@
<Rule Id="CA2247" Action="Warning" /> <!-- Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum. --> <Rule Id="CA2247" Action="Warning" /> <!-- Argument passed to TaskCompletionSource constructor should be TaskCreationOptions enum instead of TaskContinuationOptions enum. -->
<Rule Id="CA2248" Action="Warning" /> <!-- Provide correct 'enum' argument to 'Enum.HasFlag' --> <Rule Id="CA2248" Action="Warning" /> <!-- Provide correct 'enum' argument to 'Enum.HasFlag' -->
<Rule Id="CA2249" Action="Warning" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' --> <Rule Id="CA2249" Action="Warning" /> <!-- Consider using 'string.Contains' instead of 'string.IndexOf' -->
<Rule Id="CA2254" Action="None" /> <!-- Template should be a static expression -->
<Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter --> <Rule Id="CA2300" Action="None" /> <!-- Do not use insecure deserializer BinaryFormatter -->
<Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder --> <Rule Id="CA2301" Action="None" /> <!-- Do not call BinaryFormatter.Deserialize without first setting BinaryFormatter.Binder -->
<Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize --> <Rule Id="CA2302" Action="None" /> <!-- Ensure BinaryFormatter.Binder is set before calling BinaryFormatter.Deserialize -->

5
src/OpenIddict.Client.AspNetCore/OpenIddictClientAspNetCoreHandlers.cs

@ -647,11 +647,6 @@ public static partial class OpenIddictClientAspNetCoreHandlers
/// <inheritdoc/> /// <inheritdoc/>
public ValueTask HandleAsync(TContext context!!) 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)); Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
if (string.IsNullOrEmpty(context.Transaction.Response.Error)) if (string.IsNullOrEmpty(context.Transaction.Response.Error))

5
src/OpenIddict.Server.AspNetCore/OpenIddictServerAspNetCoreHandlers.cs

@ -1083,11 +1083,6 @@ public static partial class OpenIddictServerAspNetCoreHandlers
/// <inheritdoc/> /// <inheritdoc/>
public ValueTask HandleAsync(TContext context!!) 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)); Debug.Assert(context.Transaction.Response is not null, SR.GetResourceString(SR.ID4007));
if (string.IsNullOrEmpty(context.Transaction.Response.Error)) if (string.IsNullOrEmpty(context.Transaction.Response.Error))

5
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)); 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)) if (string.IsNullOrEmpty(context.Transaction.Response.Error))
{ {
return default; return default;

Loading…
Cancel
Save