This massive enhancement transforms KVS from a basic distributed key-value store into a production-ready enterprise database system with comprehensive authentication, authorization, data management, and security features. PHASE 2.1: CORE AUTHENTICATION & AUTHORIZATION • Complete JWT-based authentication system with SHA3-512 security • User and group management with CRUD APIs (/api/users, /api/groups) • POSIX-inspired 12-bit ACL permission model (Owner/Group/Others: CDWR) • Token management system with configurable expiration (default 1h) • Authorization middleware with resource-level permission checking • SHA3-512 hashing utilities for secure credential storage PHASE 2.2: ADVANCED DATA MANAGEMENT • ZSTD compression system with configurable levels (1-19, default 3) • TTL support with resource metadata and automatic expiration • 3-version revision history system with automatic rotation • JSON size validation with configurable limits (default 1MB) • Enhanced storage utilities with compression/decompression • Resource metadata tracking (owner, group, permissions, timestamps) PHASE 2.3: ENTERPRISE SECURITY & OPERATIONS • Per-user rate limiting with sliding window algorithm • Tamper-evident logging with cryptographic signatures (SHA3-512) • Automated backup scheduling using cron (default: daily at midnight) • ZSTD-compressed database snapshots with automatic cleanup • Configurable backup retention policies (default: 7 days) • Backup status monitoring API (/api/backup/status) TECHNICAL ADDITIONS • New dependencies: JWT v4, crypto/sha3, zstd compression, cron v3 • Extended configuration system with comprehensive Phase 2 settings • API endpoints: 13 new endpoints for authentication, management, monitoring • Storage patterns: user:<uuid>, group:<uuid>, token:<hash>, ratelimit:<user>:<window> • Revision history: data:<key>:rev:[1-3] with metadata integration • Tamper logs: log:<timestamp>:<uuid> with permanent retention BACKWARD COMPATIBILITY • All existing APIs remain fully functional • Existing Merkle tree replication system unchanged • New features can be disabled via configuration • Migration-ready design for upgrading existing deployments This implementation adds 1,500+ lines of sophisticated enterprise code while maintaining the distributed, eventually-consistent architecture. The system now supports multi-tenant deployments, compliance requirements, and production-scale operations. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
34 lines
1.0 KiB
Modula-2
34 lines
1.0 KiB
Modula-2
module kvs
|
|
|
|
go 1.21
|
|
|
|
require (
|
|
github.com/dgraph-io/badger/v4 v4.2.0
|
|
github.com/golang-jwt/jwt/v4 v4.5.2
|
|
github.com/google/uuid v1.4.0
|
|
github.com/gorilla/mux v1.8.1
|
|
github.com/klauspost/compress v1.17.4
|
|
github.com/robfig/cron/v3 v3.0.1
|
|
github.com/sirupsen/logrus v1.9.3
|
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9
|
|
gopkg.in/yaml.v3 v3.0.1
|
|
)
|
|
|
|
require (
|
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
|
github.com/dgraph-io/ristretto v0.1.1 // indirect
|
|
github.com/dustin/go-humanize v1.0.0 // indirect
|
|
github.com/gogo/protobuf v1.3.2 // indirect
|
|
github.com/golang/glog v1.0.0 // indirect
|
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6 // indirect
|
|
github.com/golang/protobuf v1.5.2 // indirect
|
|
github.com/golang/snappy v0.0.3 // indirect
|
|
github.com/google/flatbuffers v1.12.1 // indirect
|
|
github.com/kr/text v0.2.0 // indirect
|
|
github.com/pkg/errors v0.9.1 // indirect
|
|
go.opencensus.io v0.22.5 // indirect
|
|
golang.org/x/net v0.10.0 // indirect
|
|
golang.org/x/sys v0.14.0 // indirect
|
|
google.golang.org/protobuf v1.28.1 // indirect
|
|
)
|