Update doc comments

This commit is contained in:
Hao Kung 2016-03-02 13:46:47 -08:00
parent e9760b48d0
commit b5300ad0e4
8 changed files with 54 additions and 3 deletions

View File

@ -13,7 +13,7 @@ using Microsoft.Extensions.Options;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Contains the options used by the CookiesAuthenticationMiddleware
/// Configuration options for <see cref="CookieAuthenticationMiddleware"/>.
/// </summary>
public class CookieAuthenticationOptions : AuthenticationOptions, IOptions<CookieAuthenticationOptions>
{

View File

@ -17,7 +17,7 @@ using Microsoft.IdentityModel.Tokens;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Configuration options for <see cref="OpenIdConnectOptions"/>
/// Configuration options for <see cref="OpenIdConnectMiddleware"/>
/// </summary>
public class OpenIdConnectOptions : RemoteAuthenticationOptions
{

View File

@ -6,7 +6,7 @@ using Microsoft.AspNetCore.Http.Authentication;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Base Options for all authentication middleware
/// Base Options for all authentication middleware.
/// </summary>
public abstract class AuthenticationOptions
{

View File

@ -5,8 +5,14 @@ using Microsoft.AspNetCore.Authentication;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Contains the options used by the <see cref="ClaimsTransformationMiddleware"/>.
/// </summary>
public class ClaimsTransformationOptions
{
/// <summary>
/// Responsible for transforming the claims principal.
/// </summary>
public IClaimsTransformer Transformer { get; set; }
}
}

View File

@ -6,8 +6,16 @@ using System.Threading.Tasks;
namespace Microsoft.AspNetCore.Authentication
{
/// <summary>
/// Used for claims transformation.
/// </summary>
public interface IClaimsTransformer
{
/// <summary>
/// Provides a central transformation point to change the specified principal.
/// </summary>
/// <param name="principal">The principal to transform.</param>
/// <returns>The transformed principal.</returns>
Task<ClaimsPrincipal> TransformAsync(ClaimsPrincipal principal);
}
}

View File

@ -8,6 +8,9 @@ using Microsoft.AspNetCore.Authentication;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Contains the options used by the <see cref="RemoteAuthenticationHandler"/>.
/// </summary>
public class RemoteAuthenticationOptions : AuthenticationOptions
{
/// <summary>

View File

@ -6,6 +6,9 @@ using System.Collections.Generic;
namespace Microsoft.AspNetCore.Authorization
{
/// <summary>
/// Provides programmatic configuration used by <see cref="IAuthorizationService"/> and <see cref="IAuthorizationPolicyProvider"/>.
/// </summary>
public class AuthorizationOptions
{
private IDictionary<string, AuthorizationPolicy> PolicyMap { get; } = new Dictionary<string, AuthorizationPolicy>(StringComparer.OrdinalIgnoreCase);
@ -15,6 +18,11 @@ namespace Microsoft.AspNetCore.Authorization
/// </summary>
public AuthorizationPolicy DefaultPolicy { get; set; } = new AuthorizationPolicyBuilder().RequireAuthenticatedUser().Build();
/// <summary>
/// Add an authorization policy with the provided name.
/// </summary>
/// <param name="name">The name of the policy.</param>
/// <param name="policy">The authorization policy.</param>
public void AddPolicy(string name, AuthorizationPolicy policy)
{
if (name == null)
@ -30,6 +38,11 @@ namespace Microsoft.AspNetCore.Authorization
PolicyMap[name] = policy;
}
/// <summary>
/// Add a policy that is built from a delegate with the provided name.
/// </summary>
/// <param name="name">The name of the policy.</param>
/// <param name="configurePolicy">The delegate that will be used to build the policy.</param>
public void AddPolicy(string name, Action<AuthorizationPolicyBuilder> configurePolicy)
{
if (name == null)
@ -47,6 +60,11 @@ namespace Microsoft.AspNetCore.Authorization
PolicyMap[name] = policyBuilder.Build();
}
/// <summary>
/// Returns the policy for the specified name, or null if a policy with the name does not exist.
/// </summary>
/// <param name="name">The name of the policy to return.</param>
/// <returns>The policy for the specified name, or null if a policy with the name does not exist.</returns>
public AuthorizationPolicy GetPolicy(string name)
{
if (name == null)

View File

@ -6,12 +6,28 @@ using Microsoft.AspNetCore.CookiePolicy;
namespace Microsoft.AspNetCore.Builder
{
/// <summary>
/// Provides programmatic configuration for the <see cref="CookiePolicyMiddleware"/>.
/// </summary>
public class CookiePolicyOptions
{
/// <summary>
/// Affects whether cookies must be HttpOnly.
/// </summary>
public HttpOnlyPolicy HttpOnly { get; set; } = HttpOnlyPolicy.None;
/// <summary>
/// Affects whether cookies must be Secure.
/// </summary>
public SecurePolicy Secure { get; set; } = SecurePolicy.None;
/// <summary>
/// Called when a cookie is appended.
/// </summary>
public Action<AppendCookieContext> OnAppendCookie { get; set; }
/// <summary>
/// Called when a cookie is deleted.
/// </summary>
public Action<DeleteCookieContext> OnDeleteCookie { get; set; }
}
}