10 changed files with 138 additions and 13 deletions
Binary file not shown.
@ -1,18 +1,24 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?><plugin> |
||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> |
||||
<plugin> |
||||
<id>com.fr.decision.auth.http</id> |
||||
<main-package>com.fr.decision.auth.http</main-package> |
||||
<name><![CDATA[http认证]]></name> |
||||
<active>yes</active> |
||||
<version>1.0</version> |
||||
<version>1.1</version> |
||||
<env-version>10.0~</env-version> |
||||
<jartime>2018-10-20</jartime> |
||||
<vendor>author</vendor> |
||||
<description><![CDATA[定制http认证。]]></description> |
||||
<change-notes><![CDATA[ |
||||
[2019-09-20]增加了灵活的脚本配置。<br/> |
||||
[2018-11-22]增加了插件功能说明。<br/> |
||||
]]></change-notes> |
||||
<extra-core> |
||||
<LocaleFinder class="com.fr.decision.auth.http.HttpAuthorizeLocaleBridge"/> |
||||
</extra-core> |
||||
<extra-decision> |
||||
<HttpAuthorizeProvider class="com.fr.decision.auth.http.HttpAuthorizeBridge"/> |
||||
</extra-decision> |
||||
<lifecycle-monitor class="com.fr.decision.auth.http.HttpAuthorizeInitializeMonitor"/> |
||||
<function-recorder class="com.fr.decision.auth.http.HttpAuthorizeBridge"/> |
||||
</plugin> |
@ -0,0 +1,23 @@
|
||||
package com.fr.decision.auth.http; |
||||
|
||||
import com.fr.decision.auth.http.config.HttpAuthorizeConfig; |
||||
import com.fr.plugin.context.PluginContext; |
||||
import com.fr.plugin.observer.inner.AbstractPluginLifecycleMonitor; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/20 |
||||
*/ |
||||
public class HttpAuthorizeInitializeMonitor extends AbstractPluginLifecycleMonitor { |
||||
|
||||
@Override |
||||
public void afterRun(PluginContext pluginContext) { |
||||
HttpAuthorizeConfig.getInstance(); |
||||
} |
||||
|
||||
@Override |
||||
public void beforeStop(PluginContext pluginContext) { |
||||
|
||||
} |
||||
} |
@ -0,0 +1,15 @@
|
||||
package com.fr.decision.auth.http; |
||||
|
||||
import com.fr.stable.fun.impl.AbstractLocaleFinder; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/20 |
||||
*/ |
||||
public class HttpAuthorizeLocaleBridge extends AbstractLocaleFinder { |
||||
@Override |
||||
public String find() { |
||||
return "com/fr/decision/auth/http/http"; |
||||
} |
||||
} |
@ -0,0 +1,42 @@
|
||||
package com.fr.decision.auth.http.config; |
||||
|
||||
import com.fanruan.api.conf.BaseConfiguration; |
||||
import com.fanruan.api.conf.HolderKit; |
||||
import com.fr.config.Identifier; |
||||
import com.fr.config.Status; |
||||
import com.fr.config.holder.Conf; |
||||
|
||||
/** |
||||
* @author richie |
||||
* @version 10.0 |
||||
* Created by richie on 2019/9/20 |
||||
*/ |
||||
public class HttpAuthorizeConfig extends BaseConfiguration { |
||||
|
||||
private static volatile HttpAuthorizeConfig instance; |
||||
|
||||
public static HttpAuthorizeConfig getInstance() { |
||||
if (instance == null) { |
||||
instance = getConfigInstance(HttpAuthorizeConfig.class); |
||||
} |
||||
return instance; |
||||
} |
||||
|
||||
@Identifier(value = "condition", name = "Plugin-Http_Config_Property_Text", description = "Plugin-Http_Config_Property_Text_Description", status = Status.SHOW) |
||||
private Conf<String> condition = HolderKit.simple("res != \"false\""); |
||||
|
||||
public String getCondition() { |
||||
return condition.get(); |
||||
} |
||||
|
||||
public void setCondition(String condition) { |
||||
this.condition.set(condition); |
||||
} |
||||
|
||||
@Override |
||||
public Object clone() throws CloneNotSupportedException { |
||||
HttpAuthorizeConfig cloned = (HttpAuthorizeConfig) super.clone(); |
||||
cloned.condition = (Conf<String>) condition.clone(); |
||||
return cloned; |
||||
} |
||||
} |
@ -0,0 +1,2 @@
|
||||
Plugin-Http_Config_Property_Text=Condition Script Text |
||||
Plugin-Http_Config_Property_Text_Description=ES5 script text, value as http return text and username as input username |
@ -0,0 +1,2 @@
|
||||
Plugin-Http_Config_Property_Text=Condition Script Text |
||||
Plugin-Http_Config_Property_Text_Description=ES5 script text, value as http return text and username as input username |
@ -0,0 +1,2 @@
|
||||
Plugin-Http_Config_Property_Text=\u5224\u65AD\u811A\u672C |
||||
Plugin-Http_Config_Property_Text_Description=\u652F\u6301ES5\u7684JavaScript\u811A\u672C\uFF0C\u53C2\u6570username\u548Cvalue\u5206\u522B\u8868\u793A\u8F93\u5165\u7684\u7528\u6237\u540D\u548Chttp\u8BA4\u8BC1\u670D\u52A1\u5668\u8FD4\u56DE\u7684\u6587\u672C |
Loading…
Reference in new issue