Skip to content

Commit

Permalink
Merge branch 'release/0.110.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
Jericho committed Nov 17, 2024
2 parents 467f64b + ad17f9a commit 82556a5
Show file tree
Hide file tree
Showing 19 changed files with 724 additions and 912 deletions.
2 changes: 1 addition & 1 deletion .config/dotnet-tools.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"isRoot": true,
"tools": {
"cake.tool": {
"version": "4.0.0",
"version": "5.0.0",
"commands": [
"dotnet-cake"
]
Expand Down
27 changes: 4 additions & 23 deletions GitVersion.yml
Original file line number Diff line number Diff line change
@@ -1,26 +1,7 @@
mode: ContinuousDelivery
workflow: GitFlow/v1 # https://github.com/GitTools/GitVersion/blob/main/docs/input/docs/reference/configuration.md#snippet-/docs/workflows/GitFlow/v1.yml

branches:
master:
regex: (master|main)
mode: ContinuousDelivery
tag:
increment: Patch
prevent-increment-of-merged-branch-version: true
track-merge-target: false
feature:
regex: feature(s)?[/-]
mode: ContinuousDeployment
develop:
regex: dev(elop)?(ment)?$
mode: ContinuousDeployment
tag: beta
hotfix:
regex: hotfix(es)?[/-]
mode: ContinuousDeployment
tag: hotfix
label: beta # default is 'alpha' for the 'develop' branch. I prefer 'beta'.
release:
regex: release(s)?[/-]
mode: ContinuousDeployment
tag: rc
ignore:
sha: []
label: rc # default is 'beta' for the 'release' branch. I prefer 'RC'.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ var attachments = new[]
var messageId = await strongGridClient.Mail.SendToSingleRecipientAsync(to, from, subject, html, text, attachments: attachments).ConfigureAwait(false);
```

You have access to numerous 'resources' (such as Contacts, Lists, Segments, Settings, SenderAuthentication, etc) off of the Client and each resource offers several methods to such as retrieve, create, update, delete, etc.
You have access to numerous 'resources' (such as Contacts, Lists, Segments, Settings, SenderAuthentication, etc) off of the Client and each resource offers several methods such as retrieve, create, update, delete, etc.

Here are a few example:
```csharp
Expand Down Expand Up @@ -120,7 +120,7 @@ var template = await strongGridClient.Templates.CreateAsync("My template");
```

### Dynamic templates
In August 2018, SendGrid released a new feature in their API that allows you to use the [Handlebars syntax](https://sendgrid.com/docs/User_Guide/Transactional_Templates/Using_handlebars.html) to specify merge fields in your content. Using this powerfull new feature in StrongGrid is very easy.
In August 2018, SendGrid released a new feature in their API that allows you to use the [Handlebars syntax](https://sendgrid.com/docs/User_Guide/Transactional_Templates/Using_handlebars.html) to specify merge fields in your content. Using this powerful new feature in StrongGrid is very easy.

First, you must specify `TemplateType.Dynamic` when creating a new template like in this example:

Expand Down Expand Up @@ -228,7 +228,7 @@ namespace WebApplication1.Controllers

### Parsing a signed webhook

SendGrid has a feature called `Signed Event Webhook Requests` which you can enable under `Settings > Mail Settings > Event Settings` when logged in your SendGrid account. When this feature is enabled, SendGrid includes additional information with each webhook that allow you to verify that this webhook indeed originated from SendGrid and therefore can be trusted. Specifically, the webhook will include a "signature" and a "timestamp" and you must use these two value along with a public key that SendGrid generated when you enabled the feature to validate the data being submited to you. Please note that SendGrid sometimes refers to this value as a "verification key". In case you are curious and want to know more about the inticacies of validating the data, I invite you to read SendGrid's [documentation on this topic](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features/).
SendGrid has a feature called `Signed Event Webhook Requests` which you can enable under `Settings > Mail Settings > Event Settings` when logged in your SendGrid account. When this feature is enabled, SendGrid includes additional information with each webhook that allows you to verify that this webhook indeed originated from SendGrid and therefore can be trusted. Specifically, the webhook will include a "signature" and a "timestamp" and you must use these two values along with a public key that SendGrid generated when you enabled the feature to validate the data being submited to you. Please note that SendGrid sometimes refers to this value as a "verification key". In case you are curious and want to know more about the intricacies of validating the data, I invite you to read SendGrid's [documentation on this topic](https://sendgrid.com/docs/for-developers/tracking-events/getting-started-event-webhook-security-features/).

However, if you want to avoid learning how to perform the validation and you simply want this validation to be conveniently performed for you, StrongGrid can help! The `WebhookParser` class has a method called `ParseSignedEventsWebhookAsync`which will automatically validate the data and throw a security exception if validation fails. If the validation fails, you should consider the webhook data to be invalid. Here's how it works:

Expand Down Expand Up @@ -318,9 +318,9 @@ var warmupSettings = WarmupSettings.FromSendGridRecomendedSettings(poolName, est
```

**Progress repository:** By default StrongGrid's WarmupEngine will write progress information in a file on your computer's `temp` folder but you can override this settings.
You can change the folder where this file is saved but you can also decide to use a completely different repository. Out of the box, StrongGrid provides `FileSystemWarmupProgressRepository` and `MemoryWarmupProgressRepository`.
You can change the folder where this file is saved and you can also decide to use a completely different repository. Out of the box, StrongGrid provides `FileSystemWarmupProgressRepository` and `MemoryWarmupProgressRepository`.
It also provides an interface called `IWarmupProgressRepository` which allows you to write your own implementation to save the progress data to a location more suitable to you such as a database, Azure, AWS, etc.
Please note that `MemoryWarmupProgressRepository` in intended to be used for testing and we don't recommend using it in production. The main reason for this recommendation is that the data is stored in memory and it's lost when your computer is restarted.
Please note that `MemoryWarmupProgressRepository` in intended to be used for testing and we don't recommend using it in production. The main reason for this recommendation is that the data is stored in memory and is lost when your computer is restarted.
This means that your warmup process would start all over from day 1 each time you computer is rebooted.

```csharp
Expand Down
2 changes: 1 addition & 1 deletion Source/StrongGrid.Benchmark/StrongGrid.Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.13.12" />
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@
<PackageReference Include="Logzio.DotNet.NLog" Version="1.2.0" />
<PackageReference Include="Microsoft.ApplicationInsights.NLogTarget" Version="2.22.0" />
<PackageReference Include="Microsoft.Extensions.Configuration.Abstractions" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.0" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.1" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.11" />
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="8.0.1" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" Version="8.0.2" />
<PackageReference Include="NLog.Extensions.Logging" Version="5.3.14" />
</ItemGroup>

<ItemGroup>
Expand Down
1 change: 1 addition & 0 deletions Source/StrongGrid.IntegrationTests/Tests/ApiKeys.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ public async Task RunAsync(IBaseClient client, TextWriter log, CancellationToken

// GET THE CURRENT USER'S PERMISSIONS
var permissions = await client.User.GetPermissionsAsync(null, cancellationToken).ConfigureAwait(false);
Array.Sort(permissions); // Sort the permissions alphabetically for convenience
await log.WriteLineAsync($"Current user has been granted {permissions.Length} permissions").ConfigureAwait(false);

// CREATE AND DELETE A BILLING API KEY (if authorized)
Expand Down
6 changes: 3 additions & 3 deletions Source/StrongGrid.UnitTests/StrongGrid.UnitTests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.10.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="NSubstitute" Version="5.1.0" />
<PackageReference Include="NSubstitute.Analyzers.CSharp" Version="1.0.17">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
<PackageReference Include="RichardSzalay.MockHttp" Version="7.0.0" />
<PackageReference Include="Shouldly" Version="4.2.1" />
<PackageReference Include="xunit" Version="2.8.1" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.1">
<PackageReference Include="xunit" Version="2.9.2" />
<PackageReference Include="xunit.runner.visualstudio" Version="2.8.2">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
Expand Down
Loading

0 comments on commit 82556a5

Please sign in to comment.