feat: enhance logging and message encryption features
- Introduced new logging services: operation logs, login logs, and data change logs. - Added support for message content encryption in the Message model, including methods for encrypting and decrypting message segments. - Updated router to include admin log handling and integrated log service for access logging. - Modified configuration to support encryption settings.
This commit is contained in:
14
internal/config/encryption.go
Normal file
14
internal/config/encryption.go
Normal file
@@ -0,0 +1,14 @@
|
||||
package config
|
||||
|
||||
// EncryptionConfig 消息加密配置
|
||||
type EncryptionConfig struct {
|
||||
// Enabled 是否启用消息加密
|
||||
Enabled bool `mapstructure:"enabled"`
|
||||
|
||||
// Key 加密密钥(32字节,AES-256)
|
||||
// 生产环境应通过环境变量 APP_ENCRYPTION_KEY 设置
|
||||
Key string `mapstructure:"key"`
|
||||
|
||||
// KeyVersion 密钥版本,用于密钥轮换
|
||||
KeyVersion int `mapstructure:"key_version"`
|
||||
}
|
||||
Reference in New Issue
Block a user