This is an automated email from the ASF dual-hosted git repository.

dockerzhang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-inlong-website.git


The following commit(s) were added to refs/heads/master by this push:
     new a3801ee  [INLONG-293] add Inlong manager user defined Shiro plug-in 
documentation (#294)
a3801ee is described below

commit a3801eecd770f617f73fd168585186699203e7b2
Author: wardli <[email protected]>
AuthorDate: Fri Mar 11 13:32:56 2022 +0800

    [INLONG-293] add Inlong manager user defined Shiro plug-in documentation 
(#294)
---
 docs/development/inlong_manager_shiro_plugin.md    | 50 ++++++++++++++++++++++
 .../development/inlong_manager_shiro_plugin.md     | 50 ++++++++++++++++++++++
 2 files changed, 100 insertions(+)

diff --git a/docs/development/inlong_manager_shiro_plugin.md 
b/docs/development/inlong_manager_shiro_plugin.md
new file mode 100644
index 0000000..2a418c5
--- /dev/null
+++ b/docs/development/inlong_manager_shiro_plugin.md
@@ -0,0 +1,50 @@
+---
+title: Custom Authentication
+sidebar_position: 2
+---
+
+## Overview
+The Apache Shiro framework is used in the inlong manager to realize the 
functions of authentication and authorization. The manager has integrated the 
default implementation logic. If you want to realize the custom Shiro based 
authentication and authorization function in the inlong manager, you can carry 
out the plug-in development of relevant functions according to the following 
instructions.
+
+## Dependency
+- Add Maven Dependency
+```java
+<dependency>
+        <groupId>org.apache.inlong</groupId>
+        <artifactId>manager-common</artifactId>
+        <version>inlong_version</version>
+</dependency>
+```
+
+## Code
+- Implement the following interfaces
+```java
+org.apache.inlong.manager.common.auth.InlongShiro
+
+public interface InlongShiro {
+
+    WebSecurityManager getWebSecurityManager();
+
+    AuthorizingRealm getShiroRealm();
+
+    WebSessionManager getWebSessionManager();
+
+    CredentialsMatcher getCredentialsMatcher();
+
+    ShiroFilterFactoryBean getShiroFilter(SecurityManager securityManager);
+}
+```
+
+- Implement * InlongShiro * interface and specify the configuration in "@ 
conditionalonproperty"
+```java
+@ConditionalOnProperty(name = "type", prefix = "inlong.auth", havingValue = 
"Custom")
+@Component
+public class InlongShiroImpl implements InlongShiro {
+   //todo
+}
+```
+
+- Modify the application.properties under the manager web module
+```java
+inlong.auth.type=Custom
+```
\ No newline at end of file
diff --git 
a/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.0.0/development/inlong_manager_shiro_plugin.md
 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.0.0/development/inlong_manager_shiro_plugin.md
new file mode 100644
index 0000000..e94c188
--- /dev/null
+++ 
b/i18n/zh-CN/docusaurus-plugin-content-docs/version-1.0.0/development/inlong_manager_shiro_plugin.md
@@ -0,0 +1,50 @@
+---
+title: 自定义认证
+sidebar_position: 2
+---
+
+## 总览
+Inlong Manager中使用了Apache Shiro框架实现了认证和授权等功能,Manager已经集成好了默认的实现逻辑,如果您想在Inlong 
Manager中实现自定义的基于Shiro的认证和授权功能,您可以按照如下的说明,进行相关功能的插件化开发。
+
+## 依赖
+- 增加maven 依赖
+```java
+<dependency>
+        <groupId>org.apache.inlong</groupId>
+        <artifactId>manager-common</artifactId>
+        <version>inlong_version</version>
+</dependency>
+```
+
+## 编码
+- 实现其中关于Shiro相关模块的接口
+```java
+org.apache.inlong.manager.common.auth.InlongShiro
+
+public interface InlongShiro {
+
+    WebSecurityManager getWebSecurityManager();
+
+    AuthorizingRealm getShiroRealm();
+
+    WebSessionManager getWebSessionManager();
+
+    CredentialsMatcher getCredentialsMatcher();
+
+    ShiroFilterFactoryBean getShiroFilter(SecurityManager securityManager);
+}
+```
+
+- 实现*InlongShiro*接口,并在"@ConditionalOnProperty"指定配置
+```java
+@ConditionalOnProperty(name = "type", prefix = "inlong.auth", havingValue = 
"Custom")
+@Component
+public class InlongShiroImpl implements InlongShiro {
+   //todo
+}
+```
+
+- 修改manager-web module下application.properties文件中配置
+```java
+inlong.auth.type=Custom
+```
\ No newline at end of file

Reply via email to