mtls-grpc
gRPC adapter for mTLS authentication with IP whitelisting (Work in Progress).
Overview
mtls-grpc provides gRPC (tonic) interceptors and credentials for integrating mTLS (mutual TLS) authentication and IP whitelisting into your gRPC applications. This crate is currently a work in progress and serves as a placeholder for future gRPC mTLS integration.
Current Status
⚠️ Experimental: This crate is currently a skeleton implementation. The actual gRPC mTLS integration will be added once the underlying tonic version and its API are stabilized for mTLS.
Planned Features
- gRPC Server Credentials: Configure mTLS for gRPC servers
- gRPC Client Credentials: Configure mTLS for gRPC clients
- IP Whitelist Interceptors: Validate client IP addresses in gRPC calls
- Certificate Validation: Extract and validate client certificates in gRPC metadata
Quick Start (Planned)
Add to your Cargo.toml:
[]
= "0.1.0"
= "0.1.0"
Example Server (Planned)
use Server;
use ServerCredentials;
use ConnectionValidator;
use ServerConfig;
use Path;
async
Example Client (Planned)
use Channel;
use ClientCredentials;
use ConnectionValidator;
use ClientConfig;
use Path;
async
Architecture (Planned)
Server Components
- ServerCredentials: Configures TLS for gRPC servers
- Connection Validator: Validates client certificates and IP addresses
- gRPC Interceptors: Validate requests before they reach service handlers
Client Components
- ClientCredentials: Configures TLS for gRPC clients
- Connection Validator: Validates server certificates
- gRPC Interceptors: Add client certificates to outgoing requests
Current Implementation
The current implementation provides placeholder structs that will be expanded in future releases:
// Placeholder structs - to be implemented
Roadmap
v0.1.0 (Current)
- Skeleton implementation
- Basic struct definitions
- Compilation compatibility
v0.2.0 (Planned)
- Basic tonic TLS integration
- Server and client credential configuration
- Simple certificate validation
v0.3.0 (Planned)
- IP whitelist validation in interceptors
- Metadata-based certificate extraction
- Comprehensive error handling
v1.0.0 (Planned)
- Production-ready API
- Performance optimizations
- Full documentation and examples
Contributing
Contributions are welcome! Since this crate is in early development, we particularly welcome:
- Tonic TLS integration expertise
- gRPC interceptor patterns
- Certificate extraction from gRPC metadata
Please see the main project repository for contribution guidelines.
License
licensed under:
- GNU GPL-3.0 license at your option.
Note
This crate depends on the mtls-core crate for certificate and IP validation. The actual gRPC/Tonic integration will be implemented as the underlying libraries stabilize their mTLS support.