// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System; using System.Collections.Generic; using System.IO; using System.Security.Claims; using System.Threading.Tasks; using Microsoft.AspNet.Http.Security; namespace Microsoft.AspNet.Http { public abstract class HttpResponse { // TODO - review IOwinResponse for completeness public abstract HttpContext HttpContext { get; } public abstract int StatusCode { get; set; } public abstract IHeaderDictionary Headers { get; } public abstract Stream Body { get; set; } public abstract long? ContentLength { get; set; } public abstract string ContentType { get; set; } public abstract IResponseCookies Cookies { get; } public abstract void OnSendingHeaders(Action callback, object state); public virtual void Redirect(string location) { Redirect(location, permanent: false); } public abstract void Redirect(string location, bool permanent); public abstract Task WriteAsync(string data); public virtual void Challenge() { Challenge(new string[0]); } public virtual void Challenge(AuthenticationProperties properties) { Challenge(new string[0], properties); } public virtual void Challenge(string authenticationType) { Challenge(new[] { authenticationType }); } public virtual void Challenge(string authenticationType, AuthenticationProperties properties) { Challenge(new[] { authenticationType }, properties); } public virtual void Challenge(IList authenticationTypes) { Challenge(authenticationTypes, properties: null); } public abstract void Challenge(IList authenticationTypes, AuthenticationProperties properties); public virtual void SignIn(ClaimsIdentity identity) { SignIn(identity, properties: null); } public virtual void SignIn(ClaimsIdentity identity, AuthenticationProperties properties) { SignIn(new[] { identity }, properties); } public virtual void SignIn(IList identities) { SignIn(identities, properties: null); } public abstract void SignIn(IList identities, AuthenticationProperties properties); public virtual void SignOut() { SignOut(new string[0]); } public virtual void SignOut(string authenticationType) { SignOut(new[] { authenticationType }); } public abstract void SignOut(IList authenticationTypes); } }