Skip to main content

Crate amaters_net

Crate amaters_net 

Source
Expand description

Network layer for AmateRS (Musubi - The Knot)

This crate provides the gRPC-based networking layer for AmateRS, implementing secure communication over QUIC with mTLS.

§Features

  • gRPC service for AQL queries
  • Request/response handling with streaming support
  • Error handling and retry strategies
  • Connection state management

§Architecture

The networking layer consists of:

  • Protocol definitions (.proto files)
  • Server implementation (gRPC service)
  • Client implementation (connection management)
  • Error types and conversions

§Example

use amaters_net::client::AqlClient;
use amaters_core::{Key, CipherBlob};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    let client = AqlClient::connect("http://localhost:50051").await?;

    let key = Key::from_str("my_key");
    let value = CipherBlob::new(vec![1, 2, 3]);

    client.set("my_collection", key, value).await?;

    Ok(())
}

Re-exports§

pub use error::NetError;
pub use error::NetResult;
pub use server::AqlServerBuilder;
pub use server::AqlServiceImpl;
pub use server::StreamConfig;
pub use mtls::CrlRevocationChecker;
pub use mtls::HandshakeResult;
pub use mtls::MtlsClient;
pub use mtls::MtlsClientVerifier;
pub use mtls::MtlsConfigBuilder;
pub use mtls::MtlsServer;
pub use mtls::MtlsServerVerifier;
pub use mtls::OcspRevocationChecker;
pub use mtls::Principal;
pub use mtls::PrincipalMapper;
pub use mtls::RevocationChecker;
pub use mtls::RevocationStatus;
pub use tls::CertificateFormat;
pub use tls::CertificateInfo;
pub use tls::CertificateLoader;
pub use tls::CertificateStore;
pub use tls::HotReloadableCertificates;
pub use tls::PrivateKeyLoader;
pub use tls::PrivateKeyType;
pub use tls::SelfSignedGenerator;

Modules§

auth
Authentication middleware for AmateRS network layer.
balancer
Load balancing strategies for distributing requests across endpoints
circuit_breaker
Circuit breaker pattern implementation for fault tolerance
client
gRPC client implementation with connection pooling
convert
Conversions between protocol buffer types and core types
error
Error types for the network layer
grpc_service
gRPC service bridge implementation
metrics_layer
Metrics middleware for the AmateRS network layer.
mtls
Mutual TLS (mTLS) authentication for AmateRS networking layer
ocsp
OCSP (Online Certificate Status Protocol) revocation checking
pool
Connection pool implementation for managing reusable connections
proto
rate_limiter
Token bucket rate limiter for the network/server layer
server
gRPC server implementation for AmateRS AQL Service
tls
TLS certificate management for AmateRS networking layer
tls_crypto
Pure Rust cryptographic primitives for encrypted PEM key handling
tracing_middleware
Distributed tracing instrumentation for AmateRS network and server layers

Constants§

PROTOCOL_VERSION
Protocol version
VERSION
Library version