From 700c2afc21fa95060f7b42727cbdfd047ec1aa38 Mon Sep 17 00:00:00 2001 From: Scott Sauber Date: Fri, 15 Sep 2017 22:25:32 -0500 Subject: [PATCH] - Add summary to LockoutOptions AllowedForNewUsers. - Move defaults to summary for better intellisense. - Added defaults to xml docs where missing. --- .../DataProtectionTokenProviderOptions.cs | 4 +-- .../SecurityStampValidatorOptions.cs | 2 +- .../ClaimsIdentityOptions.cs | 20 +++---------- .../LockoutOptions.cs | 14 ++++----- .../PasswordHasherOptions.cs | 9 ++---- .../PasswordOptions.cs | 30 ++++--------------- .../SignInOptions.cs | 4 +-- .../UserOptions.cs | 4 +-- 8 files changed, 26 insertions(+), 61 deletions(-) diff --git a/src/Microsoft.AspNetCore.Identity/DataProtectionTokenProviderOptions.cs b/src/Microsoft.AspNetCore.Identity/DataProtectionTokenProviderOptions.cs index fee42bb2c0..73eee0c115 100644 --- a/src/Microsoft.AspNetCore.Identity/DataProtectionTokenProviderOptions.cs +++ b/src/Microsoft.AspNetCore.Identity/DataProtectionTokenProviderOptions.cs @@ -11,7 +11,7 @@ namespace Microsoft.AspNetCore.Identity public class DataProtectionTokenProviderOptions { /// - /// Gets or sets the name of the . + /// Gets or sets the name of the . Defaults to DataProtectorTokenProvider. /// /// /// The name of the . @@ -19,7 +19,7 @@ namespace Microsoft.AspNetCore.Identity public string Name { get; set; } = "DataProtectorTokenProvider"; /// - /// 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. /// /// /// The amount of time a generated token remains valid. diff --git a/src/Microsoft.AspNetCore.Identity/SecurityStampValidatorOptions.cs b/src/Microsoft.AspNetCore.Identity/SecurityStampValidatorOptions.cs index 08380ad0f0..c419819bb8 100644 --- a/src/Microsoft.AspNetCore.Identity/SecurityStampValidatorOptions.cs +++ b/src/Microsoft.AspNetCore.Identity/SecurityStampValidatorOptions.cs @@ -12,7 +12,7 @@ namespace Microsoft.AspNetCore.Identity public class SecurityStampValidatorOptions { /// - /// Gets or sets the after which security stamps are re-validated. + /// Gets or sets the after which security stamps are re-validated. Defaults to 30 minutes. /// /// /// The after which security stamps are re-validated. diff --git a/src/Microsoft.Extensions.Identity.Core/ClaimsIdentityOptions.cs b/src/Microsoft.Extensions.Identity.Core/ClaimsIdentityOptions.cs index 9081dc9fab..54ba1ae069 100644 --- a/src/Microsoft.Extensions.Identity.Core/ClaimsIdentityOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/ClaimsIdentityOptions.cs @@ -11,35 +11,23 @@ namespace Microsoft.AspNetCore.Identity public class ClaimsIdentityOptions { /// - /// Gets or sets the ClaimType used for a Role claim. + /// Gets or sets the ClaimType used for a Role claim. Defaults to . /// - /// - /// This defaults to . - /// public string RoleClaimType { get; set; } = ClaimTypes.Role; /// - /// Gets or sets the ClaimType used for the user name claim. + /// Gets or sets the ClaimType used for the user name claim. Defaults to . /// - /// - /// This defaults to . - /// public string UserNameClaimType { get; set; } = ClaimTypes.Name; /// - /// Gets or sets the ClaimType used for the user identifier claim. + /// Gets or sets the ClaimType used for the user identifier claim. Defaults to . /// - /// - /// This defaults to . - /// public string UserIdClaimType { get; set; } = ClaimTypes.NameIdentifier; /// - /// 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". /// - /// - /// This defaults to "AspNet.Identity.SecurityStamp". - /// public string SecurityStampClaimType { get; set; } = "AspNet.Identity.SecurityStamp"; } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.Identity.Core/LockoutOptions.cs b/src/Microsoft.Extensions.Identity.Core/LockoutOptions.cs index 687314f361..6c28eb5adc 100644 --- a/src/Microsoft.Extensions.Identity.Core/LockoutOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/LockoutOptions.cs @@ -10,29 +10,27 @@ namespace Microsoft.AspNetCore.Identity /// public class LockoutOptions { + /// + /// Gets or sets a flag indicating whether a new user can be locked out. Defaults to true. + /// /// - /// True if a newly created user can be locked out, otherwise false. + /// True if a newly created user can be locked out, otherwise false. /// - /// - /// Defaults to true. - /// public bool AllowedForNewUsers { get; set; } = true; /// /// 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. /// /// /// The number of failed access attempts allowed before a user is locked out, if lockout is enabled. /// - /// Defaults to 5 failed attempts before an account is locked out. public int MaxFailedAccessAttempts { get; set; } = 5; /// - /// Gets or sets the a user is locked out for when a lockout occurs. + /// Gets or sets the a user is locked out for when a lockout occurs. Defaults to 5 minutes. /// /// The a user is locked out for when a lockout occurs. - /// Defaults to 5 minutes. public TimeSpan DefaultLockoutTimeSpan { get; set; } = TimeSpan.FromMinutes(5); } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.Identity.Core/PasswordHasherOptions.cs b/src/Microsoft.Extensions.Identity.Core/PasswordHasherOptions.cs index e113edcab6..56ceb2ac06 100644 --- a/src/Microsoft.Extensions.Identity.Core/PasswordHasherOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/PasswordHasherOptions.cs @@ -13,25 +13,22 @@ namespace Microsoft.AspNetCore.Identity private static readonly RandomNumberGenerator _defaultRng = RandomNumberGenerator.Create(); // secure PRNG /// - /// 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'. /// /// /// The compatibility mode used when hashing passwords. /// - /// - /// The default compatibility mode is 'ASP.NET Identity version 3'. - /// public PasswordHasherCompatibilityMode CompatibilityMode { get; set; } = PasswordHasherCompatibilityMode.IdentityV3; /// - /// 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. /// /// /// The number of iterations used when hashing passwords using PBKDF2. /// /// /// 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. /// public int IterationCount { get; set; } = 10000; diff --git a/src/Microsoft.Extensions.Identity.Core/PasswordOptions.cs b/src/Microsoft.Extensions.Identity.Core/PasswordOptions.cs index 8a7f51266e..d532ea4fab 100644 --- a/src/Microsoft.Extensions.Identity.Core/PasswordOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/PasswordOptions.cs @@ -9,55 +9,37 @@ namespace Microsoft.AspNetCore.Identity public class PasswordOptions { /// - /// Gets or sets the minimum length a password must be. + /// Gets or sets the minimum length a password must be. Defaults to 6. /// - /// - /// This defaults to 6. - /// public int RequiredLength { get; set; } = 6; /// - /// 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. /// - /// - /// This defaults to 1. - /// public int RequiredUniqueChars { get; set; } = 1; /// - /// 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. /// /// True if passwords must contain a non-alphanumeric character, otherwise false. - /// - /// This defaults to true. - /// public bool RequireNonAlphanumeric { get; set; } = true; /// - /// 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. /// /// True if passwords must contain a lower case ASCII character. - /// - /// This defaults to true. - /// public bool RequireLowercase { get; set; } = true; /// - /// 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. /// /// True if passwords must contain a upper case ASCII character. - /// - /// This defaults to true. - /// public bool RequireUppercase { get; set; } = true; /// - /// 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. /// /// True if passwords must contain a digit. - /// - /// This defaults to true. - /// public bool RequireDigit { get; set; } = true; } } \ No newline at end of file diff --git a/src/Microsoft.Extensions.Identity.Core/SignInOptions.cs b/src/Microsoft.Extensions.Identity.Core/SignInOptions.cs index ac8ddc0571..3ae19eb8a3 100644 --- a/src/Microsoft.Extensions.Identity.Core/SignInOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/SignInOptions.cs @@ -9,13 +9,13 @@ namespace Microsoft.AspNetCore.Identity public class SignInOptions { /// - /// 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. /// /// True if a user must have a confirmed email address before they can sign in, otherwise false. public bool RequireConfirmedEmail { get; set; } /// - /// 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. /// /// True if a user must have a confirmed telephone number before they can sign in, otherwise false. public bool RequireConfirmedPhoneNumber { get; set; } diff --git a/src/Microsoft.Extensions.Identity.Core/UserOptions.cs b/src/Microsoft.Extensions.Identity.Core/UserOptions.cs index e009cb9474..d0fc15862e 100644 --- a/src/Microsoft.Extensions.Identity.Core/UserOptions.cs +++ b/src/Microsoft.Extensions.Identity.Core/UserOptions.cs @@ -9,7 +9,7 @@ namespace Microsoft.AspNetCore.Identity public class UserOptions { /// - /// 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-._@+ /// /// /// 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-._@+"; /// - /// 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. /// /// /// True if the application requires each user to have their own, unique email, otherwise false.