You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@kylin.apache.org by li...@apache.org on 2017/04/26 14:12:11 UTC

kylin git commit: KYLIN-2564 use InMemoryUserDetailsManager instead of InMemoryDaoImpl

Repository: kylin
Updated Branches:
  refs/heads/2.0.x 0b21e25c4 -> 2cea072f8


KYLIN-2564 use InMemoryUserDetailsManager instead of InMemoryDaoImpl


Project: http://git-wip-us.apache.org/repos/asf/kylin/repo
Commit: http://git-wip-us.apache.org/repos/asf/kylin/commit/2cea072f
Tree: http://git-wip-us.apache.org/repos/asf/kylin/tree/2cea072f
Diff: http://git-wip-us.apache.org/repos/asf/kylin/diff/2cea072f

Branch: refs/heads/2.0.x
Commit: 2cea072f8a0e5d1f1bcca5672a6daa6254d33324
Parents: 0b21e25
Author: Hongbin Ma <ma...@apache.org>
Authored: Wed Apr 26 22:11:50 2017 +0800
Committer: Hongbin Ma <ma...@apache.org>
Committed: Wed Apr 26 22:11:50 2017 +0800

----------------------------------------------------------------------
 server/src/main/resources/kylinSecurity.xml | 62 +++++++++++-------------
 1 file changed, 28 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/kylin/blob/2cea072f/server/src/main/resources/kylinSecurity.xml
----------------------------------------------------------------------
diff --git a/server/src/main/resources/kylinSecurity.xml b/server/src/main/resources/kylinSecurity.xml
index 2553374..5105c3f 100644
--- a/server/src/main/resources/kylinSecurity.xml
+++ b/server/src/main/resources/kylinSecurity.xml
@@ -171,45 +171,39 @@
             <value>ROLE_ANALYST</value>
         </util:list>
 
+        <bean class="org.springframework.security.core.userdetails.User" id="adminUser">
+            <constructor-arg value="ADMIN"/>
+            <constructor-arg
+                    value="$2a$10$o3ktIWsGYxXNuUWQiYlZXOW5hWcqyNAFQsSSCSEWoC/BRVMAUjL32"/>
+            <constructor-arg ref="adminAuthorities"/>
+        </bean>
+        <bean class="org.springframework.security.core.userdetails.User" id="modelerUser">
+            <constructor-arg value="MODELER"/>
+            <constructor-arg
+                    value="$2a$10$Le5ernTeGNIARwMJsY0WaOLioNQdb0QD11DwjeyNqqNRp5NaDo2FG"/>
+            <constructor-arg ref="modelerAuthorities"/>
+        </bean>
+        <bean class="org.springframework.security.core.userdetails.User" id="analystUser">
+            <constructor-arg value="ANALYST"/>
+            <constructor-arg
+                    value="$2a$10$s4INO3XHjPP5Vm2xH027Ce9QeXWdrfq5pvzuGr9z/lQmHqi0rsbNi"/>
+            <constructor-arg ref="analystAuthorities"/>
+        </bean>
+
         <bean id="kylinUserAuthProvider"
               class="org.apache.kylin.rest.security.KylinAuthenticationProvider">
             <constructor-arg>
                 <bean class="org.springframework.security.authentication.dao.DaoAuthenticationProvider">
                     <property name="userDetailsService">
-                        <bean class="org.springframework.security.core.userdetails.memory.InMemoryDaoImpl">
-                            <property name="userMap">
-                                <bean class="org.springframework.security.core.userdetails.memory.UserMap">
-                                    <property name="users">
-                                        <util:map key-type="java.lang.String"
-                                                  value-type="org.springframework.security.core.userdetails.User">
-                                            <entry key="admin">
-                                                <bean class="org.springframework.security.core.userdetails.User">
-                                                    <constructor-arg value="ADMIN"/>
-                                                    <constructor-arg
-                                                            value="$2a$10$o3ktIWsGYxXNuUWQiYlZXOW5hWcqyNAFQsSSCSEWoC/BRVMAUjL32"/>
-                                                    <constructor-arg ref="adminAuthorities"/>
-                                                </bean>
-                                            </entry>
-                                            <entry key="modeler">
-                                                <bean class="org.springframework.security.core.userdetails.User">
-                                                    <constructor-arg value="MODELER"/>
-                                                    <constructor-arg
-                                                            value="$2a$10$Le5ernTeGNIARwMJsY0WaOLioNQdb0QD11DwjeyNqqNRp5NaDo2FG"/>
-                                                    <constructor-arg ref="modelerAuthorities"/>
-                                                </bean>
-                                            </entry>
-                                            <entry key="analyst">
-                                                <bean class="org.springframework.security.core.userdetails.User">
-                                                    <constructor-arg value="ANALYST"/>
-                                                    <constructor-arg
-                                                            value="$2a$10$s4INO3XHjPP5Vm2xH027Ce9QeXWdrfq5pvzuGr9z/lQmHqi0rsbNi"/>
-                                                    <constructor-arg ref="analystAuthorities"/>
-                                                </bean>
-                                            </entry>
-                                        </util:map>
-                                    </property>
-                                </bean>
-                            </property>
+                        <bean class="org.springframework.security.provisioning.InMemoryUserDetailsManager">
+                            <constructor-arg>
+                                <util:list
+                                        value-type="org.springframework.security.core.userdetails.User">
+                                    <ref bean="adminUser"></ref>
+                                    <ref bean="modelerUser"></ref>
+                                    <ref bean="analystUser"></ref>
+                                </util:list>
+                            </constructor-arg>
                         </bean>
                     </property>
                     <property name="passwordEncoder" ref="passwordEncoder"></property>