Skip to content

Verify the audit hash chain before a CSV export is written - #286

Merged
karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
Lacastar2000:Fortexa01
Oct 1, 2026
Merged

karagozemin merged 2 commits into
Fortexa-stellar:mainfrom
Lacastar2000:Fortexa01

Conversation

@Lacastar2000

Copy link
Copy Markdown
Contributor

Closes #212

Summary

Makes CSV audit export use the same hash-chain verification as JSON export, ensuring invalid audit logs cannot be exported.

Changes

  • Verifies the audit chain before the CSV encoder runs.
  • Uses the same row cap and redaction rules as the JSON export.
  • Returns the verifier error with an empty CSV body when verification fails.
  • Added a fixture containing commas and quotes in a redacted field to verify correct CSV quoting.
  • Ensures valid audit chains produce one CSV row per audit event.

Tests

  • Added CSV utility coverage for quoting and redaction.
  • Added audit export coverage for valid and broken hash chains.
  • Confirms a broken chain produces no CSV body.
  • Confirms valid output matches the verifier fixture.

Verification

# Run CSV utility tests
# Run audit export tests

Scope

Only the CSV audit export verification and its test coverage are addressed. The existing hash-chain verifier is reused without changing its underlying behaviour.

@drips-wave

drips-wave Bot commented Sep 30, 2026

Copy link
Copy Markdown

@Lacastar2000 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@karagozemin
karagozemin merged commit d261294 into Fortexa-stellar:main Oct 1, 2026
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.

Verify the audit hash chain before a CSV export is written

2 participants