Remove usage of TaskCache

This commit is contained in:
Pranav K 2017-06-08 08:43:38 -07:00
parent a561da0b3f
commit 4a258b4565
21 changed files with 37 additions and 60 deletions

View File

@ -6,11 +6,8 @@ using System.Linq;
using System.Security.Claims; using System.Security.Claims;
using System.Text.Encodings.Web; using System.Text.Encodings.Web;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.DataProtection;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Http.Features; using Microsoft.AspNetCore.Http.Features;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
using Microsoft.Net.Http.Headers; using Microsoft.Net.Http.Headers;
@ -50,7 +47,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
{ {
// Cookies needs to finish the response // Cookies needs to finish the response
Context.Response.OnStarting(FinishResponseAsync); Context.Response.OnStarting(FinishResponseAsync);
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
/// <summary> /// <summary>

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication.Cookies namespace Microsoft.AspNetCore.Authentication.Cookies
{ {
@ -18,22 +17,22 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
/// <summary> /// <summary>
/// A delegate assigned to this property will be invoked when the related method is called. /// A delegate assigned to this property will be invoked when the related method is called.
/// </summary> /// </summary>
public Func<CookieValidatePrincipalContext, Task> OnValidatePrincipal { get; set; } = context => TaskCache.CompletedTask; public Func<CookieValidatePrincipalContext, Task> OnValidatePrincipal { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// A delegate assigned to this property will be invoked when the related method is called. /// A delegate assigned to this property will be invoked when the related method is called.
/// </summary> /// </summary>
public Func<CookieSigningInContext, Task> OnSigningIn { get; set; } = context => TaskCache.CompletedTask; public Func<CookieSigningInContext, Task> OnSigningIn { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// A delegate assigned to this property will be invoked when the related method is called. /// A delegate assigned to this property will be invoked when the related method is called.
/// </summary> /// </summary>
public Func<CookieSignedInContext, Task> OnSignedIn { get; set; } = context => TaskCache.CompletedTask; public Func<CookieSignedInContext, Task> OnSignedIn { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// A delegate assigned to this property will be invoked when the related method is called. /// A delegate assigned to this property will be invoked when the related method is called.
/// </summary> /// </summary>
public Func<CookieSigningOutContext, Task> OnSigningOut { get; set; } = context => TaskCache.CompletedTask; public Func<CookieSigningOutContext, Task> OnSigningOut { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// A delegate assigned to this property will be invoked when the related method is called. /// 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); context.Response.Redirect(context.RedirectUri);
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
/// <summary> /// <summary>
@ -66,7 +65,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
{ {
context.Response.Redirect(context.RedirectUri); context.Response.Redirect(context.RedirectUri);
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
/// <summary> /// <summary>
@ -82,7 +81,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
{ {
context.Response.Redirect(context.RedirectUri); context.Response.Redirect(context.RedirectUri);
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
/// <summary> /// <summary>
@ -98,7 +97,7 @@ namespace Microsoft.AspNetCore.Authentication.Cookies
{ {
context.Response.Redirect(context.RedirectUri); context.Response.Redirect(context.RedirectUri);
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
private static bool IsAjaxRequest(HttpRequest request) private static bool IsAjaxRequest(HttpRequest request)

View File

@ -18,7 +18,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication.JwtBearer namespace Microsoft.AspNetCore.Authentication.JwtBearer
{ {
@ -15,22 +14,22 @@ namespace Microsoft.AspNetCore.Authentication.JwtBearer
/// <summary> /// <summary>
/// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed. /// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed.
/// </summary> /// </summary>
public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => TaskCache.CompletedTask; public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when a protocol message is first received. /// Invoked when a protocol message is first received.
/// </summary> /// </summary>
public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => TaskCache.CompletedTask; public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked after the security token has passed validation and a ClaimsIdentity has been generated. /// Invoked after the security token has passed validation and a ClaimsIdentity has been generated.
/// </summary> /// </summary>
public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => TaskCache.CompletedTask; public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked before a challenge is sent back to the caller. /// Invoked before a challenge is sent back to the caller.
/// </summary> /// </summary>
public Func<JwtBearerChallengeContext, Task> OnChallenge { get; set; } = context => TaskCache.CompletedTask; public Func<JwtBearerChallengeContext, Task> OnChallenge { get; set; } = context => Task.CompletedTask;
public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context);

View File

@ -3,7 +3,6 @@
using System; using System;
using Microsoft.AspNetCore.Authentication.JwtBearer; using Microsoft.AspNetCore.Authentication.JwtBearer;
using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Builder namespace Microsoft.AspNetCore.Builder
{ {

View File

@ -11,6 +11,5 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(IdentityModelOpenIdVersion)" /> <PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(IdentityModelOpenIdVersion)" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication.OAuth namespace Microsoft.AspNetCore.Authentication.OAuth
{ {
@ -15,7 +14,7 @@ namespace Microsoft.AspNetCore.Authentication.OAuth
/// <summary> /// <summary>
/// Gets or sets the function that is invoked when the CreatingTicket method is invoked. /// Gets or sets the function that is invoked when the CreatingTicket method is invoked.
/// </summary> /// </summary>
public Func<OAuthCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => TaskCache.CompletedTask; public Func<OAuthCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Gets or sets the delegate that is invoked when the RedirectToAuthorizationEndpoint method is invoked. /// 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<OAuthRedirectToAuthorizationContext, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => public Func<OAuthRedirectToAuthorizationContext, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context =>
{ {
context.Response.Redirect(context.RedirectUri); context.Response.Redirect(context.RedirectUri);
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
/// <summary> /// <summary>

View File

@ -13,7 +13,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Authentication\Microsoft.AspNetCore.Authentication.csproj" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
<PackageReference Include="Newtonsoft.Json" Version="$(JsonNetVersion)" /> <PackageReference Include="Newtonsoft.Json" Version="$(JsonNetVersion)" />
</ItemGroup> </ItemGroup>

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication.OpenIdConnect namespace Microsoft.AspNetCore.Authentication.OpenIdConnect
{ {
@ -15,47 +14,47 @@ namespace Microsoft.AspNetCore.Authentication.OpenIdConnect
/// <summary> /// <summary>
/// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed. /// Invoked if exceptions are thrown during request processing. The exceptions will be re-thrown after this event unless suppressed.
/// </summary> /// </summary>
public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => TaskCache.CompletedTask; public Func<AuthenticationFailedContext, Task> OnAuthenticationFailed { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked after security token validation if an authorization code is present in the protocol message. /// Invoked after security token validation if an authorization code is present in the protocol message.
/// </summary> /// </summary>
public Func<AuthorizationCodeReceivedContext, Task> OnAuthorizationCodeReceived { get; set; } = context => TaskCache.CompletedTask; public Func<AuthorizationCodeReceivedContext, Task> OnAuthorizationCodeReceived { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when a protocol message is first received. /// Invoked when a protocol message is first received.
/// </summary> /// </summary>
public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => TaskCache.CompletedTask; public Func<MessageReceivedContext, Task> OnMessageReceived { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked before redirecting to the identity provider to authenticate. /// Invoked before redirecting to the identity provider to authenticate.
/// </summary> /// </summary>
public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => TaskCache.CompletedTask; public Func<RedirectContext, Task> OnRedirectToIdentityProvider { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked before redirecting to the identity provider to sign out. /// Invoked before redirecting to the identity provider to sign out.
/// </summary> /// </summary>
public Func<RedirectContext, Task> OnRedirectToIdentityProviderForSignOut { get; set; } = context => TaskCache.CompletedTask; public Func<RedirectContext, Task> OnRedirectToIdentityProviderForSignOut { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when a request is received on the RemoteSignOutPath. /// Invoked when a request is received on the RemoteSignOutPath.
/// </summary> /// </summary>
public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => TaskCache.CompletedTask; public Func<RemoteSignOutContext, Task> OnRemoteSignOut { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked after "authorization code" is redeemed for tokens at the token endpoint. /// Invoked after "authorization code" is redeemed for tokens at the token endpoint.
/// </summary> /// </summary>
public Func<TokenResponseReceivedContext, Task> OnTokenResponseReceived { get; set; } = context => TaskCache.CompletedTask; public Func<TokenResponseReceivedContext, Task> OnTokenResponseReceived { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when an IdToken has been validated and produced an AuthenticationTicket. /// Invoked when an IdToken has been validated and produced an AuthenticationTicket.
/// </summary> /// </summary>
public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => TaskCache.CompletedTask; public Func<TokenValidatedContext, Task> OnTokenValidated { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when user information is retrieved from the UserInfoEndpoint. /// Invoked when user information is retrieved from the UserInfoEndpoint.
/// </summary> /// </summary>
public Func<UserInformationReceivedContext, Task> OnUserInformationReceived { get; set; } = context => TaskCache.CompletedTask; public Func<UserInformationReceivedContext, Task> OnUserInformationReceived { get; set; } = context => Task.CompletedTask;
public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context); public virtual Task AuthenticationFailed(AuthenticationFailedContext context) => OnAuthenticationFailed(context);

View File

@ -10,7 +10,6 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Authentication.OAuth\Microsoft.AspNetCore.Authentication.OAuth.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Authentication.OAuth\Microsoft.AspNetCore.Authentication.OAuth.csproj" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(IdentityModelOpenIdVersion)" /> <PackageReference Include="Microsoft.IdentityModel.Protocols.OpenIdConnect" Version="$(IdentityModelOpenIdVersion)" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -3,7 +3,6 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication.Twitter namespace Microsoft.AspNetCore.Authentication.Twitter
{ {
@ -15,7 +14,7 @@ namespace Microsoft.AspNetCore.Authentication.Twitter
/// <summary> /// <summary>
/// Gets or sets the function that is invoked when the Authenticated method is invoked. /// Gets or sets the function that is invoked when the Authenticated method is invoked.
/// </summary> /// </summary>
public Func<TwitterCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => TaskCache.CompletedTask; public Func<TwitterCreatingTicketContext, Task> OnCreatingTicket { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Gets or sets the delegate that is invoked when the ApplyRedirect method is invoked. /// 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<TwitterRedirectToAuthorizationEndpointContext, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context => public Func<TwitterRedirectToAuthorizationEndpointContext, Task> OnRedirectToAuthorizationEndpoint { get; set; } = context =>
{ {
context.Response.Redirect(context.RedirectUri); context.Response.Redirect(context.RedirectUri);
return TaskCache.CompletedTask; return Task.CompletedTask;
}; };
/// <summary> /// <summary>

View File

@ -13,7 +13,6 @@
<ItemGroup> <ItemGroup>
<ProjectReference Include="..\Microsoft.AspNetCore.Authentication.OAuth\Microsoft.AspNetCore.Authentication.OAuth.csproj" /> <ProjectReference Include="..\Microsoft.AspNetCore.Authentication.OAuth\Microsoft.AspNetCore.Authentication.OAuth.csproj" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -7,7 +7,6 @@ using System.Text.Encodings.Web;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Internal;
using Microsoft.Extensions.Logging; using Microsoft.Extensions.Logging;
using Microsoft.Extensions.Options; using Microsoft.Extensions.Options;
@ -119,7 +118,7 @@ namespace Microsoft.AspNetCore.Authentication
/// <returns>A task</returns> /// <returns>A task</returns>
protected virtual Task InitializeHandlerAsync() protected virtual Task InitializeHandlerAsync()
{ {
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
protected string BuildRedirectUri(string targetPath) protected string BuildRedirectUri(string targetPath)
@ -193,7 +192,7 @@ namespace Microsoft.AspNetCore.Authentication
protected virtual Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties properties) protected virtual Task HandleSignInAsync(ClaimsPrincipal user, AuthenticationProperties properties)
{ {
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
public async Task SignOutAsync(AuthenticationProperties properties) public async Task SignOutAsync(AuthenticationProperties properties)
@ -205,7 +204,7 @@ namespace Microsoft.AspNetCore.Authentication
protected virtual Task HandleSignOutAsync(AuthenticationProperties properties) protected virtual Task HandleSignOutAsync(AuthenticationProperties properties)
{ {
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
/// <summary> /// <summary>
@ -216,7 +215,7 @@ namespace Microsoft.AspNetCore.Authentication
protected virtual Task HandleForbiddenAsync(AuthenticationProperties properties) protected virtual Task HandleForbiddenAsync(AuthenticationProperties properties)
{ {
Response.StatusCode = 403; Response.StatusCode = 403;
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
/// <summary> /// <summary>
@ -229,7 +228,7 @@ namespace Microsoft.AspNetCore.Authentication
protected virtual Task HandleChallengeAsync(AuthenticationProperties properties) protected virtual Task HandleChallengeAsync(AuthenticationProperties properties)
{ {
Response.StatusCode = 401; Response.StatusCode = 401;
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
public async Task ChallengeAsync(AuthenticationProperties properties) public async Task ChallengeAsync(AuthenticationProperties properties)

View File

@ -3,15 +3,14 @@
using System; using System;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authentication namespace Microsoft.AspNetCore.Authentication
{ {
public class RemoteAuthenticationEvents public class RemoteAuthenticationEvents
{ {
public Func<FailureContext, Task> OnRemoteFailure { get; set; } = context => TaskCache.CompletedTask; public Func<FailureContext, Task> OnRemoteFailure { get; set; } = context => Task.CompletedTask;
public Func<TicketReceivedContext, Task> OnTicketReceived { get; set; } = context => TaskCache.CompletedTask; public Func<TicketReceivedContext, Task> OnTicketReceived { get; set; } = context => Task.CompletedTask;
/// <summary> /// <summary>
/// Invoked when there is a remote failure /// Invoked when there is a remote failure

View File

@ -19,7 +19,6 @@
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.SecurityHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" /> <PackageReference Include="Microsoft.Extensions.SecurityHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.WebEncoders" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.WebEncoders" Version="$(AspNetCoreVersion)" />
</ItemGroup> </ItemGroup>

View File

@ -17,7 +17,6 @@
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.AspNetCore.Authentication.Abstractions" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.AspNetCore.Authentication.Abstractions" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.SecurityHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" /> <PackageReference Include="Microsoft.Extensions.SecurityHelper.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authorization.Infrastructure namespace Microsoft.AspNetCore.Authorization.Infrastructure
{ {
@ -68,7 +67,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure
context.Succeed(requirement); context.Succeed(requirement);
} }
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
} }
} }

View File

@ -3,7 +3,6 @@
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authorization.Infrastructure namespace Microsoft.AspNetCore.Authorization.Infrastructure
{ {
@ -28,7 +27,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure
{ {
context.Succeed(requirement); context.Succeed(requirement);
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
} }
} }

View File

@ -4,7 +4,6 @@
using System; using System;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authorization.Infrastructure namespace Microsoft.AspNetCore.Authorization.Infrastructure
{ {
@ -47,7 +46,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure
context.Succeed(requirement); context.Succeed(requirement);
} }
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
} }
} }

View File

@ -5,7 +5,6 @@ using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Extensions.Internal;
namespace Microsoft.AspNetCore.Authorization.Infrastructure namespace Microsoft.AspNetCore.Authorization.Infrastructure
{ {
@ -62,7 +61,7 @@ namespace Microsoft.AspNetCore.Authorization.Infrastructure
context.Succeed(requirement); context.Succeed(requirement);
} }
} }
return TaskCache.CompletedTask; return Task.CompletedTask;
} }
} }

View File

@ -17,7 +17,6 @@ Microsoft.AspNetCore.Authorization.AuthorizeAttribute</Description>
<ItemGroup> <ItemGroup>
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" /> <PackageReference Include="Microsoft.Extensions.Options" Version="$(AspNetCoreVersion)" />
<PackageReference Include="Microsoft.Extensions.TaskCache.Sources" Version="$(AspNetCoreVersion)" PrivateAssets="All" />
</ItemGroup> </ItemGroup>
</Project> </Project>