From e5afd69f7cc3567c1d723458d86678925a2ffdb9 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Thu, 25 Dec 2025 15:00:54 +0100 Subject: [PATCH 1/6] 1.21.0 --- CHANGELOG.md | 3 +++ Directory.Build.props | 2 +- Generate-ReleaseNotes.cmd | 2 +- PackageReleaseNotes.txt | 8 ++------ 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6c4afbe4..90cd7c47 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.21.0 (25 December 2025) +- [#1408](https://github.com/wiremock/WireMock.Net/pull/1408) - Fix readyness-check for Testcontainers [bug] contributed by [StefH](https://github.com/StefH) + # 1.20.0 (24 December 2025) - [#1399](https://github.com/wiremock/WireMock.Net/pull/1399) - Upgrade RamlToOpenApiConverter and YamlDotNet [feature] contributed by [StefH](https://github.com/StefH) - [#1400](https://github.com/wiremock/WireMock.Net/pull/1400) - Add WireMock.Net.NUnit project [feature] contributed by [StefH](https://github.com/StefH) diff --git a/Directory.Build.props b/Directory.Build.props index e98fb3ce..2d759004 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ - 1.20.0 + 1.21.0 WireMock.Net-Logo.png https://github.com/wiremock/WireMock.Net Apache-2.0 diff --git a/Generate-ReleaseNotes.cmd b/Generate-ReleaseNotes.cmd index 5a5e664b..4f63342a 100644 --- a/Generate-ReleaseNotes.cmd +++ b/Generate-ReleaseNotes.cmd @@ -1,6 +1,6 @@ rem https://github.com/StefH/GitHubReleaseNotes -SET version=1.20.0 +SET version=1.21.0 GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN% diff --git a/PackageReleaseNotes.txt b/PackageReleaseNotes.txt index d0d374b0..455ba620 100644 --- a/PackageReleaseNotes.txt +++ b/PackageReleaseNotes.txt @@ -1,8 +1,4 @@ -# 1.20.0 (24 December 2025) -- #1399 Upgrade RamlToOpenApiConverter and YamlDotNet [feature] -- #1400 Add WireMock.Net.NUnit project [feature] -- #1405 Fix Testcontainers AddProtoDefinition [bug] -- #1398 Upgrade YamlDotNet dependency [feature] -- #1404 An exception occurs when adding multiple proto definitions in the TestContainer. [bug] +# 1.21.0 (25 December 2025) +- #1408 Fix readyness-check for Testcontainers [bug] The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md \ No newline at end of file From b090296559a214be0af33b081649c63be32c3466 Mon Sep 17 00:00:00 2001 From: Vadim Hatsura Date: Fri, 2 Jan 2026 21:25:28 +0100 Subject: [PATCH 2/6] chore(testcontainers): bump up Testcontainers to version 4.10.0 (#1412) --- .../WireMock.Net.Testcontainers.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj index cf37e666..fc0e6b29 100644 --- a/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj +++ b/src/WireMock.Net.Testcontainers/WireMock.Net.Testcontainers.csproj @@ -39,7 +39,7 @@ runtime; build; native; contentfiles; analyzers; buildtransitive - + From c88e7378a7db6f34d88c937af9b9721633fa5d65 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Fri, 2 Jan 2026 21:30:59 +0100 Subject: [PATCH 3/6] 1.22.0 --- CHANGELOG.md | 4 ++++ Directory.Build.props | 2 +- Generate-ReleaseNotes.cmd | 2 +- PackageReleaseNotes.txt | 5 +++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 90cd7c47..fe2640b8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +# 1.22.0 (02 January 2026) +- [#1412](https://github.com/wiremock/WireMock.Net/pull/1412) - chore(testcontainers): bump up Testcontainers to version 4.10.0 [feature] contributed by [vhatsura](https://github.com/vhatsura) +- [#1411](https://github.com/wiremock/WireMock.Net/issues/1411) - WireMock.Net.Testcontainers isn't compatible with Testcontainers 4.10.0 [bug] + # 1.21.0 (25 December 2025) - [#1408](https://github.com/wiremock/WireMock.Net/pull/1408) - Fix readyness-check for Testcontainers [bug] contributed by [StefH](https://github.com/StefH) diff --git a/Directory.Build.props b/Directory.Build.props index 2d759004..51a840c4 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ - 1.21.0 + 1.22.0 WireMock.Net-Logo.png https://github.com/wiremock/WireMock.Net Apache-2.0 diff --git a/Generate-ReleaseNotes.cmd b/Generate-ReleaseNotes.cmd index 4f63342a..5c9e488c 100644 --- a/Generate-ReleaseNotes.cmd +++ b/Generate-ReleaseNotes.cmd @@ -1,6 +1,6 @@ rem https://github.com/StefH/GitHubReleaseNotes -SET version=1.21.0 +SET version=1.22.0 GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN% diff --git a/PackageReleaseNotes.txt b/PackageReleaseNotes.txt index 455ba620..83140fb9 100644 --- a/PackageReleaseNotes.txt +++ b/PackageReleaseNotes.txt @@ -1,4 +1,5 @@ -# 1.21.0 (25 December 2025) -- #1408 Fix readyness-check for Testcontainers [bug] +# 1.22.0 (02 January 2026) +- #1412 chore(testcontainers): bump up Testcontainers to version 4.10.0 [feature] +- #1411 WireMock.Net.Testcontainers isn't compatible with Testcontainers 4.10.0 [bug] The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md \ No newline at end of file From 9cee6dde001bbbeac350ad2ad20d9f6b93157429 Mon Sep 17 00:00:00 2001 From: Luca Ma Date: Sun, 4 Jan 2026 15:03:19 +0800 Subject: [PATCH 4/6] Pass the parameter matchOperator in Request.WithPath to its inner calls (#1414) Co-authored-by: Luca Ma --- src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs index 7ff11fd8..32b83ecc 100644 --- a/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs +++ b/src/WireMock.Net.Minimal/RequestBuilders/Request.WithPath.cs @@ -21,7 +21,7 @@ public partial class Request { Guard.NotNullOrEmpty(matchers); - _requestMatchers.Add(new RequestMessagePathMatcher(MatchBehaviour.AcceptOnMatch, MatchOperator.Or, matchers)); + _requestMatchers.Add(new RequestMessagePathMatcher(MatchBehaviour.AcceptOnMatch, matchOperator, matchers)); return this; } From 0e60e3f3f91dfe3af88e86dc1d2070168944399c Mon Sep 17 00:00:00 2001 From: samlatham Date: Mon, 5 Jan 2026 20:24:48 +0000 Subject: [PATCH 5/6] Fix: Pass AllowedHandlebarsHelpers configuration to Handlebars.Net.Helpers (#1416) Pass AllowedHandlebarsHelpers configuration to Handlebars.Net.Helpers so that optional handlebars helpers can be enabled. Co-authored-by: Sam Latham --- .../Handlebars/WireMockHandlebarsHelpers.cs | 2 + .../Settings/HandlebarsSettingsTests.cs | 91 +++++++++++++++++++ 2 files changed, 93 insertions(+) create mode 100644 test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs diff --git a/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs b/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs index c270b15d..b0e4fa30 100644 --- a/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs +++ b/src/WireMock.Net.Minimal/Transformers/Handlebars/WireMockHandlebarsHelpers.cs @@ -39,6 +39,8 @@ internal static class WireMockHandlebarsHelpers #endif o.CustomHelperPaths = paths; + o.Categories = settings.HandlebarsSettings?.AllowedHandlebarsHelpers ?? HandlebarsSettings.DefaultAllowedHandlebarsHelpers; + o.CustomHelpers = new Dictionary(); if (settings.HandlebarsSettings?.AllowedCustomHandlebarsHelpers.HasFlag(CustomHandlebarsHelpers.File) == true) { diff --git a/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs new file mode 100644 index 00000000..ab27c4c7 --- /dev/null +++ b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs @@ -0,0 +1,91 @@ +// Copyright © WireMock.Net + +using System; +using System.Linq; +using System.Threading.Tasks; +using FluentAssertions; +using HandlebarsDotNet; +using HandlebarsDotNet.Helpers.Enums; +using Moq; +using NFluent; +using WireMock.Handlers; +using WireMock.Models; +using WireMock.ResponseBuilders; +using WireMock.Settings; +using Xunit; + +namespace WireMock.Net.Tests.Settings; + +public class HandlebarsSettingsTests +{ + private const string ClientIp = "::1"; + + private readonly WireMockServerSettings _settings; + private readonly Mock _mappingMock; + private readonly Mock _fileSystemHandlerMock; + + public HandlebarsSettingsTests() + { + _mappingMock = new Mock(); + + _fileSystemHandlerMock = new Mock(MockBehavior.Strict); + + _settings = new WireMockServerSettings + { + FileSystemHandler = _fileSystemHandlerMock.Object + }; + } + + [Fact] + public async Task Response_HandlebarsHelpers_Environment_NotAllowed_By_Default() + { + // Arrange + var request = new RequestMessage(new UrlDetails("http://localhost:1234"), "GET", ClientIp); + + var responseBuilder = Response.Create() + .WithBody("Username: {{Environment.GetEnvironmentVariable \"USERNAME\"}}") + .WithTransformer(); + + // Act + Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings); + + // Assert + action.Should().ThrowAsync(); + } + + [Fact] + public async Task Response_HandlebarsHelpers_Environment_Allowed_When_Configured() + { + // Arrange + var settingsWithEnv = new WireMockServerSettings + { + FileSystemHandler = _fileSystemHandlerMock.Object, + HandlebarsSettings = new HandlebarsSettings + { + AllowedHandlebarsHelpers = HandlebarsSettings.DefaultAllowedHandlebarsHelpers + .Concat(new[] { Category.Environment }) + .ToArray() + } + }; + + var request = new RequestMessage(new UrlDetails("http://localhost:1234"), "GET", ClientIp); + + var responseBuilder = Response.Create() + .WithBody("User: {{Environment.GetEnvironmentVariable \"USERNAME\"}}") + .WithTransformer(); + + // Act + var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, settingsWithEnv).ConfigureAwait(false); + + // Assert + Check.That(response.Message.BodyData.BodyAsString).Not.Contains("{{Environment.GetEnvironmentVariable"); + Check.That(response.Message.BodyData.BodyAsString).StartsWith("User: "); + } + + [Fact] + public void DefaultAllowedHandlebarsHelpers_Should_Not_Include_Environment() + { + // Assert + Check.That(HandlebarsSettings.DefaultAllowedHandlebarsHelpers).Not.Contains(Category.Environment); + } +} From f5d53453e569384efcb704a6ac473a73916e4a66 Mon Sep 17 00:00:00 2001 From: Stef Heyenrath Date: Mon, 5 Jan 2026 21:34:11 +0100 Subject: [PATCH 6/6] 1.23.0 --- CHANGELOG.md | 6 ++++++ Directory.Build.props | 2 +- Generate-ReleaseNotes.cmd | 2 +- PackageReleaseNotes.txt | 8 +++++--- .../Settings/HandlebarsSettingsTests.cs | 18 ++++++++++-------- 5 files changed, 23 insertions(+), 13 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fe2640b8..42ab62e7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,9 @@ +# 1.23.0 (05 January 2026) +- [#1414](https://github.com/wiremock/WireMock.Net/pull/1414) - Pass the parameter matchOperator in Request.WithPath to its inner calls [bug] contributed by [gbamqzkdyg](https://github.com/gbamqzkdyg) +- [#1416](https://github.com/wiremock/WireMock.Net/pull/1416) - Fix: Pass AllowedHandlebarsHelpers configuration to Handlebars.Net.Helpers library contributed by [samlatham](https://github.com/samlatham) +- [#1413](https://github.com/wiremock/WireMock.Net/issues/1413) - Parameter `matchOperator` is not respected in the method Request.WithPath [bug] +- [#1415](https://github.com/wiremock/WireMock.Net/issues/1415) - HandlebarsSettings AllowedHandlebarsHelpers Configuration Not Applied [bug] + # 1.22.0 (02 January 2026) - [#1412](https://github.com/wiremock/WireMock.Net/pull/1412) - chore(testcontainers): bump up Testcontainers to version 4.10.0 [feature] contributed by [vhatsura](https://github.com/vhatsura) - [#1411](https://github.com/wiremock/WireMock.Net/issues/1411) - WireMock.Net.Testcontainers isn't compatible with Testcontainers 4.10.0 [bug] diff --git a/Directory.Build.props b/Directory.Build.props index 51a840c4..305a7415 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -4,7 +4,7 @@ - 1.22.0 + 1.23.0 WireMock.Net-Logo.png https://github.com/wiremock/WireMock.Net Apache-2.0 diff --git a/Generate-ReleaseNotes.cmd b/Generate-ReleaseNotes.cmd index 5c9e488c..90e00c82 100644 --- a/Generate-ReleaseNotes.cmd +++ b/Generate-ReleaseNotes.cmd @@ -1,6 +1,6 @@ rem https://github.com/StefH/GitHubReleaseNotes -SET version=1.22.0 +SET version=1.23.0 GitHubReleaseNotes --output CHANGELOG.md --skip-empty-releases --exclude-labels wontfix test question invalid doc duplicate example environment --version %version% --token %GH_TOKEN% diff --git a/PackageReleaseNotes.txt b/PackageReleaseNotes.txt index 83140fb9..8d7293e0 100644 --- a/PackageReleaseNotes.txt +++ b/PackageReleaseNotes.txt @@ -1,5 +1,7 @@ -# 1.22.0 (02 January 2026) -- #1412 chore(testcontainers): bump up Testcontainers to version 4.10.0 [feature] -- #1411 WireMock.Net.Testcontainers isn't compatible with Testcontainers 4.10.0 [bug] +# 1.23.0 (05 January 2026) +- #1414 Pass the parameter matchOperator in Request.WithPath to its inner calls [bug] +- #1416 Fix: Pass AllowedHandlebarsHelpers configuration to Handlebars.Net.Helpers library +- #1413 Parameter `matchOperator` is not respected in the method Request.WithPath [bug] +- #1415 HandlebarsSettings AllowedHandlebarsHelpers Configuration Not Applied [bug] The full release notes can be found here: https://github.com/wiremock/WireMock.Net/blob/master/CHANGELOG.md \ No newline at end of file diff --git a/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs index ab27c4c7..1655dd68 100644 --- a/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs +++ b/test/WireMock.Net.Tests/Settings/HandlebarsSettingsTests.cs @@ -7,7 +7,6 @@ using FluentAssertions; using HandlebarsDotNet; using HandlebarsDotNet.Helpers.Enums; using Moq; -using NFluent; using WireMock.Handlers; using WireMock.Models; using WireMock.ResponseBuilders; @@ -50,7 +49,7 @@ public class HandlebarsSettingsTests Func action = () => responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, _settings); // Assert - action.Should().ThrowAsync(); + await action.Should().ThrowAsync(); } [Fact] @@ -63,7 +62,7 @@ public class HandlebarsSettingsTests HandlebarsSettings = new HandlebarsSettings { AllowedHandlebarsHelpers = HandlebarsSettings.DefaultAllowedHandlebarsHelpers - .Concat(new[] { Category.Environment }) + .Concat([Category.Environment]) .ToArray() } }; @@ -78,14 +77,17 @@ public class HandlebarsSettingsTests var response = await responseBuilder.ProvideResponseAsync(_mappingMock.Object, request, settingsWithEnv).ConfigureAwait(false); // Assert - Check.That(response.Message.BodyData.BodyAsString).Not.Contains("{{Environment.GetEnvironmentVariable"); - Check.That(response.Message.BodyData.BodyAsString).StartsWith("User: "); + response.Message?.BodyData?.BodyAsString.Should().NotContain("{{Environment.GetEnvironmentVariable"); + response.Message?.BodyData?.BodyAsString.Should().StartWith("User: "); } [Fact] - public void DefaultAllowedHandlebarsHelpers_Should_Not_Include_Environment() + public void DefaultAllowedHandlebarsHelpers_Should_Not_Include_EnvironmentAndDynamicLinq() { // Assert - Check.That(HandlebarsSettings.DefaultAllowedHandlebarsHelpers).Not.Contains(Category.Environment); + HandlebarsSettings.DefaultAllowedHandlebarsHelpers.Should() + .NotContain(Category.Environment) + .And + .NotContain(Category.DynamicLinq); } -} +} \ No newline at end of file