Skip to content

Commit 9a34768

Browse files
authored
Adding channel config protos and validation for Google Secops Integration (#310)
1 parent 52c6681 commit 9a34768

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

notification-channel-config-service-api/src/main/proto/org/hypertrace/notification/config/service/v1/notification_channel.proto

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,11 @@ message NotificationChannelMutableData {
1717
repeated SplunkIntegrationChannelConfig splunk_integration_channel_config = 5;
1818
repeated SyslogIntegrationChannelConfig syslog_integration_channel_config = 6;
1919
repeated HttpEventCollectorChannelConfig http_event_collector_channel_config = 7;
20+
repeated GoogleSecopsIntegrationChannelConfig google_secops_integration_channel_config = 8;
21+
}
22+
23+
message GoogleSecopsIntegrationChannelConfig {
24+
string google_secops_integration_id = 1;
2025
}
2126

2227
message HttpEventCollectorChannelConfig {

notification-channel-config-service-impl/src/main/java/org/hypertrace/notification/config/service/NotificationChannelConfigServiceRequestValidator.java

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
import org.hypertrace.notification.config.service.v1.EmailChannelConfig;
1919
import org.hypertrace.notification.config.service.v1.GetAllNotificationChannelsRequest;
2020
import org.hypertrace.notification.config.service.v1.GetNotificationChannelRequest;
21+
import org.hypertrace.notification.config.service.v1.GoogleSecopsIntegrationChannelConfig;
2122
import org.hypertrace.notification.config.service.v1.HttpEventCollectorChannelConfig;
2223
import org.hypertrace.notification.config.service.v1.NotificationChannel;
2324
import org.hypertrace.notification.config.service.v1.NotificationChannelMutableData;
@@ -131,7 +132,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa
131132
&& data.getS3BucketChannelConfigCount() == 0
132133
&& data.getSplunkIntegrationChannelConfigCount() == 0
133134
&& data.getSyslogIntegrationChannelConfigCount() == 0
134-
&& data.getHttpEventCollectorChannelConfigCount() == 0) {
135+
&& data.getHttpEventCollectorChannelConfigCount() == 0
136+
&& data.getGoogleSecopsIntegrationChannelConfigCount() == 0) {
135137
throw Status.INVALID_ARGUMENT.withDescription("No config present").asRuntimeException();
136138
}
137139
data.getEmailChannelConfigList().forEach(this::validateEmailChannelConfig);
@@ -143,6 +145,8 @@ private void validateNotificationChannelMutableData(NotificationChannelMutableDa
143145
.forEach(this::validateSyslogIntegrationChannelConfig);
144146
data.getHttpEventCollectorChannelConfigList()
145147
.forEach(this::validateHttpEventCollectorChannelConfig);
148+
data.getGoogleSecopsIntegrationChannelConfigList()
149+
.forEach(this::validateGoogleSecopsIntegrationChannelConfig);
146150
}
147151

148152
public void validateGetAllNotificationChannelsRequest(
@@ -234,6 +238,13 @@ private void validateSyslogIntegrationChannelConfig(
234238
SyslogIntegrationChannelConfig.SYSLOG_SERVER_INTEGRATION_ID_FIELD_NUMBER);
235239
}
236240

241+
private void validateGoogleSecopsIntegrationChannelConfig(
242+
GoogleSecopsIntegrationChannelConfig googleSecopsIntegrationChannelConfig) {
243+
validateNonDefaultPresenceOrThrow(
244+
googleSecopsIntegrationChannelConfig,
245+
GoogleSecopsIntegrationChannelConfig.GOOGLE_SECOPS_INTEGRATION_ID_FIELD_NUMBER);
246+
}
247+
237248
private void validateNonDuplicateNotificationChannelOrThrow(
238249
@Nullable String id,
239250
String channelName,

0 commit comments

Comments
 (0)