-
-
Notifications
You must be signed in to change notification settings - Fork 223
Add HandlebarsSettings #1271
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add HandlebarsSettings #1271
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1271 +/- ##
==========================================
+ Coverage 34.87% 36.65% +1.78%
==========================================
Files 201 228 +27
Lines 33283 41690 +8407
==========================================
+ Hits 11607 15281 +3674
- Misses 21119 25731 +4612
- Partials 557 678 +121 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR refactors and extends Handlebars integration by removing the old AllowedCustomHandlebarHelpers property and introducing a new HandlebarsSettings configuration.
- Updated test cases to use the new HandlebarsSettings.
- Refactored helper instantiation and settings parsing to support custom Handlebars helpers through HandlebarsSettings.
- Adjusted documentation and minor spelling fixes in configuration files.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs | Replaced AllowedCustomHandlebarHelpers with HandlebarsSettings in test setup. |
src/WireMock.Net/Transformers/Handlebars/WireMockHandlebarsHelpers.cs | Updated helper initialization to access HandlebarsSettings. |
src/WireMock.Net/Transformers/Handlebars/FileHelpers.cs | Changed constructor signature to accept WireMockServerSettings. |
src/WireMock.Net/Settings/WireMockServerSettingsParser.cs | Removed the old settings and added parsing for HandlebarsSettings; note potential syntax issue with array literal. |
src/WireMock.Net/Settings/* | Updated and added HandlebarsSettings and associated enums. |
README.md | Updated documentation regarding changes to Handlebars helper configuration. |
Files not reviewed (1)
- src/WireMock.Net/WireMock.Net.csproj: Language not supported
Comments suppressed due to low confidence (1)
README.md:72
- The README still refers to the old property name
AllowedCustomHandlebarHelpers
while the code now uses HandlebarsSettings. Please update the documentation to reflect the new configuration method.
To still enable this feature, you need to set the `AllowedCustomHandlebarHelpers` property to `File` in the `WireMockServerSettings` class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces a new HandlebarsSettings configuration to replace the legacy AllowedCustomHandlebarHelpers property for improved configurability and security. Key changes include updating tests and helper classes to use HandlebarsSettings, modifying configuration parsing logic, and updating documentation to reflect these changes.
Reviewed Changes
Copilot reviewed 12 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
File | Description |
---|---|
test/WireMock.Net.Tests/ResponseBuilders/ResponseWithHandlebarsFileTests.cs | Updated test initialization to use HandlebarsSettings instead of the deprecated property. |
src/WireMock.Net/Transformers/Handlebars/WireMockHandlebarsHelpers.cs | Modified conditional check to reference HandlebarsSettings for custom helper permissions. |
src/WireMock.Net/Transformers/Handlebars/FileHelpers.cs | Changed constructor signature to accept WireMockServerSettings, aligning with new settings usage. |
src/WireMock.Net/Settings/WireMockServerSettingsParser.cs | Removed legacy property parsing and added ParseHandlebarsSettings for new configuration. |
src/WireMock.Net/Settings/WireMockServerSettings.cs | Removed the AllowedCustomHandlebarHelpers property and introduced HandlebarsSettings. |
src/WireMock.Net/Settings/SimpleSettingsParser.cs | Added support for ContainsAny and GetEnumValues for improved settings parsing. |
ProxyUrlReplaceSettings.cs, ProxyAndRecordSettings.cs | Minor spelling corrections in documentation comments. |
src/WireMock.Net/Settings/HandlebarsSettings.cs | Introduced the new HandlebarsSettings class with allowed helpers configuration. |
src/WireMock.Net.Abstractions/Types/CustomHandlebarsHelpers.cs | Renamed the enum to align with the new Handlebars configuration. |
README.md | Updated documentation to detail the breaking changes and new configuration method. |
Files not reviewed (1)
- src/WireMock.Net/WireMock.Net.csproj: Language not supported
No description provided.