Making docs more inclusive (#14607)

This commit is contained in:
Carole Rennie Logan 2019-10-08 06:25:36 +01:00 committed by Justin Kotalik
parent 387bd1a404
commit b3599b6cfa
12 changed files with 34 additions and 34 deletions

View File

@ -8,7 +8,7 @@ namespace Microsoft.AspNetCore.Antiforgery
/// <summary> /// <summary>
/// Allows providing or validating additional custom data for antiforgery tokens. /// Allows providing or validating additional custom data for antiforgery tokens.
/// For example, the developer could use this to supply a nonce when the token is /// For example, the developer could use this to supply a nonce when the token is
/// generated, then he could validate the nonce when the token is validated. /// generated, then validate it when the token is validated.
/// </summary> /// </summary>
/// <remarks> /// <remarks>
/// The antiforgery system already embeds the client's username within the /// The antiforgery system already embeds the client's username within the

View File

@ -31,10 +31,10 @@ namespace Microsoft.AspNetCore.DataProtection.AuthenticatedEncryption
/// This method allows for a slight performance improvement over IAuthenticatedEncryptor.Encrypt /// This method allows for a slight performance improvement over IAuthenticatedEncryptor.Encrypt
/// in the case where the caller needs to prepend or append some data to the resulting ciphertext. /// in the case where the caller needs to prepend or append some data to the resulting ciphertext.
/// For instance, if the caller needs to append a 32-bit header to the resulting ciphertext, then /// For instance, if the caller needs to append a 32-bit header to the resulting ciphertext, then
/// he can specify 4 for 'preBufferSize' and overwrite the first 32 bits of the buffer returned /// specify 4 for 'preBufferSize' and overwrite the first 32 bits of the buffer returned
/// by this function. This saves the caller from having to allocate a new buffer to hold the final /// by this function. This saves the caller from having to allocate a new buffer to hold the final
/// transformed result. /// transformed result.
/// ///
/// All cryptography-related exceptions should be homogenized to CryptographicException. /// All cryptography-related exceptions should be homogenized to CryptographicException.
/// </remarks> /// </remarks>
byte[] Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> additionalAuthenticatedData, uint preBufferSize, uint postBufferSize); byte[] Encrypt(ArraySegment<byte> plaintext, ArraySegment<byte> additionalAuthenticatedData, uint preBufferSize, uint postBufferSize);

View File

@ -15,14 +15,14 @@ namespace Microsoft.AspNetCore.DataProtection
/// <remarks> /// <remarks>
/// <para> /// <para>
/// If the developer changes the at-rest key protection mechanism, it is intended that /// If the developer changes the at-rest key protection mechanism, it is intended that
/// he also change the key storage location, and vice versa. For instance, a call to /// they also change the key storage location, and vice versa. For instance, a call to
/// <see cref="DataProtectionBuilderExtensions.ProtectKeysWithCertificate(IDataProtectionBuilder,string)" /> should generally be accompanied by /// <see cref="DataProtectionBuilderExtensions.ProtectKeysWithCertificate(IDataProtectionBuilder,string)" /> should generally be accompanied by
/// a call to <see cref="DataProtectionBuilderExtensions.PersistKeysToFileSystem(IDataProtectionBuilder,DirectoryInfo)"/>, or exceptions may /// a call to <see cref="DataProtectionBuilderExtensions.PersistKeysToFileSystem(IDataProtectionBuilder,DirectoryInfo)"/>, or exceptions may
/// occur at runtime due to the data protection system not knowing where to persist keys. /// occur at runtime due to the data protection system not knowing where to persist keys.
/// </para> /// </para>
/// <para> /// <para>
/// Similarly, when a developer modifies the default protected payload cryptographic /// Similarly, when a developer modifies the default protected payload cryptographic
/// algorithms, it is intended that he also select an explitiy key storage location. /// algorithms, they should also set an explicit key storage location.
/// A call to <see cref="DataProtectionBuilderExtensions.UseCryptographicAlgorithms(IDataProtectionBuilder,AuthenticatedEncryptorConfiguration)"/> /// A call to <see cref="DataProtectionBuilderExtensions.UseCryptographicAlgorithms(IDataProtectionBuilder,AuthenticatedEncryptorConfiguration)"/>
/// should therefore generally be paired with a call to <see cref="DataProtectionBuilderExtensions.PersistKeysToFileSystem(IDataProtectionBuilder,DirectoryInfo)"/>, /// should therefore generally be paired with a call to <see cref="DataProtectionBuilderExtensions.PersistKeysToFileSystem(IDataProtectionBuilder,DirectoryInfo)"/>,
/// for example. /// for example.
@ -40,4 +40,4 @@ namespace Microsoft.AspNetCore.DataProtection
/// </summary> /// </summary>
IServiceCollection Services { get; } IServiceCollection Services { get; }
} }
} }

View File

@ -253,7 +253,7 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
} }
} }
// Do we need to notify the caller that he should reprotect the data? // Do we need to notify the caller that they should reprotect the data?
status = UnprotectStatus.Ok; status = UnprotectStatus.Ok;
if (keyIdFromPayload != currentKeyRing.DefaultKeyId) if (keyIdFromPayload != currentKeyRing.DefaultKeyId)
{ {

View File

@ -226,9 +226,9 @@ namespace Microsoft.AspNetCore.DataProtection.KeyManagement
Volatile.Write(ref _cacheableKeyRing, existingCacheableKeyRing.WithTemporaryExtendedLifetime(utcNow)); Volatile.Write(ref _cacheableKeyRing, existingCacheableKeyRing.WithTemporaryExtendedLifetime(utcNow));
} }
// The immediate caller should fail so that he can report the error up his chain. This makes it more likely // The immediate caller should fail so that they can report the error up the chain. This makes it more likely
// that an administrator can see the error and react to it as appropriate. The caller can retry the operation // that an administrator can see the error and react to it as appropriate. The caller can retry the operation
// and will probably have success as long as he falls within the temporary extension mentioned above. // and will probably have success as long as they fall within the temporary extension mentioned above.
throw; throw;
} }

View File

@ -7,18 +7,18 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
{ {
/// <summary> /// <summary>
/// Defines the operations that can be performed on a JSON patch document. /// Defines the operations that can be performed on a JSON patch document.
/// </summary> /// </summary>
public interface IObjectAdapter public interface IObjectAdapter
{ {
/// <summary> /// <summary>
/// Using the "add" operation a new value is inserted into the root of the target /// Using the "add" operation a new value is inserted into the root of the target
/// document, into the target array at the specified valid index, or to a target object at /// document, into the target array at the specified valid index, or to a target object at
/// the specified location. /// the specified location.
/// ///
/// When adding to arrays, the specified index MUST NOT be greater than the number of elements in the array. /// When adding to arrays, the specified index MUST NOT be greater than the number of elements in the array.
/// To append the value to the array, the index of "-" character is used (see [RFC6901]). /// To append the value to the array, the index of "-" character is used (see [RFC6901]).
/// ///
/// When adding to an object, if an object member does not already exist, a new member is added to the object at the /// When adding to an object, if an object member does not already exist, a new member is added to the object at the
/// specified location or if an object member does exist, that member's value is replaced. /// specified location or if an object member does exist, that member's value is replaced.
/// ///
/// The operation object MUST contain a "value" member whose content /// The operation object MUST contain a "value" member whose content
@ -46,7 +46,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
/// For example: /// For example:
/// ///
/// { "op": "copy", "from": "/a/b/c", "path": "/a/b/e" } /// { "op": "copy", "from": "/a/b/c", "path": "/a/b/e" }
/// ///
/// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-7 /// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-7
/// </summary> /// </summary>
/// <param name="operation">The copy operation.</param> /// <param name="operation">The copy operation.</param>
@ -67,7 +67,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
/// { "op": "move", "from": "/a/b/c", "path": "/a/b/d" } /// { "op": "move", "from": "/a/b/c", "path": "/a/b/d" }
/// ///
/// A location cannot be moved into one of its children. /// A location cannot be moved into one of its children.
/// ///
/// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6 /// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6
/// </summary> /// </summary>
/// <param name="operation">The move operation.</param> /// <param name="operation">The move operation.</param>
@ -85,7 +85,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
/// ///
/// If removing an element from an array, any elements above the /// If removing an element from an array, any elements above the
/// specified index are shifted one position to the left. /// specified index are shifted one position to the left.
/// ///
/// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6 /// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6
/// </summary> /// </summary>
/// <param name="operation">The remove operation.</param> /// <param name="operation">The remove operation.</param>
@ -93,7 +93,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
void Remove(Operation operation, object objectToApplyTo); void Remove(Operation operation, object objectToApplyTo);
/// <summary> /// <summary>
/// Using the "replace" operation he value at the target location is replaced /// Using the "replace" operation the value at the target location is replaced
/// with a new value. The operation object MUST contain a "value" member /// with a new value. The operation object MUST contain a "value" member
/// which specifies the replacement value. /// which specifies the replacement value.
/// ///
@ -102,7 +102,7 @@ namespace Microsoft.AspNetCore.JsonPatch.Adapters
/// For example: /// For example:
/// ///
/// { "op": "replace", "path": "/a/b/c", "value": 42 } /// { "op": "replace", "path": "/a/b/c", "value": 42 }
/// ///
/// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6 /// See RFC 6902 https://tools.ietf.org/html/rfc6902#page-6
/// </summary> /// </summary>
/// <param name="operation">The replace operation.</param> /// <param name="operation">The replace operation.</param>

View File

@ -53,7 +53,7 @@ namespace Microsoft.Net.Http.Headers
(length != tag.Length)) (length != tag.Length))
{ {
// Note that we don't allow 'W/' prefixes for weak ETags in the 'tag' parameter. If the user wants to // Note that we don't allow 'W/' prefixes for weak ETags in the 'tag' parameter. If the user wants to
// add a weak ETag, he can set 'isWeak' to true. // add a weak ETag, they can set 'isWeak' to true.
throw new FormatException("Invalid ETag name"); throw new FormatException("Invalid ETag name");
} }

View File

@ -26,7 +26,7 @@ namespace Microsoft.Net.Http.Headers
{ {
// Note that even if we check the value here, we can't prevent a user from adding an invalid quality // Note that even if we check the value here, we can't prevent a user from adding an invalid quality
// value using Parameters.Add(). Even if we would prevent the user from adding an invalid value // value using Parameters.Add(). Even if we would prevent the user from adding an invalid value
// using Parameters.Add() he could always add invalid values using HttpHeaders.AddWithoutValidation(). // using Parameters.Add() they could always add invalid values using HttpHeaders.AddWithoutValidation().
// So this check is really for convenience to show users that they're trying to add an invalid // So this check is really for convenience to show users that they're trying to add an invalid
// value. // value.
if ((value < 0) || (value > 1)) if ((value < 0) || (value > 1))

View File

@ -73,7 +73,7 @@ namespace Microsoft.AspNetCore.Routing.Constraints
// the HTTP GET-specific route will be used for URI generation, which might have undesired behavior. // the HTTP GET-specific route will be used for URI generation, which might have undesired behavior.
// //
// To prevent this, a user might call GetVirtualPath(..., { httpMethod = "POST" }) to // To prevent this, a user might call GetVirtualPath(..., { httpMethod = "POST" }) to
// signal that he is generating a URI that will be used for an HTTP POST, so he wants the URI // signal that they are generating a URI that will be used for an HTTP POST, so they want the URI
// generation to be performed by the (b) route instead of the (a) route, consistent with what would // generation to be performed by the (b) route instead of the (a) route, consistent with what would
// happen on incoming requests. // happen on incoming requests.
if (!values.TryGetValue(routeKey, out var obj)) if (!values.TryGetValue(routeKey, out var obj))

View File

@ -113,7 +113,7 @@ namespace Microsoft.AspNetCore.Identity
RegisterTokenProvider(providerName, provider); RegisterTokenProvider(providerName, provider);
} }
} }
} }
if (Options.Stores.ProtectPersonalData) if (Options.Stores.ProtectPersonalData)
{ {
@ -161,7 +161,7 @@ namespace Microsoft.AspNetCore.Identity
/// The <see cref="ILookupNormalizer"/> used to normalize things like user and role names. /// The <see cref="ILookupNormalizer"/> used to normalize things like user and role names.
/// </summary> /// </summary>
public ILookupNormalizer KeyNormalizer { get; set; } public ILookupNormalizer KeyNormalizer { get; set; }
/// <summary> /// <summary>
/// The <see cref="IdentityErrorDescriber"/> used to generate error messages. /// The <see cref="IdentityErrorDescriber"/> used to generate error messages.
/// </summary> /// </summary>
@ -617,7 +617,7 @@ namespace Microsoft.AspNetCore.Identity
/// <returns>A normalized value representing the specified <paramref name="email"/>.</returns> /// <returns>A normalized value representing the specified <paramref name="email"/>.</returns>
public virtual string NormalizeEmail(string email) public virtual string NormalizeEmail(string email)
=> (KeyNormalizer == null) ? email : KeyNormalizer.NormalizeEmail(email); => (KeyNormalizer == null) ? email : KeyNormalizer.NormalizeEmail(email);
private string ProtectPersonalData(string data) private string ProtectPersonalData(string data)
{ {
if (Options.Stores.ProtectPersonalData) if (Options.Stores.ProtectPersonalData)
@ -861,7 +861,7 @@ namespace Microsoft.AspNetCore.Identity
throw new ArgumentNullException(nameof(user)); throw new ArgumentNullException(nameof(user));
} }
var stamp = await securityStore.GetSecurityStampAsync(user, CancellationToken); var stamp = await securityStore.GetSecurityStampAsync(user, CancellationToken);
if (stamp == null) if (stamp == null)
{ {
Logger.LogWarning(15, "GetSecurityStampAsync for user {userId} failed because stamp was null.", await GetUserIdAsync(user)); Logger.LogWarning(15, "GetSecurityStampAsync for user {userId} failed because stamp was null.", await GetUserIdAsync(user));
throw new InvalidOperationException(Resources.NullSecurityStamp); throw new InvalidOperationException(Resources.NullSecurityStamp);
@ -1898,7 +1898,7 @@ namespace Microsoft.AspNetCore.Identity
} }
/// <summary> /// <summary>
/// Returns a flag indicating whether the specified <paramref name="user"/> his locked out, /// Returns a flag indicating whether the specified <paramref name="user"/> is locked out,
/// as an asynchronous operation. /// as an asynchronous operation.
/// </summary> /// </summary>
/// <param name="user">The user whose locked out status should be retrieved.</param> /// <param name="user">The user whose locked out status should be retrieved.</param>

View File

@ -131,9 +131,9 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
} }
private static void ReplaceAttributeRouteTokens( private static void ReplaceAttributeRouteTokens(
ControllerModel controller, ControllerModel controller,
ActionModel action, ActionModel action,
SelectorModel selector, SelectorModel selector,
List<string> errors) List<string> errors)
{ {
if (selector.AttributeRouteModel == null) if (selector.AttributeRouteModel == null)
@ -148,7 +148,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
{ "action", action.ActionName }, { "action", action.ActionName },
{ "controller", controller.ControllerName }, { "controller", controller.ControllerName },
}; };
foreach (var kvp in action.RouteValues) foreach (var kvp in action.RouteValues)
{ {
routeValues.TryAdd(kvp.Key, kvp.Value); routeValues.TryAdd(kvp.Key, kvp.Value);
@ -186,7 +186,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
} }
private static void AddActionToMethodInfoMap( private static void AddActionToMethodInfoMap(
Dictionary<MethodInfo, List<(ActionModel, SelectorModel)>> actionsByMethod, Dictionary<MethodInfo, List<(ActionModel, SelectorModel)>> actionsByMethod,
ActionModel action, ActionModel action,
SelectorModel selector) SelectorModel selector)
{ {
@ -242,7 +242,7 @@ namespace Microsoft.AspNetCore.Mvc.ApplicationModels
// we compare it against the rest of the templates that have that same name // we compare it against the rest of the templates that have that same name
// associated. // associated.
// The moment we find one that is different we report the whole group to the // The moment we find one that is different we report the whole group to the
// user in the error message so that he can see the different actions and the // user in the error message so that they can see the different actions and the
// different templates for a given named attribute route. // different templates for a given named attribute route.
var template = actions[0].selector.AttributeRouteModel.Template; var template = actions[0].selector.AttributeRouteModel.Template;

View File

@ -120,7 +120,7 @@ export class Login extends Component {
redirectToApiAuthorizationPath(apiAuthorizationPath) { redirectToApiAuthorizationPath(apiAuthorizationPath) {
const redirectUrl = `${window.location.origin}${apiAuthorizationPath}`; const redirectUrl = `${window.location.origin}${apiAuthorizationPath}`;
// It's important that we do a replace here so that when the user hits the back arrow on the // It's important that we do a replace here so that when the user hits the back arrow on the
// browser he gets sent back to where it was on the app instead of to an endpoint on this // browser they get sent back to where it was on the app instead of to an endpoint on this
// component. // component.
window.location.replace(redirectUrl); window.location.replace(redirectUrl);
} }