Implement database handshake protocol in RPC layer
- Add ExpectedDB field to RPC Request - Server validates client's expected DB matches daemon's DB - Return clear error on mismatch with both paths - Old clients (no ExpectedDB) still work with warning - Add Path() method to storage.Storage interface - Tests verify cross-database connections rejected Prevents database pollution when client connects to wrong daemon. Amp-Thread-ID: https://ampcode.com/threads/T-c4454192-39c6-4c67-96a9-675cbfc4db92 Co-authored-by: Amp <amp@ampcode.com>
This commit is contained in:
@@ -69,6 +69,9 @@ type Storage interface {
|
||||
|
||||
// Lifecycle
|
||||
Close() error
|
||||
|
||||
// Database path (for daemon validation)
|
||||
Path() string
|
||||
}
|
||||
|
||||
// Config holds database configuration
|
||||
|
||||
Reference in New Issue
Block a user