Obsolete AuthenticationManager (#866)

This commit is contained in:
Hao Kung 2017-06-12 11:41:27 -07:00 committed by GitHub
parent a78b194a84
commit b059bcc426
3 changed files with 10 additions and 0 deletions

View File

@ -9,6 +9,7 @@ using Microsoft.AspNetCore.Http.Features.Authentication;
namespace Microsoft.AspNetCore.Http.Authentication
{
[Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")]
public abstract class AuthenticationManager
{
/// <summary>

View File

@ -11,6 +11,7 @@ using Microsoft.AspNetCore.Http.Features.Authentication;
namespace Microsoft.AspNetCore.Http.Authentication.Internal
{
[Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")]
public class DefaultAuthenticationManager : AuthenticationManager
{
// Lambda hoisted to static readonly field to improve inlining https://github.com/dotnet/roslyn/issues/13624

View File

@ -28,7 +28,11 @@ namespace Microsoft.AspNetCore.Http
private HttpRequest _request;
private HttpResponse _response;
#pragma warning disable CS0618 // Type or member is obsolete
private AuthenticationManager _authenticationManager;
#pragma warning restore CS0618 // Type or member is obsolete
private ConnectionInfo _connection;
private WebSocketManager _websockets;
@ -66,7 +70,9 @@ namespace Microsoft.AspNetCore.Http
}
if (_authenticationManager != null)
{
#pragma warning disable CS0618 // Type or member is obsolete
UninitializeAuthenticationManager(_authenticationManager);
#pragma warning restore CS0618 // Type or member is obsolete
_authenticationManager = null;
}
if (_connection != null)
@ -196,7 +202,9 @@ namespace Microsoft.AspNetCore.Http
protected virtual ConnectionInfo InitializeConnectionInfo() => new DefaultConnectionInfo(Features);
protected virtual void UninitializeConnectionInfo(ConnectionInfo instance) { }
[Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")]
protected virtual AuthenticationManager InitializeAuthenticationManager() => new DefaultAuthenticationManager(this);
[Obsolete("This is obsolete and will be removed in a future version. See https://go.microsoft.com/fwlink/?linkid=845470.")]
protected virtual void UninitializeAuthenticationManager(AuthenticationManager instance) { }
protected virtual WebSocketManager InitializeWebSocketManager() => new DefaultWebSocketManager(Features);