opensearch-api-0.1.0 is not a library.
opensearch-api
High-performance REST API gateway for OpenSearch with enterprise-grade security, observability, and multi-tenant support.
Features
- 🚀 High Performance - Built with Rust and Axum for maximum throughput
- 🔐 Secure by Default - API key authentication, rate limiting, and audit logging
- 📊 Full Observability - Detailed metrics, structured logging, and performance tracking
- 🏢 Multi-tenant Ready - Complete tenant isolation with configurable access controls
- 🔄 RESTful API - Clean REST interface for all OpenSearch operations
- 📝 Audit Logging - Complete audit trail of all API operations
- 🎯 License Management - Built-in license validation and management
- 📦 Easy Deployment - Single binary with minimal dependencies
Quick Start
Installation
# Install from crates.io (coming soon)
# Build from source
Configuration
Create a config.toml
file:
[]
= "127.0.0.1"
= 8080
[]
= "http://localhost:9200"
= "admin"
= "admin"
[]
= "X-API-Key"
= 100 # requests per minute
[]
= "info"
= "json"
Running
# Using cargo
# Using the binary
# With custom config
OPENSEARCH_API_CONFIG=./my-config.toml
API Usage
Authentication
All requests require an API key:
Index Document
Search
Bulk Operations
Advanced Features
Multi-tenancy
Configure tenant isolation in config.toml
:
[]
= true
= "X-Tenant-ID"
= true # Automatically prefix indices with tenant ID
Rate Limiting
Configure per-API key or global rate limits:
[]
= true
= 100 # requests per minute
= 10
[]
= 1000
= 50
Audit Logging
Enable comprehensive audit logging:
[]
= true
= true
= false # Set to true for debugging
= "audit-logs" # OpenSearch index for audit logs
Metrics
Prometheus-compatible metrics endpoint:
Available metrics:
opensearch_api_requests_total
- Total requests by endpointopensearch_api_request_duration_seconds
- Request latencyopensearch_api_errors_total
- Error count by typeopensearch_api_active_connections
- Current active connections
Performance
Benchmarks on a standard development machine:
- Throughput: 50,000+ requests/second
- Latency: < 1ms overhead (p99)
- Memory: ~50MB base memory usage
- Connections: 10,000+ concurrent connections
Development
Building
# Development build
# Release build with optimizations
# Run tests
# Run benchmarks
Contributing
We welcome contributions! Please see CONTRIBUTING.md for details.
- Fork the project
- Create your feature branch (
git checkout -b feature/amazing-feature
) - Commit your changes (
git commit -m 'Add amazing feature'
) - Push to the branch (
git push origin feature/amazing-feature
) - Open a Merge Request
License
This project is dual-licensed under MIT OR Apache-2.0. See LICENSE-MIT and LICENSE-APACHE for details.
Support
- Documentation: https://docs.rs/opensearch-api
- Issues: GitLab Issues
- Email: aerun@aerun.com.br
- WhatsApp: +55 31 98260-6543
Acknowledgments
Built with ❤️ by Aerun using:
- Rust - Systems programming language
- Axum - Web framework
- Tokio - Async runtime
- OpenSearch - Search and analytics engine
Roadmap
- GraphQL API support
- WebSocket streaming
- Built-in caching layer
- Kubernetes operator
- Web UI dashboard
- SDK for multiple languages