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 config::AuthSection;
pub use config::LogVerbosityWire;
pub use config::LoggingSection;
pub use config::MetricsSection;
pub use config::NetConfig;
pub use config::NetSection;
pub use config::RateLimitSection;
pub use config::TlsSection;
pub use error::NetError;
pub use error::NetResult;
pub use logging_layer::LogVerbosity;
pub use logging_layer::LoggingLayer;
pub use logging_layer::LoggingService;
pub use metrics_layer::NetMetrics;
pub use metrics_layer::spawn_metrics_server;
pub use server::AqlServerBuilder;
pub use server::AqlServiceImpl;
pub use server_types::StreamConfig;
pub use tls_acceptor::LiveTlsAcceptor;
pub use tls_acceptor::TlsCredsRef;
pub use tls_acceptor::build_rustls_config;
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
config
TOML-based configuration for crate::server::AqlServerBuilder.
convert
Conversions between protocol buffer types and core types
error
Error types for the network layer
grpc_service
gRPC service bridge implementation
logging_layer
Request/response logging middleware for the AmateRS network layer.
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
server_admin
Admin command handler for AmateRS network layer.
server_builder
Builder for crate::server::AqlServiceImpl.
server_types
Shared types for the AmateRS gRPC server implementation.
tls
TLS certificate management for AmateRS networking layer
tls_acceptor
Live-rotating TLS acceptor.
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