WIP: Audit Trails#161
Open
itsyaasir wants to merge 274 commits into
Open
Conversation
itsyaasir
commented
Jan 5, 2026
Also split of the role and capability management from the AT main module to allow reuse with other products.
…extended # Conflicts: # audit-trail-move/sources/audit_trail.move # audit-trail-move/sources/capability.move # audit-trail-move/tests/capability_tests.move # audit-trail-move/tests/create_audit_trail_tests.move # audit-trail-move/tests/role_tests.move # audit-trail-move/tests/test_utils.move
- Changed capability permission checks in `has_capability_permission` and `destroy_capability` functions to use `cap.trail_id()` instead of `cap.id()`. - Improved test cases for capability creation, revocation, and metadata updates, ensuring proper permission handling and error scenarios. - Added new tests for locking configurations and metadata management, enhancing overall test coverage for the audit trail functionality.
- Reformatted function calls in locking and role tests for better readability by aligning parameters across multiple lines. - Enhanced clarity in test cases related to locking configurations and role permissions, ensuring easier maintenance and understanding of the test logic.
- Fixed typos in comments related to the `Permission` enum and `admin_permissions` function for clarity. - Enhanced documentation to better reflect the intended roles and permissions within the audit trail system.
…ns to use non-optional name field; adjust tests for consistency
chore: function refactor, adding of emitting events & improving test coverage
chore: make `ImmutableMetadata` optional
…extended # Conflicts: # audit-trail-move/sources/audit_trail.move # audit-trail-move/tests/capability_tests.move
fix: creation of roles & make the sequence and record number clear
chore: simplify `TfComponent` Package resolution
chore: enhance audit trail API with return values
chore: update readme docs for notarization & at
…-tag Skip unauthorized tagged records in batch deletes
…omments chore: refactor and rename functions
# Conflicts: # Cargo.toml # bindings/wasm/notarization_wasm/Cargo.toml
…lated documentation
Split product-specific workflow publishing and docs uploads
) - Rewrite of the `delete_records_batch()` and `is_record_locked()` functions to only evaluate against the existing records once when the transaction begins (has been evaluated for each deleted record before) - `window_count_based(0)` is now forbidden in favor of using `window_none()` instead to prevent silently misconfigured trails. - Client-relevant asserts in Move `locking` module are validated in the AT Rust libraries public surface now The Move locking module has two client-relevant asserts, now being also validated in the Rust crate: 1. ECountWindowMustBePositive — window_count_based(0) is rejected. 2. EUntilDestroyedNotSupportedForDeleteTrail — TimeLock::UntilDestroyed cannot be used as the trail-level delete lock (but it is valid for write_lock). The tf_components::timelock module also asserts EPastTimestamp on unlock_at/unlock_at_ms when the timestamp is in the past. This is not mirrored in the Rust crate because it depends on the on-chain clock at execution time, so a client-side check would either be redundant (if the user picks a far-future timestamp) or wrong (if the transaction is built well before submission and a borderline timestamp lapses). --------- Co-authored-by: Yasir <yasir@shariff.dev>
Fix audit-trail Move security audit findings
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.
Description of change
Links to any relevant issues
Type of change
How the change has been tested
Change checklist