fix(ApplicationLogs): reject invalid getapplicationlog triggerType - #1108
Merged
shargon merged 4 commits intoSep 8, 2026
Merged
Conversation
Docs say an invalid trigger throws. Enum.TryParse failing skipped the filter, so callers got unfiltered executions. Numeric strings such as 16 also parsed as undefined enum values.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master-n3 #1108 +/- ##
=============================================
- Coverage 51.48% 51.42% -0.07%
=============================================
Files 284 284
Lines 16699 16703 +4
Branches 2148 2149 +1
=============================================
- Hits 8598 8590 -8
- Misses 7527 7541 +14
+ Partials 574 572 -2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
shargon
reviewed
Aug 31, 2026
| if (!string.IsNullOrEmpty(triggerType)) | ||
| { | ||
| if (!Enum.TryParse(triggerType, true, out TriggerType trigger) | ||
| || !Enum.GetNames<TriggerType>().Any(n => n.Equals(triggerType, StringComparison.OrdinalIgnoreCase))) |
Member
There was a problem hiding this comment.
Seems not enough. .NET’s Enum.TryParse accepts numeric strings as well as names. So values like "16" (undefined) or "64" (Application =0x40) both succeed, even though they aren’t named TriggerType values.
ajara87
approved these changes
Aug 31, 2026
shargon
approved these changes
Sep 8, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Docs say an invalid trigger throws.
Enum.TryParsefailing skipped the filter, so callers got unfiltered executions. Numeric strings such as16also parsed as undefined enum values.Require a named
TriggerTypeor returnInvalidParams.Independent of other PRs.