wu-sheng commented on code in PR #13106:
URL: https://github.com/apache/skywalking/pull/13106#discussion_r1997631968


##########
oap-server/server-alarm-plugin/src/main/java/org/apache/skywalking/oap/server/core/alarm/provider/webhook/WebhookSettings.java:
##########
@@ -18,23 +18,57 @@
 
 package org.apache.skywalking.oap.server.core.alarm.provider.webhook;
 
-import java.util.ArrayList;
-import java.util.List;
+import java.util.*;
+
+import lombok.Builder;
+import lombok.Data;
 import lombok.Getter;
 import lombok.Setter;
 import lombok.ToString;
 import org.apache.skywalking.oap.server.core.alarm.provider.AlarmHookSettings;
 import org.apache.skywalking.oap.server.core.alarm.provider.AlarmHooksType;
+import org.apache.skywalking.oap.server.library.util.StringUtil;
 
 @Setter
 @Getter
 @ToString
 public class WebhookSettings extends AlarmHookSettings {
     private List<String> urls = new ArrayList<>();
+    private Authorization authorization;
+
 
     public WebhookSettings(final String name,
                            final AlarmHooksType type,
                            final boolean isDefault) {
         super(name, type, isDefault);
+
+    }
+
+    @Builder
+    @Data
+    @ToString
+    public static class Authorization {
+        /**
+         * @see WebhookAuthType
+         */
+        private final String type;
+        private final String credentials;
+
+        public void validate() {
+            if (WebhookAuthType.typeOf(type) == null) {
+                throw new IllegalArgumentException("Unsupported authorization: 
" + type);
+            }

Review Comment:
   This extra method is not necessary.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscr...@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to