Skip to main content

Crate coldstar_validation

Crate coldstar_validation 

Source
Expand description

Input validation and sanitization for ColdStar.

Provides security-focused validation functions ported from the Python security_validation.py module. Every validator returns Result<(), ValidationError> (or a sanitized value) so callers get structured, actionable errors.

Enums§

Platform
Target operating system for platform-specific validations.
ValidationError
Structured validation errors with context.
ValidationWarning
Optional warning returned alongside a successful validation.

Constants§

LAMPORTS_PER_SOL
Lamports per SOL.
MAX_BALANCE_SOL
Upper-bound balance in SOL (greater than total supply).
MIN_PASSWORD_LENGTH
Minimum acceptable password length.

Functions§

sanitize_filename
Sanitize a filename to prevent path traversal and injection attacks.
validate_amount_sol
Validate a transfer amount in SOL.
validate_balance_value
Validate a balance value (in SOL, as f64) is within [0, MAX_BALANCE_SOL].
validate_device_path
Validate a device path for the given platform.
validate_mount_point
Validate a mount-point path for the given platform.
validate_password_strength
Validate that a password meets ColdStar’s minimum strength requirements.
validate_rpc_url
Validate an RPC URL.
validate_solana_address
Validate a base58-encoded Solana public-key address.