Documentation
¶
Overview ¶
Package server provides the REST API server for privacy-preserving vector search.
Architecture (simplified for local deployment):
- Client authenticates and gets credentials (centroids, AES key)
- Client does HE scoring LOCALLY (no query leaves client!)
- Client requests blobs from selected clusters + decoys
- Server returns encrypted blobs (doesn't know which are real vs decoy)
- Client decrypts and scores locally
This maintains privacy because:
- Query NEVER leaves the client - all HE ops are local
- Cluster selection is based on locally decrypted HE scores
- Blob access is hidden via decoy requests
- Final scoring is client-side with AES-decrypted vectors
Note: This is simpler than having the server do HE operations. For a full production deployment, you might want server-side HE to avoid sending centroids to client, but that requires more complex key management (Galois keys transfer, etc.)
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
// Address to listen on (e.g., ":8080")
Address string
// Read/write timeouts
ReadTimeout time.Duration
WriteTimeout time.Duration
}
Config holds server configuration.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns sensible defaults for local development.
type GetBucketsResponse ¶
type GetBucketsResponse struct {
Blobs []BlobData `json:"blobs"`
}
Get buckets handler
type LoginRequest ¶
type LoginRequest struct {
UserID string `json:"user_id"`
EnterpriseID string `json:"enterprise_id"`
Password string `json:"password"`
}
Login request/response
type LoginResponse ¶
type RefreshRequest ¶
type RefreshRequest struct {
Token string `json:"token"`
}
Refresh token handler
type RefreshResponse ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server handles REST API requests for private vector search.
func New ¶
func New(cfg Config, blobStore blob.Store, authService *auth.Service, enterpriseStore enterprise.Store) *Server
New creates a new server instance.