Skip to content

fix(audit): Ignore audit trail attribute#1224

Open
cesarcastrocuba wants to merge 1 commit into
fullstackhero:mainfrom
cesarcastrocuba:fix/ignore-audit-trail-attribute
Open

fix(audit): Ignore audit trail attribute#1224
cesarcastrocuba wants to merge 1 commit into
fullstackhero:mainfrom
cesarcastrocuba:fix/ignore-audit-trail-attribute

Conversation

@cesarcastrocuba
Copy link
Copy Markdown
Contributor

[Fix] Implement IgnoreAuditTrail Attribute for Infrastructure Entities

Description

This Pull Request implements the [IgnoreAuditTrail] attribute to optimize the auditing system. It allows specific high-frequency or technical entities to be excluded from the audit logs, reducing database noise and improving general performance.

Changes

  • BuildingBlocks.Core: Created IgnoreAuditTrailAttribute to serve as an opt-out decorator.
  • Modules.Auditing: Updated AuditingSaveChangesInterceptor to filter and skip any entity decorated with [IgnoreAuditTrail] before publishing audit events.
  • Infrastructure Entities: Applied the attribute to:
    • OutboxMessage (Eventing)
    • InboxMessage (Eventing)
    • UserSession (Identity)

Verification

  • Build: Successfully ran dotnet build src/FSH.Framework.slnx with 0 errors.
  • Logic: Verified through temporary InMemoryDatabase unit tests (which were deleted after confirmation) that:
    • Tagged entities are correctly ignored by the interceptor.
    • Non-tagged entities continue to be audited as expected.

Technical Debt

  • Issue Bump Dapper from 2.0.78 to 2.0.90 #15 Dependency: Once the central AuditableEntitySaveChangesInterceptor is merged into develop, it should also be updated to check for this attribute to prevent populating metadata fields (CreatedOn/By, etc.) on ignored entities.

…entities

- Created [IgnoreAuditTrail] attribute in BuildingBlocks.Core.
- Updated AuditingSaveChangesInterceptor to exclude entities decorated with the attribute.
- Applied [IgnoreAuditTrail] to OutboxMessage, InboxMessage, and UserSession.
- Verified changes with temporary InMemoryDatabase unit tests (cleaned up before commit).
- Optimized audit performance by reducing noise from high-frequency infrastructure entities.
@iammukeshm iammukeshm deleted the branch fullstackhero:main May 27, 2026 06:59
@iammukeshm iammukeshm closed this May 27, 2026
@iammukeshm iammukeshm reopened this May 27, 2026
@iammukeshm iammukeshm changed the base branch from develop to main May 27, 2026 07:02
@iammukeshm
Copy link
Copy Markdown
Member

Thanks for the substantial work across these PRs 🙏

FullStackHero has moved to a major new baseline — v10 (.NET 10) — which includes a significant restructure (for example src/api/framework/** is now src/BuildingBlocks/**) and a new CI pipeline. This PR now targets main but no longer applies cleanly against it.

Could you please:

  1. Rebase your branch onto the current main and resolve conflicts,
  2. re-review your changes against the v10 layout/APIs (some files have moved or changed), and
  3. push the update so the PR is green against the new Backend CI / Frontend CI checks.

Once it's rebased and passing we'll be happy to review. Really appreciate the contributions to FullStackHero!

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.

2 participants