When a tenant setting is updated via PUT /tenants/kv/{key} (e.g.,
retrieval-config, parser-engine-config), the GORM AfterFind-decrypted
plaintext api_key was silently written back to the database because
db.Updates() does not trigger the BeforeSave hook.
Guard the repository's UpdateTenant to skip writing plaintext api_key
back to the database. Pre-encrypted values (enc:v1:… from CreateTenant
/ UpdateAPIKey) are written as-is; AfterFind-decrypted plaintext is
blanked so GORM skips the column entirely.
Closes #798
|
||
|---|---|---|
| .. | ||
| crypto.go | ||
| crypto_test.go | ||
| debug.go | ||
| filesize.go | ||
| httputil.go | ||
| inject.go | ||
| inject_test.go | ||
| json.go | ||
| log_sanitize.go | ||
| security.go | ||
| security_test.go | ||
| taskid.go | ||