tiefrun
v1.0.0
Published
MicroRapids API Runtime - executable OpenAPI specifications
Maintainers
Readme
MicroRapids API Runtime
High-performance API runtime built with Rust for executing OpenAPI specifications.
✨ Features
- 🚀 High-performance request processing with Rust
- 🔒 Built-in security policies and prompt injection detection
- 📊 Rate limiting and throttling
- 🌐 Multi-protocol support (REST, GraphQL coming soon)
- 🔐 OAuth2 authentication (GitHub, Google, Microsoft, etc.)
- 🤖 MCP Agent for AI integration
- 📦 Multi-platform - Available everywhere
🚀 Quick Start
NPM (Recommended for CLI)
npm install -g tiefrun
tiefrun --helpDocker
docker pull ghcr.io/microrapids/api-runtime:latest
docker run -p 8080:8080 ghcr.io/microrapids/api-runtime:latestPython
pip install tiefrunimport tiefrun
client = tiefrun.Client("api.yaml")
response = client.execute("getPetById", {"id": 123})Rust
# Cargo.toml
[dependencies]
tiefrun = "0.1.6"Or install CLI directly:
cargo install tiefrunDirect Binary Download
# Linux/macOS
curl -L https://github.com/microrapids/api-runtime/releases/latest/download/tiefrun-$(uname -s)-$(uname -m) -o tiefrun
chmod +x tiefrun
sudo mv tiefrun /usr/local/bin/
# Windows
# Download from https://github.com/microrapids/api-runtime/releases📋 Basic Usage
CLI Commands
# Initialize a new API project
tiefrun init my-api
# Run an API operation
tiefrun run api.yaml --operation getPetById --data '{"id": 1}'
# Validate OpenAPI specification
tiefrun validate spec.yaml
# Generate SDK
tiefrun gen sdk --language typescript --spec api.yaml
# Start MCP Agent server
tiefrun agent start
# Explore API interactively
tiefrun explore api.yamlUsing with Node.js
As a Library (WebAssembly)
npm install tiefrun-wasmimport init, { Client } from 'tiefrun-wasm';
await init();
const client = new Client('api.yaml');
const response = await client.execute('getPetById', { id: 1 });SDK Package (Coming Soon)
// Coming soon: tiefrun-node package
const Tiefrun = require('tiefrun-node');
const client = new Tiefrun.Client('api.yaml');
const response = await client.execute('getPetById', { id: 1 });Using with Docker
# Run with local spec file
docker run -v $(pwd):/app -p 8080:8080 ghcr.io/microrapids/api-runtime:latest \
tiefrun run /app/api.yaml
# Start MCP agent
docker run -p 3000:3000 ghcr.io/microrapids/api-runtime:latest \
tiefrun-agent start🏗️ Architecture
tiefrun/
├── CLI Tool # Command-line interface
├── Runtime Engine # Core Rust execution engine
├── MCP Agent # Model Context Protocol server
├── Security Layer # Rate limiting, auth, policies
└── SDK Generator # Multi-language SDK generation🔧 Advanced Features
OAuth2 Authentication
# Login with OAuth2 provider
tiefrun auth login github
tiefrun auth login google --client-id YOUR_CLIENT_ID
# Use authenticated requests
tiefrun run api.yaml --operation createRepo --auth-profile githubCollections & Testing
# Run API collections
tiefrun collection run my-collection.yaml
# Run as tests
tiefrun collection test my-tests.yaml --output junitSecurity Policies
# policy.yaml
rules:
- name: no-delete-operations
pattern: "DELETE /api/*"
action: deny
- name: rate-limit
pattern: "*"
rateLimit:
requests: 100
window: 60stiefrun run api.yaml --policy policy.yaml📦 Package Ecosystem
| Package | Description | Install |
|---------|-------------|---------|
| tiefrun | CLI tool & runtime | npm install -g tiefrun |
| tiefrun | Python bindings | pip install tiefrun |
| tiefrun | Rust crate | cargo install tiefrun |
| tiefrun-wasm | WebAssembly (coming soon) | npm install tiefrun-wasm |
| tiefrun-node | Node.js SDK (coming soon) | npm install tiefrun-node |
🔒 Security Features
- Prompt Injection Detection: AI-safety for LLM integrations
- Rate Limiting: Token bucket algorithm with burst control
- Request Validation: Schema validation against OpenAPI spec
- Authentication: OAuth2, API Key, Basic Auth support
- Policy Engine: Flexible security rules
- Secret Redaction: Automatic sensitive data masking
🧪 Testing
# Run tests
cargo test
# Run with coverage
cargo tarpaulin --out Html
# Run integration tests
./tests/run_all_tests.sh📚 Documentation
🤝 Contributing
We welcome contributions! Please see our Contributing Guide for details.
# Fork and clone
git clone https://github.com/YOUR_USERNAME/api-runtime.git
# Create feature branch
git checkout -b feature/amazing-feature
# Make changes and test
cargo test
cargo fmt
cargo clippy
# Commit with conventional commits
git commit -m "feat: add amazing feature"
# Push and create PR
git push origin feature/amazing-feature🏆 Benchmarks
| Operation | Tiefrun | Postman | Insomnia | |-----------|---------|---------|----------| | Startup | 50ms | 2s | 1.5s | | First Request | 15ms | 200ms | 150ms | | Throughput | 10K req/s | 1K req/s | 800 req/s | | Memory | 25MB | 300MB | 250MB |
*Benchmarked on M1 MacBook Pro with local API server
🗺️ Roadmap
- [x] CLI tool
- [x] OpenAPI 3.0 support
- [x] OAuth2 authentication
- [x] MCP Agent
- [x] NPM package
- [x] Python bindings
- [ ] WebAssembly support
- [ ] GraphQL support
- [ ] OpenAPI 3.1 support
- [ ] GUI application
- [ ] Cloud platform
📄 License
MIT License - see LICENSE file for details.
🔗 Links
- NPM: https://www.npmjs.com/package/tiefrun
- PyPI: https://pypi.org/project/tiefrun
- GitHub: https://github.com/microrapids/api-runtime
- Docker Hub: https://hub.docker.com/r/microrapids/tiefrun
- Documentation: https://docs.microrapids.com (coming soon)
💖 Sponsors
Special thanks to our sponsors and contributors who make this project possible.
Built with ❤️ using Rust | Star ⭐ us on GitHub
