leeca_proxmox 0.1.2

A modern, safe, and async-first SDK for interacting with Proxmox Virtual Environment servers
Documentation

Leeca Proxmox VE SDK

Rust SDK for interacting with Proxmox Virtual Environment servers

CI Status Coverage Crates.io Downloads Docs Deps License MSRV Security

A modern, safe, and async-first SDK for interacting with Proxmox Virtual Environment servers, following industry best practices and clean architecture principles.

๐Ÿ“‹ Table of Contents

โœจ Features

  • ๐Ÿ”’ Enterprise-Grade Security

    • Token-based authentication
    • Comprehensive input validation
    • Secure default configurations
    • Thread-safe operations
    • Built-in SSL/TLS support
  • ๐Ÿš€ Modern Architecture

    • Async-first design using Tokio
    • Clean Architecture principles
    • Domain-Driven Design
    • SOLID principles
    • Immutable Value Objects
  • ๐Ÿ’ช Robust Error Handling

    • Type-safe error propagation
    • Detailed error contexts
    • Stack traces for debugging
    • Custom error types
    • Validation error handling

๐Ÿš€ Getting Started

Prerequisites

  • Rust (nightly)
  • Cargo
  • Tokio runtime

Installation

cargo add leeca_proxmox

๐Ÿ“– Usage

use leeca_proxmox::{ProxmoxClient, ProxmoxResult};
use std::time::UNIX_EPOCH;

#[tokio::main]
async fn main() -> ProxmoxResult<()> {
    let mut client = ProxmoxClient::builder()
        .host("192.168.1.182")?
        .port(8006)?
        .credentials("leeca", "Leeca_proxmox1!", "pam")?
        .secure(false)
        .build()
        .await?;

    println!("\n๐Ÿ”‘ Authentication Status");
    println!("------------------------");
    println!(
        "Initial state: {}",
        if client.is_authenticated() {
            "โœ… Authenticated"
        } else {
            "โŒ Not authenticated"
        }
    );

    println!("\n๐Ÿ“ก Connecting to Proxmox...");
    client.login().await?;
    println!(
        "Connection state: {}",
        if client.is_authenticated() {
            "โœ… Authenticated"
        } else {
            "โŒ Failed"
        }
    );

    if let Some(token) = client.auth_token() {
        println!("\n๐ŸŽŸ๏ธ  Session Token");
        println!("------------------------");
        println!("Value: {}", token.value().await);
        let expires = token
            .expires_at()
            .await
            .duration_since(UNIX_EPOCH)
            .unwrap()
            .as_secs();
        println!("Expires at: {} (Unix timestamp)", expires);
    }

    if let Some(csrf) = client.csrf_token() {
        println!("\n๐Ÿ›ก๏ธ  CSRF Protection");
        println!("------------------------");
        println!("Token: {}", csrf.value().await);
        let expires = csrf
            .expires_at()
            .await
            .duration_since(UNIX_EPOCH)
            .unwrap()
            .as_secs();
        println!("Expires at: {} (Unix timestamp)", expires);
    }

    println!("\nโœจ Connection established successfully!\n");
    Ok(())
}

๐Ÿ› ๏ธ Development

# Install development dependencies
cargo install cargo-llvm-cov cargo-audit

# Run tests
cargo test --all-features

# Check code coverage
cargo llvm-cov --all-features --lcov --output-path lcov.info

# Run security audit
cargo audit

# Run linters
cargo clippy --all-targets --all-features
cargo fmt --all -- --check

๐Ÿ“Š Project Status

See our CHANGELOG for version history and ROADMAP for future plans.

๐Ÿ“š Documentation

๐Ÿ›ก๏ธ Security

See our Security Policy for reporting vulnerabilities.

๐Ÿ“„ License

Licensed under Apache License 2.0 - see the LICENSE file for details.

๐Ÿค Contributing

We welcome contributions! Please see our Contributing Guide for details.

โš–๏ธ Code of Conduct

Please read and follow our Code of Conduct.

๐Ÿ‘ฅ Community

๐Ÿ“ˆ Versioning

This project follows Semantic Versioning. See our CHANGELOG for version history.

โš ๏ธ Note: This project is in active development. APIs may change before 1.0.0 release.

๐Ÿ™ Acknowledgments

  • Proxmox VE team for their excellent API documentation
  • Rust community for their tools and crates
  • All contributors

Built with โค๏ธ by Leeca Team && Rust Community

โญ Star ยท ๐Ÿ› Report Bug ยท โœจ Request Feature ยท ๐Ÿ›ก๏ธ Security Report