2 Commits

Author SHA1 Message Date
dde8bd04de Add cache attribution and fix broken DB session methods
- Add fetched_by_key_hash column to CacheEntry model for tracking
  which Rentcast API key originally fetched each cached response
- Fix broken self.db references in SQLiteCacheBackend methods:
  - delete() now properly creates session from SessionLocal
  - clear_pattern() fixed with proper session management
  - health_check() fixed with proper session management
- Add SQL injection protection in clear_pattern() by escaping
  LIKE wildcards (%, _) before pattern conversion
- Update proxy_to_rentcast to hash and store the client's
  Rentcast API key on cache miss
- Fix httpx test client to use ASGITransport (required for httpx 0.27+)
2026-01-18 18:09:47 -07:00
9a06e9d059 Initial implementation of RentCache FastAPI proxy server
- Complete FastAPI proxy server with all Rentcast API endpoints
- Intelligent caching with SQLite backend and Redis support
- Rate limiting and usage tracking per API key
- CLI administration tools for key and cache management
- Comprehensive models with SQLAlchemy for persistence
- Health checks and metrics endpoints
- Production-ready configuration management
- Extensive test coverage with pytest and fixtures
- Rich CLI interface with click and rich libraries
- Soft delete caching strategy for analytics
- TTL-based cache expiration with endpoint-specific durations
- CORS, compression, and security middleware
- Structured logging with JSON format
- Cost tracking and estimation for API usage
- Background task support architecture
- Docker deployment ready
- Comprehensive documentation and setup instructions
2025-09-09 14:42:51 -06:00