1
0
mirror of https://github.com/rancher/steve.git synced 2025-09-07 18:31:13 +00:00

Respect shouldEncrypt configuration when storing events (#725)

This commit is contained in:
Tom Lebreux
2025-07-15 09:57:28 -04:00
committed by GitHub
parent 904e52dc11
commit 0c2c554c8c
7 changed files with 264 additions and 16 deletions

View File

@@ -49,6 +49,8 @@ type Client interface {
Upsert(tx transaction.Client, stmt *sql.Stmt, key string, obj any, shouldEncrypt bool) error
CloseStmt(closable Closable) error
NewConnection(isTemp bool) (string, error)
Encryptor() Encryptor
Decryptor() Decryptor
}
// WithTransaction runs f within a transaction.
@@ -364,6 +366,14 @@ func (c *client) Upsert(tx transaction.Client, stmt *sql.Stmt, key string, obj a
return err
}
func (c *client) Encryptor() Encryptor {
return c.encryptor
}
func (c *client) Decryptor() Decryptor {
return c.decryptor
}
// toBytes encodes an object to a byte slice
func toBytes(obj any) []byte {
var buf bytes.Buffer