From 4a258b4565aedd084df05243f679e7dc81e3919b Mon Sep 17 00:00:00 2001 From: Pranav K Date: Thu, 8 Jun 2017 08:43:38 -0700 Subject: [PATCH] Remove usage of TaskCache --- .../CookieAuthenticationHandler.cs | 5 +---- .../Events/CookieAuthenticationEvents.cs | 17 ++++++++--------- ...t.AspNetCore.Authentication.Cookies.csproj | 1 - .../Events/JwtBearerEvents.cs | 9 ++++----- .../JwtBearerAppBuilderExtensions.cs | 1 - ...AspNetCore.Authentication.JwtBearer.csproj | 1 - .../Events/OAuthEvents.cs | 5 ++--- ...oft.AspNetCore.Authentication.OAuth.csproj | 1 - .../Events/OpenIdConnectEvents.cs | 19 +++++++++---------- ...etCore.Authentication.OpenIdConnect.csproj | 1 - .../Events/TwitterEvents.cs | 5 ++--- ...t.AspNetCore.Authentication.Twitter.csproj | 1 - .../AuthenticationHandler.cs | 11 +++++------ .../Events/RemoteAuthenticationEvents.cs | 5 ++--- ...Microsoft.AspNetCore.Authentication.csproj | 1 - ...oft.AspNetCore.Authorization.Policy.csproj | 1 - .../ClaimsAuthorizationRequirement.cs | 3 +-- .../DenyAnonymousAuthorizationRequirement.cs | 3 +-- .../NameAuthorizationRequirement.cs | 3 +-- .../RolesAuthorizationRequirement.cs | 3 +-- .../Microsoft.AspNetCore.Authorization.csproj | 1 - 21 files changed, 37 insertions(+), 60 deletions(-) diff --git a/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationHandler.cs b/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationHandler.cs index bb2c10fee5..9b04026cd1 100644 --- a/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationHandler.cs +++ b/src/Microsoft.AspNetCore.Authentication.Cookies/CookieAuthenticationHandler.cs @@ -6,11 +6,8 @@ using System.Linq; using System.Security.Claims; using System.Text.Encodings.Web; using System.Threading.Tasks; -using Microsoft.AspNetCore.DataProtection; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Features; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using Microsoft.Net.Http.Headers; @@ -50,7 +47,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies { // Cookies needs to finish the response Context.Response.OnStarting(FinishResponseAsync); - return TaskCache.CompletedTask; + return Task.CompletedTask; } /// diff --git a/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs b/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs index 5cb933ce1d..c7c375de23 100644 --- a/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication.Cookies/Events/CookieAuthenticationEvents.cs @@ -4,7 +4,6 @@ using System; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication.Cookies { @@ -18,22 +17,22 @@ namespace Microsoft.AspNetCore.Authentication.Cookies /// /// A delegate assigned to this property will be invoked when the related method is called. /// - public Func OnValidatePrincipal { get; set; } = context => TaskCache.CompletedTask; + public Func OnValidatePrincipal { get; set; } = context => Task.CompletedTask; /// /// A delegate assigned to this property will be invoked when the related method is called. /// - public Func OnSigningIn { get; set; } = context => TaskCache.CompletedTask; + public Func OnSigningIn { get; set; } = context => Task.CompletedTask; /// /// A delegate assigned to this property will be invoked when the related method is called. /// - public Func OnSignedIn { get; set; } = context => TaskCache.CompletedTask; + public Func OnSignedIn { get; set; } = context => Task.CompletedTask; /// /// A delegate assigned to this property will be invoked when the related method is called. /// - public Func OnSigningOut { get; set; } = context => TaskCache.CompletedTask; + public Func OnSigningOut { get; set; } = context => Task.CompletedTask; /// /// A delegate assigned to this property will be invoked when the related method is called. @@ -49,7 +48,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies { context.Response.Redirect(context.RedirectUri); } - return TaskCache.CompletedTask; + return Task.CompletedTask; }; /// @@ -66,7 +65,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies { context.Response.Redirect(context.RedirectUri); } - return TaskCache.CompletedTask; + return Task.CompletedTask; }; /// @@ -82,7 +81,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies { context.Response.Redirect(context.RedirectUri); } - return TaskCache.CompletedTask; + return Task.CompletedTask; }; /// @@ -98,7 +97,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies { context.Response.Redirect(context.RedirectUri); } - return TaskCache.CompletedTask; + return Task.CompletedTask; }; private static bool IsAjaxRequest(HttpRequest request) diff --git a/src/Microsoft.AspNetCore.Authentication.Cookies/Microsoft.AspNetCore.Authentication.Cookies.csproj b/src/Microsoft.AspNetCore.Authentication.Cookies/Microsoft.AspNetCore.Authentication.Cookies.csproj index 41c4ff7905..95aebf38bc 100644 --- a/src/Microsoft.AspNetCore.Authentication.Cookies/Microsoft.AspNetCore.Authentication.Cookies.csproj +++ b/src/Microsoft.AspNetCore.Authentication.Cookies/Microsoft.AspNetCore.Authentication.Cookies.csproj @@ -18,7 +18,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authentication.JwtBearer/Events/JwtBearerEvents.cs b/src/Microsoft.AspNetCore.Authentication.JwtBearer/Events/JwtBearerEvents.cs index c4e2e7b5a9..a9b35c310f 100644 --- a/src/Microsoft.AspNetCore.Authentication.JwtBearer/Events/JwtBearerEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication.JwtBearer/Events/JwtBearerEvents.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication.JwtBearer { @@ -15,22 +14,22 @@ namespace Microsoft.AspNetCore.Authentication.JwtBearer /// /// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed. /// - public Func OnAuthenticationFailed { get; set; } = context => TaskCache.CompletedTask; + public Func OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; /// /// Invoked when a protocol message is first received. /// - public Func OnMessageReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnMessageReceived { get; set; } = context => Task.CompletedTask; /// /// Invoked after the security token has passed validation and a ClaimsIdentity has been generated. /// - public Func OnTokenValidated { get; set; } = context => TaskCache.CompletedTask; + public Func OnTokenValidated { get; set; } = context => Task.CompletedTask; /// /// Invoked before a challenge is sent back to the caller. /// - public Func OnChallenge { get; set; } = context => TaskCache.CompletedTask; + public Func OnChallenge { get; set; } = context => Task.CompletedTask; public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); diff --git a/src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerAppBuilderExtensions.cs b/src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerAppBuilderExtensions.cs index 6b1b1afd4a..9755c5cb7d 100644 --- a/src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerAppBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.Authentication.JwtBearer/JwtBearerAppBuilderExtensions.cs @@ -3,7 +3,6 @@ using System; using Microsoft.AspNetCore.Authentication.JwtBearer; -using Microsoft.Extensions.Options; namespace Microsoft.AspNetCore.Builder { diff --git a/src/Microsoft.AspNetCore.Authentication.JwtBearer/Microsoft.AspNetCore.Authentication.JwtBearer.csproj b/src/Microsoft.AspNetCore.Authentication.JwtBearer/Microsoft.AspNetCore.Authentication.JwtBearer.csproj index 73d8fdd008..3c55004a47 100644 --- a/src/Microsoft.AspNetCore.Authentication.JwtBearer/Microsoft.AspNetCore.Authentication.JwtBearer.csproj +++ b/src/Microsoft.AspNetCore.Authentication.JwtBearer/Microsoft.AspNetCore.Authentication.JwtBearer.csproj @@ -11,6 +11,5 @@ - diff --git a/src/Microsoft.AspNetCore.Authentication.OAuth/Events/OAuthEvents.cs b/src/Microsoft.AspNetCore.Authentication.OAuth/Events/OAuthEvents.cs index 4e94a15bc6..b3572cab4c 100644 --- a/src/Microsoft.AspNetCore.Authentication.OAuth/Events/OAuthEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication.OAuth/Events/OAuthEvents.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication.OAuth { @@ -15,7 +14,7 @@ namespace Microsoft.AspNetCore.Authentication.OAuth /// /// Gets or sets the function that is invoked when the CreatingTicket method is invoked. /// - public Func OnCreatingTicket { get; set; } = context => TaskCache.CompletedTask; + public Func OnCreatingTicket { get; set; } = context => Task.CompletedTask; /// /// Gets or sets the delegate that is invoked when the RedirectToAuthorizationEndpoint method is invoked. @@ -23,7 +22,7 @@ namespace Microsoft.AspNetCore.Authentication.OAuth public Func OnRedirectToAuthorizationEndpoint { get; set; } = context => { context.Response.Redirect(context.RedirectUri); - return TaskCache.CompletedTask; + return Task.CompletedTask; }; /// diff --git a/src/Microsoft.AspNetCore.Authentication.OAuth/Microsoft.AspNetCore.Authentication.OAuth.csproj b/src/Microsoft.AspNetCore.Authentication.OAuth/Microsoft.AspNetCore.Authentication.OAuth.csproj index 508c815fe8..88d6794e9d 100644 --- a/src/Microsoft.AspNetCore.Authentication.OAuth/Microsoft.AspNetCore.Authentication.OAuth.csproj +++ b/src/Microsoft.AspNetCore.Authentication.OAuth/Microsoft.AspNetCore.Authentication.OAuth.csproj @@ -13,7 +13,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs index f6386aeec8..660eba0b33 100644 --- a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Events/OpenIdConnectEvents.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication.OpenIdConnect { @@ -15,47 +14,47 @@ namespace Microsoft.AspNetCore.Authentication.OpenIdConnect /// /// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed. /// - public Func OnAuthenticationFailed { get; set; } = context => TaskCache.CompletedTask; + public Func OnAuthenticationFailed { get; set; } = context => Task.CompletedTask; /// /// Invoked after security token validation if an authorization code is present in the protocol message. /// - public Func OnAuthorizationCodeReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnAuthorizationCodeReceived { get; set; } = context => Task.CompletedTask; /// /// Invoked when a protocol message is first received. /// - public Func OnMessageReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnMessageReceived { get; set; } = context => Task.CompletedTask; /// /// Invoked before redirecting to the identity provider to authenticate. /// - public Func OnRedirectToIdentityProvider { get; set; } = context => TaskCache.CompletedTask; + public Func OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask; /// /// Invoked before redirecting to the identity provider to sign out. /// - public Func OnRedirectToIdentityProviderForSignOut { get; set; } = context => TaskCache.CompletedTask; + public Func OnRedirectToIdentityProviderForSignOut { get; set; } = context => Task.CompletedTask; /// /// Invoked when a request is received on the RemoteSignOutPath. /// - public Func OnRemoteSignOut { get; set; } = context => TaskCache.CompletedTask; + public Func OnRemoteSignOut { get; set; } = context => Task.CompletedTask; /// /// Invoked after "authorization code" is redeemed for tokens at the token endpoint. /// - public Func OnTokenResponseReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnTokenResponseReceived { get; set; } = context => Task.CompletedTask; /// /// Invoked when an IdToken has been validated and produced an AuthenticationTicket. /// - public Func OnTokenValidated { get; set; } = context => TaskCache.CompletedTask; + public Func OnTokenValidated { get; set; } = context => Task.CompletedTask; /// /// Invoked when user information is retrieved from the UserInfoEndpoint. /// - public Func OnUserInformationReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnUserInformationReceived { get; set; } = context => Task.CompletedTask; public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); diff --git a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Microsoft.AspNetCore.Authentication.OpenIdConnect.csproj b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Microsoft.AspNetCore.Authentication.OpenIdConnect.csproj index 8e4fb774db..d3789cd507 100644 --- a/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Microsoft.AspNetCore.Authentication.OpenIdConnect.csproj +++ b/src/Microsoft.AspNetCore.Authentication.OpenIdConnect/Microsoft.AspNetCore.Authentication.OpenIdConnect.csproj @@ -10,7 +10,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authentication.Twitter/Events/TwitterEvents.cs b/src/Microsoft.AspNetCore.Authentication.Twitter/Events/TwitterEvents.cs index 2c8b30e9fc..c079ebb14f 100644 --- a/src/Microsoft.AspNetCore.Authentication.Twitter/Events/TwitterEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication.Twitter/Events/TwitterEvents.cs @@ -3,7 +3,6 @@ using System; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication.Twitter { @@ -15,7 +14,7 @@ namespace Microsoft.AspNetCore.Authentication.Twitter /// /// Gets or sets the function that is invoked when the Authenticated method is invoked. /// - public Func OnCreatingTicket { get; set; } = context => TaskCache.CompletedTask; + public Func OnCreatingTicket { get; set; } = context => Task.CompletedTask; /// /// Gets or sets the delegate that is invoked when the ApplyRedirect method is invoked. @@ -23,7 +22,7 @@ namespace Microsoft.AspNetCore.Authentication.Twitter public Func OnRedirectToAuthorizationEndpoint { get; set; } = context => { context.Response.Redirect(context.RedirectUri); - return TaskCache.CompletedTask; + return Task.CompletedTask; }; /// diff --git a/src/Microsoft.AspNetCore.Authentication.Twitter/Microsoft.AspNetCore.Authentication.Twitter.csproj b/src/Microsoft.AspNetCore.Authentication.Twitter/Microsoft.AspNetCore.Authentication.Twitter.csproj index 6bf4a66d3f..8d834ee8d1 100644 --- a/src/Microsoft.AspNetCore.Authentication.Twitter/Microsoft.AspNetCore.Authentication.Twitter.csproj +++ b/src/Microsoft.AspNetCore.Authentication.Twitter/Microsoft.AspNetCore.Authentication.Twitter.csproj @@ -13,7 +13,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs b/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs index b094709196..788df7e19c 100644 --- a/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs +++ b/src/Microsoft.AspNetCore.Authentication/AuthenticationHandler.cs @@ -7,7 +7,6 @@ using System.Text.Encodings.Web; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Internal; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; @@ -119,7 +118,7 @@ namespace Microsoft.AspNetCore.Authentication /// A task protected virtual Task InitializeHandlerAsync() { - return TaskCache.CompletedTask; + return Task.CompletedTask; } protected string BuildRedirectUri(string targetPath) @@ -193,7 +192,7 @@ namespace Microsoft.AspNetCore.Authentication protected virtual Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) { - return TaskCache.CompletedTask; + return Task.CompletedTask; } public async Task SignOutAsync(AuthenticationProperties properties) @@ -205,7 +204,7 @@ namespace Microsoft.AspNetCore.Authentication protected virtual Task HandleSignOutAsync(AuthenticationProperties properties) { - return TaskCache.CompletedTask; + return Task.CompletedTask; } /// @@ -216,7 +215,7 @@ namespace Microsoft.AspNetCore.Authentication protected virtual Task HandleForbiddenAsync(AuthenticationProperties properties) { Response.StatusCode = 403; - return TaskCache.CompletedTask; + return Task.CompletedTask; } /// @@ -229,7 +228,7 @@ namespace Microsoft.AspNetCore.Authentication protected virtual Task HandleChallengeAsync(AuthenticationProperties properties) { Response.StatusCode = 401; - return TaskCache.CompletedTask; + return Task.CompletedTask; } public async Task ChallengeAsync(AuthenticationProperties properties) diff --git a/src/Microsoft.AspNetCore.Authentication/Events/RemoteAuthenticationEvents.cs b/src/Microsoft.AspNetCore.Authentication/Events/RemoteAuthenticationEvents.cs index a130c1b14c..83a6507d42 100644 --- a/src/Microsoft.AspNetCore.Authentication/Events/RemoteAuthenticationEvents.cs +++ b/src/Microsoft.AspNetCore.Authentication/Events/RemoteAuthenticationEvents.cs @@ -3,15 +3,14 @@ using System; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authentication { public class RemoteAuthenticationEvents { - public Func OnRemoteFailure { get; set; } = context => TaskCache.CompletedTask; + public Func OnRemoteFailure { get; set; } = context => Task.CompletedTask; - public Func OnTicketReceived { get; set; } = context => TaskCache.CompletedTask; + public Func OnTicketReceived { get; set; } = context => Task.CompletedTask; /// /// Invoked when there is a remote failure diff --git a/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj b/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj index cbdb05b58a..adbd5b3f16 100644 --- a/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj +++ b/src/Microsoft.AspNetCore.Authentication/Microsoft.AspNetCore.Authentication.csproj @@ -19,7 +19,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj b/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj index b8447e4154..83530a2bed 100644 --- a/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj +++ b/src/Microsoft.AspNetCore.Authorization.Policy/Microsoft.AspNetCore.Authorization.Policy.csproj @@ -17,7 +17,6 @@ - diff --git a/src/Microsoft.AspNetCore.Authorization/Infrastructure/ClaimsAuthorizationRequirement.cs b/src/Microsoft.AspNetCore.Authorization/Infrastructure/ClaimsAuthorizationRequirement.cs index 4248e4813d..93b1deea6d 100644 --- a/src/Microsoft.AspNetCore.Authorization/Infrastructure/ClaimsAuthorizationRequirement.cs +++ b/src/Microsoft.AspNetCore.Authorization/Infrastructure/ClaimsAuthorizationRequirement.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authorization.Infrastructure { @@ -68,7 +67,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure context.Succeed(requirement); } } - return TaskCache.CompletedTask; + return Task.CompletedTask; } } } diff --git a/src/Microsoft.AspNetCore.Authorization/Infrastructure/DenyAnonymousAuthorizationRequirement.cs b/src/Microsoft.AspNetCore.Authorization/Infrastructure/DenyAnonymousAuthorizationRequirement.cs index 5bae319b3e..e88cce7aac 100644 --- a/src/Microsoft.AspNetCore.Authorization/Infrastructure/DenyAnonymousAuthorizationRequirement.cs +++ b/src/Microsoft.AspNetCore.Authorization/Infrastructure/DenyAnonymousAuthorizationRequirement.cs @@ -3,7 +3,6 @@ using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authorization.Infrastructure { @@ -28,7 +27,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure { context.Succeed(requirement); } - return TaskCache.CompletedTask; + return Task.CompletedTask; } } } diff --git a/src/Microsoft.AspNetCore.Authorization/Infrastructure/NameAuthorizationRequirement.cs b/src/Microsoft.AspNetCore.Authorization/Infrastructure/NameAuthorizationRequirement.cs index 9fb295082b..02ab946fad 100644 --- a/src/Microsoft.AspNetCore.Authorization/Infrastructure/NameAuthorizationRequirement.cs +++ b/src/Microsoft.AspNetCore.Authorization/Infrastructure/NameAuthorizationRequirement.cs @@ -4,7 +4,6 @@ using System; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authorization.Infrastructure { @@ -47,7 +46,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure context.Succeed(requirement); } } - return TaskCache.CompletedTask; + return Task.CompletedTask; } } } diff --git a/src/Microsoft.AspNetCore.Authorization/Infrastructure/RolesAuthorizationRequirement.cs b/src/Microsoft.AspNetCore.Authorization/Infrastructure/RolesAuthorizationRequirement.cs index 44e2b9a220..811e17aacd 100644 --- a/src/Microsoft.AspNetCore.Authorization/Infrastructure/RolesAuthorizationRequirement.cs +++ b/src/Microsoft.AspNetCore.Authorization/Infrastructure/RolesAuthorizationRequirement.cs @@ -5,7 +5,6 @@ using System; using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using Microsoft.Extensions.Internal; namespace Microsoft.AspNetCore.Authorization.Infrastructure { @@ -62,7 +61,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure context.Succeed(requirement); } } - return TaskCache.CompletedTask; + return Task.CompletedTask; } } diff --git a/src/Microsoft.AspNetCore.Authorization/Microsoft.AspNetCore.Authorization.csproj b/src/Microsoft.AspNetCore.Authorization/Microsoft.AspNetCore.Authorization.csproj index 0022d27437..15100fbbcc 100644 --- a/src/Microsoft.AspNetCore.Authorization/Microsoft.AspNetCore.Authorization.csproj +++ b/src/Microsoft.AspNetCore.Authorization/Microsoft.AspNetCore.Authorization.csproj @@ -17,7 +17,6 @@ Microsoft.AspNetCore.Authorization.AuthorizeAttribute -