Summary
Create a flexible, trait-based storage backend abstraction that supports multiple storage implementations and is fully compatible with WASM32-WASIP2 targets, incorporating patterns from loriot-websocket-mcp.
Background
Current storage in mcp-auth is tightly coupled to file system operations and platform-specific code. We need:
- Trait-based abstraction for different storage backends
- WASM-compatible implementations using WASI interfaces
- Integration of persistence patterns from loriot-websocket-mcp
- Support for both synchronous and asynchronous operations
Implementation Tasks
Core Storage Traits
Storage Backend Implementations
Persistence Patterns (from loriot-websocket-mcp)
WASM Compatibility Layer
Configuration System
Security & Encryption
Integration Points
MCP Auth Integration
Caching Integration
Configuration Examples
// Native file storage
StorageConfig::File {
path: "auth.db".into(),
encryption: EncryptionConfig::AES256,
backup_count: 3,
}
// WASM memory storage
StorageConfig::Memory {
max_entries: 1000,
persistence: None,
}
// JSON Lines with two-tier management
StorageConfig::JsonLines {
file_path: "data.jsonl".into(),
memory_limit_entries: 2000,
sync_interval: Duration::from_secs(60),
deduplication: DeduplicationStrategy::TimestampBased,
}
Acceptance Criteria
Related Issues
References
Summary
Create a flexible, trait-based storage backend abstraction that supports multiple storage implementations and is fully compatible with WASM32-WASIP2 targets, incorporating patterns from loriot-websocket-mcp.
Background
Current storage in
mcp-authis tightly coupled to file system operations and platform-specific code. We need:Implementation Tasks
Core Storage Traits
StorageBackendtrait with async operationsPersistenceStrategytrait for different storage patternsDataFormattrait for serialization (JSON, JSONL, binary)StorageMetricstrait for monitoring and health checksStorage Backend Implementations
Persistence Patterns (from loriot-websocket-mcp)
WASM Compatibility Layer
Configuration System
Security & Encryption
Integration Points
MCP Auth Integration
mcp-authstorage to use new traitsCaching Integration
Configuration Examples
Acceptance Criteria
Related Issues
References