From fdb2d786321614f254643366f40a5179bd566f5d Mon Sep 17 00:00:00 2001 From: Kunal Kaushik Date: Mon, 11 Aug 2025 17:47:48 +0530 Subject: [PATCH] Adding channel config protos and validation for Google Secops Integration --- .../config/service/v1/notification_channel.proto | 5 +++++ ...icationChannelConfigServiceRequestValidator.java | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto b/notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto index 91d16de7..bd627a0d 100644 --- a/notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto +++ b/notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto @@ -17,6 +17,11 @@ message NotificationChannelMutableData { repeated SplunkIntegrationChannelConfig splunk_integration_channel_config = 5; repeated SyslogIntegrationChannelConfig syslog_integration_channel_config = 6; repeated HttpEventCollectorChannelConfig http_event_collector_channel_config = 7; + repeated GoogleSecopsIntegrationChannelConfig google_secops_integration_channel_config = 8; +} + +message GoogleSecopsIntegrationChannelConfig { + string google_secops_integration_id = 1; } message HttpEventCollectorChannelConfig { diff --git a/notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java b/notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java index cfe0d469..251a0cb0 100644 --- a/notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java +++ b/notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java @@ -18,6 +18,7 @@ import org.hypertrace.notification.config.service.v1.EmailChannelConfig; import org.hypertrace.notification.config.service.v1.GetAllNotificationChannelsRequest; import org.hypertrace.notification.config.service.v1.GetNotificationChannelRequest; +import org.hypertrace.notification.config.service.v1.GoogleSecopsIntegrationChannelConfig; import org.hypertrace.notification.config.service.v1.HttpEventCollectorChannelConfig; import org.hypertrace.notification.config.service.v1.NotificationChannel; import org.hypertrace.notification.config.service.v1.NotificationChannelMutableData; @@ -131,7 +132,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa && data.getS3BucketChannelConfigCount() == 0 && data.getSplunkIntegrationChannelConfigCount() == 0 && data.getSyslogIntegrationChannelConfigCount() == 0 - && data.getHttpEventCollectorChannelConfigCount() == 0) { + && data.getHttpEventCollectorChannelConfigCount() == 0 + && data.getGoogleSecopsIntegrationChannelConfigCount() == 0) { throw Status.INVALID_ARGUMENT.withDescription("No config present").asRuntimeException(); } data.getEmailChannelConfigList().forEach(this::validateEmailChannelConfig); @@ -143,6 +145,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa .forEach(this::validateSyslogIntegrationChannelConfig); data.getHttpEventCollectorChannelConfigList() .forEach(this::validateHttpEventCollectorChannelConfig); + data.getGoogleSecopsIntegrationChannelConfigList() + .forEach(this::validateGoogleSecopsIntegrationChannelConfig); } public void validateGetAllNotificationChannelsRequest( @@ -234,6 +238,13 @@ private void validateSyslogIntegrationChannelConfig( SyslogIntegrationChannelConfig.SYSLOG_SERVER_INTEGRATION_ID_FIELD_NUMBER); } + private void validateGoogleSecopsIntegrationChannelConfig( + GoogleSecopsIntegrationChannelConfig googleSecopsIntegrationChannelConfig) { + validateNonDefaultPresenceOrThrow( + googleSecopsIntegrationChannelConfig, + GoogleSecopsIntegrationChannelConfig.GOOGLE_SECOPS_INTEGRATION_ID_FIELD_NUMBER); + } + private void validateNonDuplicateNotificationChannelOrThrow( @Nullable String id, String channelName,