Skip to content

Commit

Permalink
Fix grammar and typos in README.md files
Browse files Browse the repository at this point in the history
  • Loading branch information
mburumaxwell committed Oct 5, 2023
1 parent df1b36f commit 63f8ec8
Show file tree
Hide file tree
Showing 13 changed files with 27 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ This repository contains projects/libraries for adding useful functionality to d
|`Tingle.AspNetCore.Tokens`|[![NuGet](https://img.shields.io/nuget/v/Tingle.AspNetCore.Tokens.svg)](https://www.nuget.org/packages/Tingle.AspNetCore.Tokens/)|Support for generation of continuation tokens in ASP.NET Core with optional expiry. Useful for pagination, user invite tokens, expiring operation tokens, etc. This is availed through the `ContinuationToken<T>` and `TimedContinuationToken<T>` types. See [docs](./src/Tingle.AspNetCore.Tokens/README.md) and [sample](./samples/TokensSample).|
|`Tingle.Extensions.Caching.MongoDB`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.Caching.MongoDB.svg)](https://www.nuget.org/packages/Tingle.Extensions.Caching.MongoDB/)|Distributed caching implemented with [MongoDB](https://mongodb.com) on top of `IDistributedCache`, inspired by [CosmosCache](https://github.com/Azure/Microsoft.Extensions.Caching.Cosmos). See [docs](./src/Tingle.Extensions.Caching.MongoDB/README.md)and [sample](./samples/AspNetCoreSessionState)|
|`Tingle.Extensions.DataAnnotations`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.DataAnnotations.svg)](https://www.nuget.org/packages/Tingle.Extensions.DataAnnotations/)|Additional data validation attributes in the `System.ComponentModel.DataAnnotations` namespace. Some of this should have been present in the framework but are very specific to some use cases. For example `FiveStarRatingAttribute`. See [docs](./src/Tingle.Extensions.DataAnnotations/README.md).|
|`Tingle.Extensions.Http`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.Http.svg)](https://www.nuget.org/packages/Tingle.Extensions.Http/)|Light weight abstraction around `HttpClient` which can be used to build custom client with response wrapping semantics. See [docs](./src/Tingle.Extensions.Http/README.md).|
|`Tingle.Extensions.Http`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.Http.svg)](https://www.nuget.org/packages/Tingle.Extensions.Http/)|Lightweight abstraction around `HttpClient` which can be used to build custom client with response wrapping semantics. See [docs](./src/Tingle.Extensions.Http/README.md).|
|`Tingle.Extensions.Http.Authentication`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.Http.Authentication.svg)](https://www.nuget.org/packages/Tingle.Extensions.Http.Authentication/)|Authentication providers for use with HttpClient and includes support for DI via `Microsoft.Extensions.Http`. See [docs](./src/Tingle.Extensions.Http.Authentication/README.md) and [sample](./samples/HttpAuthenticationSample).|
|`Tingle.Extensions.JsonPatch`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.JsonPatch.svg)](https://www.nuget.org/packages/Tingle.Extensions.JsonPatch/)|JSON Patch (RFC 6902) support for .NET to easily generate JSON Patch documents using `System.Text.Json` for client applications. See [docs](./src/Tingle.Extensions.JsonPatch/README.md).|
|`Tingle.Extensions.PhoneValidators`|[![NuGet](https://img.shields.io/nuget/v/Tingle.Extensions.PhoneValidators.svg)](https://www.nuget.org/packages/Tingle.Extensions.PhoneValidators/)|Convenience for validation of phone numbers either via attributes or resolvable services. See [docs](./src/Tingle.Extensions.PhoneValidators/README.md).|
Expand Down
8 changes: 4 additions & 4 deletions src/Tingle.AspNetCore.Authentication/README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Tingle.AspNetCore.Authentication

## SharedKey Authentication
## Shared Key Authentication

This authentication logic mirrors the one for most Azure services such as Azure storage. Every request provides a different authentication value signed/encrypted with a key shared prioir.
This can often provide better security as compared to bearer tokens in OAuth/OpenId when introspection is not done on every request or when introspection canbe very expensive.
This authentication logic mirrors the one for most Azure services such as Azure storage. Every request provides a different authentication value signed/encrypted with a key shared prior.
This can often provide better security as compared to bearer tokens in OAuth/OpenId when introspection is not done on every request or when introspection can be very expensive.

Most common usage scenario is machine-to-machine authentication where the OAuth flow is expensive (introspection and renewing tokens).

Expand Down Expand Up @@ -35,7 +35,7 @@ builder.Service.AddAuthorization(options =>
policy.AddAuthenticationSchemes(SharedKeyDefaults.AuthenticationScheme)
.RequireAuthenticatedUser();
});
}
});

var app = builder.Build();

Expand Down
6 changes: 3 additions & 3 deletions src/Tingle.AspNetCore.Authorization/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

Authorization refers to the process that determines what a user is able to do. For example, an administrative user is allowed to create a document library, add documents, edit documents, and delete them. A non-administrative user working with the library is only authorized to read the documents.

Authorization is orthogonal and independent from authentication. However, authorization requires an authentication mechanism. Authentication is the process of ascertaining who a user is. Authentication may create one or more identities for the current user.
Authorization is orthogonal and independent of authentication. However, authorization requires an authentication mechanism. Authentication is the process of ascertaining who a user is. Authentication may create one or more identities for the current user.

Below are some of the functionalities that the library provides to aid with authorization work flows.

Expand Down Expand Up @@ -61,7 +61,7 @@ public class DummyController : ControllerBase
}
```

Is that it?...Wait there's more!
Is that it?... Wait there's more!

### Fully Qualified Domain Names

Expand Down Expand Up @@ -97,7 +97,7 @@ builder.Services.AddApprovedNetworksHandler();

### Azure IPs

For developers who are working with Microsoft Azure and they'd wish to allow all their IP addresses they can do that easily as demonstrated below:
For developers who are working with Microsoft Azure, and they'd wish to allow all their IP addresses they can do that easily as demonstrated below:

In Program.cs

Expand Down
4 changes: 2 additions & 2 deletions src/Tingle.AspNetCore.DataProtection.MongoDB/README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# Tingle.AspNetCore.DataProtection.MongoDB

Web applications often need to store security-sensitive data. Windows provides DPAPI for desktop applications but this is unsuitable for web applications especially when running in a Docker container. The ASP.NET Core data protection stack provide a simple, easy to use cryptographic API a developer can use to protect data, including key management and rotation.
Web applications often need to store security-sensitive data. Windows provides DPAPI for desktop applications, but this is unsuitable for web applications especially when running in a Docker container. The ASP.NET Core data protection stack provide a simple, easy to use cryptographic API a developer can use to protect data, including key management and rotation.

Microsoft has already provided ways to persist data protection keys to [various storage systems.](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-7.0).
Microsoft has already provided ways to persist data protection keys to [various storage systems](https://docs.microsoft.com/en-us/aspnet/core/security/data-protection/configuration/overview?view=aspnetcore-7.0).

This package provides the functionality to persist the data protection keys to MongoDB.

Expand Down
2 changes: 1 addition & 1 deletion src/Tingle.AspNetCore.JsonPatch.NewtonsoftJson/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tingle.AspNetCore.JsonPatch.NewtonsoftJson

When performing patch operations, it is very likely that some of the updates to the model may try to modify or remove immutable types and thus there is a
When performing patch operations, it is very likely that some updates to the model may try to modify or remove immutable types and thus there is a
need to ensure that this is not the case before committing the changes to the persistence layer such as a database.

A sample usage of this functionality is shown below:
Expand Down
2 changes: 0 additions & 2 deletions src/Tingle.AspNetCore.Tokens/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -151,8 +151,6 @@ public class DisbursementController : ControllerBase
[HttpPost("initiate")]
public IActionResult Initiate([FromBody] DisbursementInitiateModel model)
{
// do lots of time consuming checks here such as limit per day, forex rules, etc.
// do light weight checks e.g. enough funds in the account
// generate token and send it back in the response
Expand Down
2 changes: 1 addition & 1 deletion src/Tingle.Extensions.DataAnnotations/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Additional data validation attributes in the `System.ComponentModel.DataAnnotati
|`DateMustBeInThePastAttribute`|Specifies that a data field value is a date in the past.||
|`FiveStarRatingAttribute`|Specifies the decimal numeric range for the value of a data field must be between 0 and 5.||
|`GreaterThanZeroAttribute`|Specifies the integer numeric range for the value of a data field must be more than zero. Only works for integers.||
|`KRAPinAttribute`|Specifies that a data field value is a well-formed KRA Pin number using a regular expression for KRA Pins.<br/>The default expression to be matched is:<br/>`^[a-zA-Z][0-9]{9}[a-zA-Z]$`||
|`KRAPinAttribute`|Specifies that a data field value is a well-formed KRA PIN number using a regular expression for KRA Pins.<br/>The default expression to be matched is:<br/>`^[a-zA-Z][0-9]{9}[a-zA-Z]$`||
|`PrefixAttribute`|Specifies that a data field value starts with a specified string.||
|`SuffixAttribute`|Specifies that a data field value ends with a specified string.||
|`SwiftCodeAttribute`|Specifies that a data field value is a well-formed SWIFT Code using a regular expression for SWIFT Codes as specified under ISO-9362.<br/>The expression to be matched is <br/>`^([a-zA-Z]{4})([a-zA-Z]{2})([a-zA-Z0-9]{2})([a-zA-Z0-9]{3})?$`||
Expand Down
6 changes: 3 additions & 3 deletions src/Tingle.Extensions.Http.Authentication/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ builder.Services.AddHttpClient<MyCustomClient>()
.AddApiKeyHeaderAuthenticationHandler("my-api-key-here", scheme: "Bearer");
```

This will add an Authorization here -> `Authorization: Bearer my-api-key-here`
This will add an Authorization header → `Authorization: Bearer my-api-key-here`

## API Key in the query string

Expand All @@ -27,11 +27,11 @@ builder.Services.AddHttpClient<MyCustomClient>()
.AddApiKeyQueryAuthenticationHandler("my-api-key-here", queryParameterName: "key");
```

This will append to the query string of the request before the request is send out. E.g. `https://contoso.com/?key=my-api-key-here`
This will append to the query string of the request before the request is sent out. E.g. `https://contoso.com/?key=my-api-key-here`

## Pre-Shared Key (PSK) in the `Authorization` header

This behaves similar to Microsoft's shared key authentication which you can also use in your own projects. Every requests ends up with a different authorization value and can be safer in some situations compared to using OAuth.
This behaves similar to Microsoft's shared key authentication which you can also use in your own projects. Every request ends up with a different authorization value and can be safer in some situations compared to using OAuth.

```cs
builder.Services.AddHttpClient($"{nameof(Worker)}4")
Expand Down
4 changes: 2 additions & 2 deletions src/Tingle.Extensions.Http/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tingle.Extensions.Http

This provides a light weight abstraction around `HttpClient` which can be used to build custom client with response wrapping semantics.
This provides a lightweight abstraction around `HttpClient` which can be used to build custom client with response wrapping semantics.

The default serialization is done using JSON (`System.Text.Json`) but can be overridden to handle XML, SOAP, or any other formats including just changing the serializer to `Newtonsoft.Json`.

Expand Down Expand Up @@ -29,7 +29,7 @@ public class MyServiceClient : AbstractApiClient<MyServiceClientOptions>
public class MyServiceClientOptions : AbstractHttpApiClientOptions { }
```

Adding to Services Collection
Adding to services collection

In `Program.cs` add the following code snippet:

Expand Down
2 changes: 1 addition & 1 deletion src/Tingle.Extensions.JsonPatch/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ An instantiated `Customer` object would then look like this:
"quantity": 1
},
{
"item": "C# In A Nuthshell Book",
"item": "C# In A Nutshell Book",
"quantity": 1
}
]
Expand Down
6 changes: 3 additions & 3 deletions src/Tingle.Extensions.PhoneValidators/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tingle.Extensions.PhoneValidators

This library is used to validate if a phone number is valid. It can also be used to convert Kenyan phone numbers phone numbers between E.164, local, and MSISDN formats.
This library is used to validate if a phone number is valid. It can also be used to convert Kenyan phone numbers between E.164, local, and MSISDN formats.

## Using attributes

Expand Down Expand Up @@ -43,7 +43,7 @@ The available attributes include:
|Attribute Name|Description|
|--|--|
|E164PhoneAttribute|Validates that the value is formatted as per the [E.164 standard](https://en.wikipedia.org/wiki/E.164).|
|MsisdnPhoneAttribute|Validates that the value is formatted as per the [MSISDN format](https://en.wikipedia.org/wiki/MSISDN#:~:text=MSISDN%20(pronounced%20as%20%2F'em,a%20mobile%20or%20cellular%20phone.).|
|MsisdnPhoneAttribute|Validates that the value is formatted as per the [MSISDN format](https://en.wikipedia.org/wiki/MSISDN#:~:text=MSISDN%20(pronounced%20as%20%2F'em,a%20mobile%20or%20cellular%20phone.)).|
|SafaricomPhoneAttribute|Validates that the value is valid for Safaricom Kenya phone numbers|
|AirtelPhoneAttribute|Validates that the value is valid for Airtel Kenya phone numbers|
|TelkomPhoneAttribute|Validates that the value is valid for Telkom Kenya phone numbers|
Expand All @@ -66,7 +66,7 @@ public class DummyController : ControllerBase
var result = phoneNumberValidator.IsValid(phoneNumber);
if (!result) return BadRequest("Invalid Phone number!");

//Convert to MSISDN format
// Convert to MSISDN format
var msisdn = phoneNumberValidators.ToMsisdn(phoneNumber);
return Ok(msisdn);
}
Expand Down
10 changes: 4 additions & 6 deletions src/Tingle.Extensions.Processing/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ The various functionalities will be described using examples below.

## Sequential Batch Processing

There are scenarios when we need to do some sort of processing of items in an `IEnumerable` but wish to do so in a parallel fashion without splitting up the items so as to ensure processing order of items is guaranteed.
There are scenarios when we need to do some sort of processing of items in an `IEnumerable` but wish to do so in a parallel fashion without splitting up the items to ensure processing order of items is guaranteed.

Let us look at an example of how we can help to accomplish this.

Expand All @@ -33,13 +33,11 @@ var processor = new SequentialBatchProcessor<string>(concurrencyLimit: 1, handle
await processor.ProcessAsync(tokens, cancellationToken);
```

Therefore, we can process the `tokens` in a sequential manner. By default, `SequentialBatchProcessor<T>`'s constructor has the concurrency limit set to 1. If you wish to increase the number of items handled concurrently, you can increase this limit to a higher value.
Therefore, we can process the `tokens` sequentially. By default, `SequentialBatchProcessor<T>`'s constructor has the concurrency limit set to 1. If you wish to increase the number of items handled concurrently, you can increase this limit to a higher value.

## Split and Batch Processing

With this functionality, you can split a list of items and then process the splits in parallel. For example, a list of 2,000 items with a batchSize of 100 to produce 20 batches which would be processed in parallel.

However, unlike the Sequential Batch Processing described above, the processing order isn't guaranteed.
With this functionality, you can split a list of items and then process the splits in parallel. For example, a list of 2,000 items with a batch size of 100 to produce 20 batches which would be processed in parallel. However, unlike the Sequential Batch Processing described above, the processing order isn't guaranteed.

Using the previously defined `tokens` variable let us see how we can accomplish this:

Expand All @@ -58,4 +56,4 @@ var processor = new SplitAndBatchProcessor<string>(batchSize: 10, handler: (slic
await processor.ProcessAsync(items: tokens, cancellationToken);
```

The list of `tokens` will be split into batches of 10 and then the slices will be processed in parallel. The batch size is set to 10 by default but a developer can change this to suit their own specific requirements.
The list of `tokens` will be split into batches of 10 and then the slices will be processed in parallel. The batch size is set to 10 by default, but a developer can change this to suit their own specific requirements.
4 changes: 2 additions & 2 deletions src/Tingle.Extensions.PushNotifications/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Tingle.Extensions.PushNotifications

This library contains light weight clients for sending push notifications to devices via APNS and FCM. It exists either because there is no comprehensive library or the official library cannot be tested by stubbing HTTP requests
This library contains lightweight clients for sending push notifications to devices via APNS and FCM. It exists either because there is no comprehensive library or the official library cannot be tested by stubbing HTTP requests

## Apple Push Notification Service (APNs)

Expand Down Expand Up @@ -80,7 +80,7 @@ async Task SendApnsAsync(CancellationToken cancellationToken = default)

This library is a wrapper around the service, you still need to understand how the service works in order to make correct requests. Make sure to read the [official docs](https://firebase.google.com/docs/cloud-messaging).

### v1 HTTP API
### V1 HTTP API

In your appsettings.json (or any other configuration store/source you use):

Expand Down

0 comments on commit 63f8ec8

Please sign in to comment.