Expand description
Core operations for AION v2 files
This module implements the high-level operations for working with AION files:
- Commit: Create a new version with updated rules
All operations follow the security model defined in RFC-0001:
- Signature chain verification before modifications
- Cryptographic signing of all new versions
- Atomic file writes to prevent corruption
§Usage Example
use aion_context::operations::{commit_version, CommitOptions};
use aion_context::crypto::SigningKey;
use aion_context::types::AuthorId;
use std::path::Path;
let signing_key = SigningKey::generate();
let options = CommitOptions {
author_id: AuthorId::new(50001),
signing_key: &signing_key,
message: "Updated fraud detection rules",
timestamp: None, // Use current time
};
// Commit new rules to existing file
// let result = commit_version(
// Path::new("rules.aion"),
// b"new rules content",
// &options,
// );Structs§
- Commit
Options - Options for committing a new version
- Commit
Result - Result of a successful commit operation
- File
Info - Complete file information for inspection
- Init
Options - Options for initializing a new AION file
- Init
Result - Result of file initialization
- Signature
Info - Information about a signature in the file
- Verification
Report - Detailed verification report for an AION file
- Version
Info - Information about a version in the file
Enums§
- Temporal
Warning - Temporal warning types for timestamp validation (RFC-0005)
Functions§
- commit_
version - Commit a new version with updated rules to an existing AION file
- commit_
version_ force_ unregistered - Commit bypassing the registry authz pre-check (issue #25
--force-unregisteredescape hatch). - decrypt_
rules - Decrypt rules content using file-specific key derivation
- init_
file - Initialize a new AION file with genesis version
- show_
current_ rules - Get the current (latest) rules content from an AION file
- show_
file_ info - Get complete file information including versions and signatures
- show_
signatures - Get signature information with verification status
- show_
version_ history - Get version history for all versions in the file
- verify_
file - Verify the integrity and authenticity of an AION file