Skip to main content

Module operations

Module operations 

Source
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§

CommitOptions
Options for committing a new version
CommitResult
Result of a successful commit operation
FileInfo
Complete file information for inspection
InitOptions
Options for initializing a new AION file
InitResult
Result of file initialization
SignatureInfo
Information about a signature in the file
VerificationReport
Detailed verification report for an AION file
VersionInfo
Information about a version in the file

Enums§

TemporalWarning
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-unregistered escape 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