diff --git a/src/main/java/we/plugin/auth/ApiConfig.java b/src/main/java/we/plugin/auth/ApiConfig.java index 8a0794c..d4c5271 100644 --- a/src/main/java/we/plugin/auth/ApiConfig.java +++ b/src/main/java/we/plugin/auth/ApiConfig.java @@ -43,6 +43,7 @@ public class ApiConfig { static final byte SERVICE_ARRANGE = 1; static final byte SERVICE_DISCOVERY = 2; static final byte REVERSE_PROXY = 3; + static final byte CALLBACK = 4; } public static final int DELETED = 1; @@ -88,7 +89,9 @@ public class ApiConfig { public List pluginConfigs; - public boolean checkApp = false; + public boolean checkApp = false; + + public CallbackConfig callbackConfig; public static boolean isAntPathPattern(String path) { boolean uriVar = false; diff --git a/src/main/java/we/plugin/auth/CallbackConfig.java b/src/main/java/we/plugin/auth/CallbackConfig.java new file mode 100644 index 0000000..0d52307 --- /dev/null +++ b/src/main/java/we/plugin/auth/CallbackConfig.java @@ -0,0 +1,48 @@ +/* + * Copyright (C) 2020 the original author or authors. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package we.plugin.auth; + +import we.util.JacksonUtils; + +import java.util.List; + +/** + * @author hongqiaowei + */ + +public class CallbackConfig { + + public static final char ASYNC = 'a'; + + public static final char SYNC = 's'; + + public int id; + + public char type; + + public List receivers; + + public String respHeaders; + + public String respBody; + + @Override + public String toString() { + return JacksonUtils.writeValueAsString(this); + } +} diff --git a/src/main/java/we/plugin/auth/Receiver.java b/src/main/java/we/plugin/auth/Receiver.java new file mode 100644 index 0000000..f3347c0 --- /dev/null +++ b/src/main/java/we/plugin/auth/Receiver.java @@ -0,0 +1,38 @@ +/* + * Copyright (C) 2020 the original author or authors. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package we.plugin.auth; + +import we.util.JacksonUtils; + +/** + * @author hongqiaowei + */ + +public class Receiver { + + public String service; + + public int type; + + public String path; + + @Override + public String toString() { + return JacksonUtils.writeValueAsString(this); + } +}