- Add summary to LockoutOptions AllowedForNewUsers.

- Move defaults to summary for better intellisense.
- Added defaults to xml docs where missing.
This commit is contained in:
Scott Sauber 2017-09-15 22:25:32 -05:00 committed by Hao Kung
parent b442d1af2f
commit 700c2afc21
8 changed files with 26 additions and 61 deletions

View File

@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Identity
public class DataProtectionTokenProviderOptions public class DataProtectionTokenProviderOptions
{ {
/// <summary> /// <summary>
/// Gets or sets the name of the <see cref="DataProtectorTokenProvider{TUser}"/>. /// Gets or sets the name of the <see cref="DataProtectorTokenProvider{TUser}"/>. Defaults to DataProtectorTokenProvider.
/// </summary> /// </summary>
/// <value> /// <value>
/// The name of the <see cref="DataProtectorTokenProvider{TUser}"/>. /// The name of the <see cref="DataProtectorTokenProvider{TUser}"/>.
@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Identity
public string Name { get; set; } = "DataProtectorTokenProvider"; public string Name { get; set; } = "DataProtectorTokenProvider";
/// <summary> /// <summary>
/// Gets or sets the amount of time a generated token remains valid. /// Gets or sets the amount of time a generated token remains valid. Defaults to 1 day.
/// </summary> /// </summary>
/// <value> /// <value>
/// The amount of time a generated token remains valid. /// The amount of time a generated token remains valid.

View File

@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Identity
public class SecurityStampValidatorOptions public class SecurityStampValidatorOptions
{ {
/// <summary> /// <summary>
/// Gets or sets the <see cref="TimeSpan"/> after which security stamps are re-validated. /// Gets or sets the <see cref="TimeSpan"/> after which security stamps are re-validated. Defaults to 30 minutes.
/// </summary> /// </summary>
/// <value> /// <value>
/// The <see cref="TimeSpan"/> after which security stamps are re-validated. /// The <see cref="TimeSpan"/> after which security stamps are re-validated.

View File

@ -11,35 +11,23 @@ namespace Microsoft.AspNetCore.Identity
public class ClaimsIdentityOptions public class ClaimsIdentityOptions
{ {
/// <summary> /// <summary>
/// Gets or sets the ClaimType used for a Role claim. /// Gets or sets the ClaimType used for a Role claim. Defaults to <see cref="ClaimTypes.Role"/>.
/// </summary> /// </summary>
/// <remarks>
/// This defaults to <see cref="ClaimTypes.Role"/>.
/// </remarks>
public string RoleClaimType { get; set; } = ClaimTypes.Role; public string RoleClaimType { get; set; } = ClaimTypes.Role;
/// <summary> /// <summary>
/// Gets or sets the ClaimType used for the user name claim. /// Gets or sets the ClaimType used for the user name claim. Defaults to <see cref="ClaimTypes.Name"/>.
/// </summary> /// </summary>
/// <remarks>
/// This defaults to <see cref="ClaimTypes.Name"/>.
/// </remarks>
public string UserNameClaimType { get; set; } = ClaimTypes.Name; public string UserNameClaimType { get; set; } = ClaimTypes.Name;
/// <summary> /// <summary>
/// Gets or sets the ClaimType used for the user identifier claim. /// Gets or sets the ClaimType used for the user identifier claim. Defaults to <see cref="ClaimTypes.NameIdentifier"/>.
/// </summary> /// </summary>
/// <remarks>
/// This defaults to <see cref="ClaimTypes.NameIdentifier"/>.
/// </remarks>
public string UserIdClaimType { get; set; } = ClaimTypes.NameIdentifier; public string UserIdClaimType { get; set; } = ClaimTypes.NameIdentifier;
/// <summary> /// <summary>
/// Gets or sets the ClaimType used for the security stamp claim. /// Gets or sets the ClaimType used for the security stamp claim. Defaults to "AspNet.Identity.SecurityStamp".
/// </summary> /// </summary>
/// <remarks>
/// This defaults to "AspNet.Identity.SecurityStamp".
/// </remarks>
public string SecurityStampClaimType { get; set; } = "AspNet.Identity.SecurityStamp"; public string SecurityStampClaimType { get; set; } = "AspNet.Identity.SecurityStamp";
} }
} }

View File

@ -10,29 +10,27 @@ namespace Microsoft.AspNetCore.Identity
/// </summary> /// </summary>
public class LockoutOptions public class LockoutOptions
{ {
/// <summary>
/// Gets or sets a flag indicating whether a new user can be locked out. Defaults to true.
/// </summary>
/// <value> /// <value>
/// True if a newly created user can be locked out, otherwise false. /// True if a newly created user can be locked out, otherwise false.
/// </value> /// </value>
/// <remarks>
/// Defaults to true.
/// </remarks>
public bool AllowedForNewUsers { get; set; } = true; public bool AllowedForNewUsers { get; set; } = true;
/// <summary> /// <summary>
/// Gets or sets the number of failed access attempts allowed before a user is locked out, /// Gets or sets the number of failed access attempts allowed before a user is locked out,
/// assuming lock out is enabled. /// assuming lock out is enabled. Defaults to 5.
/// </summary> /// </summary>
/// <value> /// <value>
/// The number of failed access attempts allowed before a user is locked out, if lockout is enabled. /// The number of failed access attempts allowed before a user is locked out, if lockout is enabled.
/// </value> /// </value>
/// <remarks>Defaults to 5 failed attempts before an account is locked out.</remarks>
public int MaxFailedAccessAttempts { get; set; } = 5; public int MaxFailedAccessAttempts { get; set; } = 5;
/// <summary> /// <summary>
/// Gets or sets the <see cref="TimeSpan"/> a user is locked out for when a lockout occurs. /// Gets or sets the <see cref="TimeSpan"/> a user is locked out for when a lockout occurs. Defaults to 5 minutes.
/// </summary> /// </summary>
/// <value>The <see cref="TimeSpan"/> a user is locked out for when a lockout occurs.</value> /// <value>The <see cref="TimeSpan"/> a user is locked out for when a lockout occurs.</value>
/// <remarks>Defaults to 5 minutes.</remarks>
public TimeSpan DefaultLockoutTimeSpan { get; set; } = TimeSpan.FromMinutes(5); public TimeSpan DefaultLockoutTimeSpan { get; set; } = TimeSpan.FromMinutes(5);
} }
} }

View File

@ -13,25 +13,22 @@ namespace Microsoft.AspNetCore.Identity
private static readonly RandomNumberGenerator _defaultRng = RandomNumberGenerator.Create(); // secure PRNG private static readonly RandomNumberGenerator _defaultRng = RandomNumberGenerator.Create(); // secure PRNG
/// <summary> /// <summary>
/// Gets or sets the compatibility mode used when hashing passwords. /// Gets or sets the compatibility mode used when hashing passwords. Defaults to 'ASP.NET Identity version 3'.
/// </summary> /// </summary>
/// <value> /// <value>
/// The compatibility mode used when hashing passwords. /// The compatibility mode used when hashing passwords.
/// </value> /// </value>
/// <remarks>
/// The default compatibility mode is 'ASP.NET Identity version 3'.
/// </remarks>
public PasswordHasherCompatibilityMode CompatibilityMode { get; set; } = PasswordHasherCompatibilityMode.IdentityV3; public PasswordHasherCompatibilityMode CompatibilityMode { get; set; } = PasswordHasherCompatibilityMode.IdentityV3;
/// <summary> /// <summary>
/// Gets or sets the number of iterations used when hashing passwords using PBKDF2. /// Gets or sets the number of iterations used when hashing passwords using PBKDF2. Default is 10,000.
/// </summary> /// </summary>
/// <value> /// <value>
/// The number of iterations used when hashing passwords using PBKDF2. /// The number of iterations used when hashing passwords using PBKDF2.
/// </value> /// </value>
/// <remarks> /// <remarks>
/// This value is only used when the compatibility mode is set to 'V3'. /// This value is only used when the compatibility mode is set to 'V3'.
/// The value must be a positive integer. The default value is 10,000. /// The value must be a positive integer.
/// </remarks> /// </remarks>
public int IterationCount { get; set; } = 10000; public int IterationCount { get; set; } = 10000;

View File

@ -9,55 +9,37 @@ namespace Microsoft.AspNetCore.Identity
public class PasswordOptions public class PasswordOptions
{ {
/// <summary> /// <summary>
/// Gets or sets the minimum length a password must be. /// Gets or sets the minimum length a password must be. Defaults to 6.
/// </summary> /// </summary>
/// <remarks>
/// This defaults to 6.
/// </remarks>
public int RequiredLength { get; set; } = 6; public int RequiredLength { get; set; } = 6;
/// <summary> /// <summary>
/// Gets or sets the minimum number of unique chars a password must comprised of. /// Gets or sets the minimum number of unique chars a password must comprised of. Defaults to 1.
/// </summary> /// </summary>
/// <remarks>
/// This defaults to 1.
/// </remarks>
public int RequiredUniqueChars { get; set; } = 1; public int RequiredUniqueChars { get; set; } = 1;
/// <summary> /// <summary>
/// Gets or sets a flag indicating if passwords must contain a non-alphanumeric character. /// Gets or sets a flag indicating if passwords must contain a non-alphanumeric character. Defaults to true.
/// </summary> /// </summary>
/// <value>True if passwords must contain a non-alphanumeric character, otherwise false.</value> /// <value>True if passwords must contain a non-alphanumeric character, otherwise false.</value>
/// <remarks>
/// This defaults to true.
/// </remarks>
public bool RequireNonAlphanumeric { get; set; } = true; public bool RequireNonAlphanumeric { get; set; } = true;
/// <summary> /// <summary>
/// Gets or sets a flag indicating if passwords must contain a lower case ASCII character. /// Gets or sets a flag indicating if passwords must contain a lower case ASCII character. Defaults to true.
/// </summary> /// </summary>
/// <value>True if passwords must contain a lower case ASCII character.</value> /// <value>True if passwords must contain a lower case ASCII character.</value>
/// <remarks>
/// This defaults to true.
/// </remarks>
public bool RequireLowercase { get; set; } = true; public bool RequireLowercase { get; set; } = true;
/// <summary> /// <summary>
/// Gets or sets a flag indicating if passwords must contain a upper case ASCII character. /// Gets or sets a flag indicating if passwords must contain a upper case ASCII character. Defaults to true.
/// </summary> /// </summary>
/// <value>True if passwords must contain a upper case ASCII character.</value> /// <value>True if passwords must contain a upper case ASCII character.</value>
/// <remarks>
/// This defaults to true.
/// </remarks>
public bool RequireUppercase { get; set; } = true; public bool RequireUppercase { get; set; } = true;
/// <summary> /// <summary>
/// Gets or sets a flag indicating if passwords must contain a digit. /// Gets or sets a flag indicating if passwords must contain a digit. Defaults to true.
/// </summary> /// </summary>
/// <value>True if passwords must contain a digit.</value> /// <value>True if passwords must contain a digit.</value>
/// <remarks>
/// This defaults to true.
/// </remarks>
public bool RequireDigit { get; set; } = true; public bool RequireDigit { get; set; } = true;
} }
} }

View File

@ -9,13 +9,13 @@ namespace Microsoft.AspNetCore.Identity
public class SignInOptions public class SignInOptions
{ {
/// <summary> /// <summary>
/// Gets or sets a flag indicating whether a confirmed email address is required to sign in. /// Gets or sets a flag indicating whether a confirmed email address is required to sign in. Defaults to false.
/// </summary> /// </summary>
/// <value>True if a user must have a confirmed email address before they can sign in, otherwise false.</value> /// <value>True if a user must have a confirmed email address before they can sign in, otherwise false.</value>
public bool RequireConfirmedEmail { get; set; } public bool RequireConfirmedEmail { get; set; }
/// <summary> /// <summary>
/// Gets or sets a flag indicating whether a confirmed telephone number is required to sign in. /// Gets or sets a flag indicating whether a confirmed telephone number is required to sign in. Defaults to false.
/// </summary> /// </summary>
/// <value>True if a user must have a confirmed telephone number before they can sign in, otherwise false.</value> /// <value>True if a user must have a confirmed telephone number before they can sign in, otherwise false.</value>
public bool RequireConfirmedPhoneNumber { get; set; } public bool RequireConfirmedPhoneNumber { get; set; }

View File

@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Identity
public class UserOptions public class UserOptions
{ {
/// <summary> /// <summary>
/// Gets or sets the list of allowed characters in the username used to validate user names. /// Gets or sets the list of allowed characters in the username used to validate user names. Defaults to abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+
/// </summary> /// </summary>
/// <value> /// <value>
/// The list of allowed characters in the username used to validate user names. /// The list of allowed characters in the username used to validate user names.
@ -17,7 +17,7 @@ namespace Microsoft.AspNetCore.Identity
public string AllowedUserNameCharacters { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+"; public string AllowedUserNameCharacters { get; set; } = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._@+";
/// <summary> /// <summary>
/// Gets or sets a flag indicating whether the application requires unique emails for its users. /// Gets or sets a flag indicating whether the application requires unique emails for its users. Defaults to false.
/// </summary> /// </summary>
/// <value> /// <value>
/// True if the application requires each user to have their own, unique email, otherwise false. /// True if the application requires each user to have their own, unique email, otherwise false.