Repository navigation
Conversation
krishicks
added this pull request to stack #4780
October 20, 2026 23:48
5 of 6 tasks
TaylorMutch
previously approved these changes
Oct 21, 2026
TaylorMutch
left a comment
Collaborator
There was a problem hiding this comment.
Reviewed the complete incremental diff at 1798f48 against #4777. No actionable findings. Shared capture and principal fixtures preserve the original values and assertions while strengthening OCSF schema and finding validation. Required CI gates pass. Validation relied on static review and CI; no local tests run.
krishicks
force-pushed
the
test/2912-audit-test-helpers/krishicks
branch
from
October 21, 2026 14:45
1798f48 to
1ea70a2
Compare
Base automatically changed from
refactor/2912-audit-helpers/krishicks
to
main
October 21, 2026 16:12
Tests for the gateway's OCSF events each carried their own copy of the same fixtures: converting captured events to JSON, the request ID and peer address, running a handler inside a routed request, and checking event shapes. They now share them: - OcsfCapture::json_events returns captured events as their exported JSON. - auth::audit::test_support holds the test request origin, audited() for running a handler as a routed request, and assertions for authentication failures, logons, denials, boundary findings, the request origin, and redacted secrets. The event assertions also check each event against its OCSF class schema, which the handler tests did not do before. - auth::principal::test_support builds the OIDC user and gateway-JWT sandbox principals that several test modules defined identically. Refs #2912 Signed-off-by: Kris Hicks <khicks@nvidia.com>
krishicks
force-pushed
the
test/2912-audit-test-helpers/krishicks
branch
from
October 21, 2026 16:12
1ea70a2 to
3928505
Compare
TaylorMutch
approved these changes
Oct 21, 2026
This branch has not been deployed
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.
Summary
Tests for the gateway's OCSF events now share their fixtures instead of each module carrying a copy:
The shared assertions also validate each event against its OCSF class schema, and every boundary finding against its severity and alert flag. Handler tests in
auth_rpcandsandboxdid not check these before; all of them pass.Related Issue
Refs #2912
This is a follow-up for #2912 and does not close it. Stacked on #4777.
Changes
OcsfCapture::json_eventsinopenshell-ocsf's test support returns captured events as their exported JSON, replacing ten copies of the conversion.auth::audit::test_support(test-only): the test request origin (REQUEST_ID,PEER,origin()),audited()for running a handler inside a routed request, andassert_authentication_failure,assert_logon,assert_denial,assert_boundary_finding,assert_origin, andassert_redacted.auth::principal::test_support(test-only): the OIDC user and gateway-JWT sandbox principals that several modules defined identically.multiplex,auth_rpc,sandbox,policy,workspace_authz,guard,authenticator, and mutation replay. Tests outside the feat(auth): emit structured gateway authentication and authorization events #2912 work keep their own fixtures.Testing
cargo nextest run -p openshell-server -p openshell-ocsf --features openshell-ocsf/test-support: all 2,613 tests pass.cargo clippy -p openshell-server --all-targets -- -D warningsChecklist