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:
@@ -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
|
||||
|
Reference in New Issue
Block a user