feat: 接入消息加密与实名认证能力
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user