WeKnora/internal/utils
ochan.kwon 8d8cc051be fix(tenant): prevent api_key encryption loss on tenant settings update
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
2026-03-25 21:25:21 +08:00
..
crypto.go feat(security): add AES-256-GCM encryption for API keys at rest 2026-03-09 10:35:07 +08:00
crypto_test.go fix(tenant): prevent api_key encryption loss on tenant settings update 2026-03-25 21:25:21 +08:00
debug.go feat: 使用增强的任务ID生成器替换UUID 2026-01-14 17:09:19 +08:00
filesize.go feat: 添加可配置的文件上传大小限制 2025-12-30 14:35:10 +08:00
httputil.go feat: enhance document loading and state management in doc-content component 2026-03-02 21:21:49 +08:00
inject.go feat: add unit tests for InjectAndConditions function 2026-03-16 19:21:35 +08:00
inject_test.go feat: add unit tests for InjectAndConditions function 2026-03-16 19:21:35 +08:00
json.go feat: Add DataSchema tool for retrieving schema information from CSV and Excel files 2025-12-29 20:03:51 +08:00
log_sanitize.go feat: implement image upload and multimodal support 2026-03-12 10:32:26 +08:00
security.go feat: enhance localization and configuration support 2026-03-17 22:23:24 +08:00
security_test.go refactor: update session title generation and language context handling 2026-03-17 22:23:24 +08:00
taskid.go feat: 使用增强的任务ID生成器替换UUID 2026-01-14 17:09:19 +08:00