Add full monorepo: virtual-banker, backend, frontend, docs, scripts, deployment

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
defiQUG
2026-02-10 11:32:49 -08:00
parent aafcd913c2
commit 88bc76da91
815 changed files with 125522 additions and 264 deletions

38
backend/security/kms.go Normal file
View File

@@ -0,0 +1,38 @@
package security
import (
"context"
)
// KMS handles key management
type KMS struct {
provider KMSProvider
}
// NewKMS creates a new KMS handler
func NewKMS(provider KMSProvider) *KMS {
return &KMS{provider: provider}
}
// KMSProvider interface for key management
type KMSProvider interface {
Encrypt(ctx context.Context, keyID string, data []byte) ([]byte, error)
Decrypt(ctx context.Context, keyID string, encrypted []byte) ([]byte, error)
Sign(ctx context.Context, keyID string, data []byte) ([]byte, error)
}
// Encrypt encrypts data using KMS
func (k *KMS) Encrypt(ctx context.Context, keyID string, data []byte) ([]byte, error) {
return k.provider.Encrypt(ctx, keyID, data)
}
// Decrypt decrypts data using KMS
func (k *KMS) Decrypt(ctx context.Context, keyID string, encrypted []byte) ([]byte, error) {
return k.provider.Decrypt(ctx, keyID, encrypted)
}
// Sign signs data using KMS
func (k *KMS) Sign(ctx context.Context, keyID string, data []byte) ([]byte, error) {
return k.provider.Sign(ctx, keyID, data)
}