Skip to content

test: add unit tests for PathTraversalGuard - #69

Open
VedantMadane wants to merge 1 commit into
JVBotelho:mainfrom
VedantMadane:test/path-traversal-guard-unit-tests
Open

test: add unit tests for PathTraversalGuard#69
VedantMadane wants to merge 1 commit into
JVBotelho:mainfrom
VedantMadane:test/path-traversal-guard-unit-tests

Conversation

@VedantMadane

Copy link
Copy Markdown

Summary

  • Add Rasp.Core.Tests/Guard/PathTraversalGuardTests.cs covering AnalyzePath in isolation.
  • Covers audit mode (alert, no throw), block mode (alert then RaspSecurityException), no-threat, and null/whitespace no-op (no metrics).

Pattern

Follows SqlSinkGuardTaintTests: RaspAlertBus, Options.Create(new RaspOptions { ... }), NullLogger<T>.Instance, and a recording IRaspMetrics fake for the no-op branch.

Test plan

  • CI / dotnet test filter PathTraversalGuardTests

Fixes #44

Cover audit/block threat paths, safe paths, and null/whitespace no-op without going through runtime patching integration.

Fixes JVBotelho#44

Signed-off-by: Vedant Madane <6527493+VedantMadane@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add unit tests for PathTraversalGuard

1 participant