From 6ae0050be8b2fd5e1c5b93ed21830a7cdd18265a Mon Sep 17 00:00:00 2001 From: nfel Date: Mon, 14 Jul 2025 12:26:16 +0330 Subject: [PATCH] v2: some code clean up Signed-off-by: nfel --- alert/v1/msg.proto | 31 ++++++++++++++----------------- alert/v1/srv.proto | 4 ++-- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/alert/v1/msg.proto b/alert/v1/msg.proto index bc3fa00..85ce167 100644 --- a/alert/v1/msg.proto +++ b/alert/v1/msg.proto @@ -3,6 +3,7 @@ syntax = "proto3"; package alert.v1; import "base/v1/msg.proto"; +import "auth/v1/msg.proto"; message AlertFilter { base.v1.BaseQueryParam base_filter = 1; @@ -10,11 +11,11 @@ message AlertFilter { LogSource source = 3; } -//Importance of given event +// Importance of given event enum Importance { - LOW = 0; // Low Severity ( unimportant and can be ignored ) - MEDIUM = 1; // MEDIUM Severity - HIGH = 2; // High Severity + LOW = 0; // Low Severity ( unimportant and can be ignored ) + MEDIUM = 1; // MEDIUM Severity + HIGH = 2; // High Severity CRITICAL = 3; // CRITICAL Severity ( can cause panics and data lost ) } @@ -32,17 +33,15 @@ message Meta { } message LogEvent { - optional uint64 id = 1; // Record Id of Log stored in db - string content = 2; - string effective_user = 3; - optional LogSource source = 5; - Importance importance = 6; - Meta meta = 7; + auth.v1.InternalIAM iam = 1; + optional uint64 id = 2; // Record Id of Log stored in db + string content = 3; + optional LogSource source = 4; + Importance importance = 5; + Meta meta = 6; } -message LogEventList { - repeated LogEvent events = 1; -} +message LogEventList { repeated LogEvent events = 1; } /* Internal Msg */ @@ -53,13 +52,11 @@ message SMSChangeLog { } message SMS { - string recipient = 1; //recipient + string recipient = 1; // recipient string text = 2; optional string sender = 3; Meta meta = 4; repeated SMSChangeLog change_log = 5; } -message SMSList { - repeated SMS sms = 1; -} +message SMSList { repeated SMS sms = 1; } diff --git a/alert/v1/srv.proto b/alert/v1/srv.proto index e2b5b06..a2d3112 100644 --- a/alert/v1/srv.proto +++ b/alert/v1/srv.proto @@ -8,6 +8,6 @@ import "base/v1/msg.proto"; service AlertSrv { rpc NotificationSrvHealth(base.v1.Empty) returns (base.v1.StatusRes); rpc Emit(LogEvent) returns (base.v1.StatusRes) {} - rpc Update(LogEvent) returns (base.v1.StatusRes) {} - rpc Get(AlertFilter) returns (base.v1.StatusRes) {} + // rpc Update(LogEvent) returns (base.v1.StatusRes) {} + // rpc Get(AlertFilter) returns (base.v1.StatusRes) {} }