feat: 接入消息加密与实名认证能力

This commit is contained in:
richjohnrambo
2026-09-21 09:53:39 +08:00
parent 841c0c77cd
commit e3b93113f1
33 changed files with 1747 additions and 99 deletions
+9
View File
@@ -23,6 +23,8 @@ const (
configEventAppReleaseUpdated = "app.release.updated"
configEventSecurityPolicyUpdated = "security.policy.updated"
configEventSensitiveWordsUpdated = "sensitive_words.updated"
configEventMessageKeysUpdated = "message.keys.updated"
configEventMessageKeysActivated = "message.keys.activated"
)
type configEventPayload struct {
@@ -102,6 +104,13 @@ func executeKafkaConfigEvent(envelope kafkaEnvelope) error {
store.InvalidateSecurityPolicyCache(tenantCode)
case configEventSensitiveWordsUpdated:
store.InvalidateModerationConfigCache(tenantCode, false, false, true)
case configEventMessageKeysUpdated, configEventMessageKeysActivated:
store.InvalidateMessageEncryptionKeys(tenantID)
if strings.TrimSpace(envelope.EventType) == configEventMessageKeysUpdated && envelope.Version > 0 {
if err := store.PrepareMessageEncryptionKey(tenantID, tenantCode, int(envelope.Version)); err != nil {
return err
}
}
default:
store.InvalidateTenantConfigCache(tenantCode, tenantID)
store.InvalidateThirdPartyConfigCache(payload.Group)