SVN整合LDAP配置用户与用户组

SVN与LDAP整合一般借助Apache,首先看看svn与Apache整合:Apache的HTTP服务器

最基本的配置如下:

<Location /repos>
   DAV svn
   SVNPath /var/www/svn/repos

   AuthType Basic
   AuthName "SVN Authorization Realm"
   
   #使用htpasswd产生的密码文件
   AuthUserFile /var/www/svn/repos/conf/passwd
   AuthzSVNAccessFile /var/www/svn/repos/conf/authz
   
   #允许匿名读取
   Satisfy Any
   Require valid-user
</Location>

OK,假设你已经理解了以上配置。

验证模块文档:mod_auth_basic


在前几篇文档中,我们创建了Developer和Tester两个group,现在我们配置成开发有读写权限,其他用户有读取权限,如下:

<Location /repos>
   DAV svn
   SVNPath /var/www/svn/repos
   
   AuthType Basic
   AuthName "SVN Authorization Realm"

   #以下为LDAP服务配置
   AuthBasicProvider ldap
   #关闭权限继承,这个自己查一下资料
   AuthzLDAPAuthoritative off
   #LDAP连接
   AuthLDAPURL "ldap://199.155.122.90:10389/ou=users,dc=taotaosou.com?cn?sub?(objectClass=person)"
   
   #绑定用户,主要用于对LDAP进行读取与匹配,如果允许匿名读取LDAP数据则可不写
   #AuthLDAPBindDN "ldap-reader"
   #绑定密码      
   #AuthLDAPBindPassword "ldap-reader-pwd"

   #读取权限要求必须是有效用户,非匿名
   <Limit GET PROPFIND OPTIONS REPORT>
        require valid-user
   </Limit>
   #读取权限以外的权限必须是开发组
   <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require ldap-group cn=developer,ou=groups,dc=taotaosou.com
   </LimitExcept>
</Location>

以上就实现了开发人员的读写权限,其他人员的读取权限,如果需要匿名读取,则是以下配置:

<Location /repos>
   DAV svn
   SVNPath /var/www/svn/repos
   
   AuthType Basic
   AuthName "SVN Authorization Realm"

   #以下为LDAP服务配置
   AuthBasicProvider ldap
   #关闭权限继承,这个自己查一下资料
   AuthzLDAPAuthoritative off
   #LDAP连接
   AuthLDAPURL "ldap://199.155.122.90:10389/ou=users,dc=taotaosou.com?cn?sub?(objectClass=person)"
   
   #绑定用户,主要用于对LDAP进行读取与匹配,如果允许匿名读取LDAP数据则可不写
   #AuthLDAPBindDN "ldap-reader"
   #绑定密码      
   #AuthLDAPBindPassword "ldap-reader-pwd"

   #读取权限以外的权限必须是开发组
   <LimitExcept GET PROPFIND OPTIONS REPORT>
        Require ldap-group cn=developer,ou=groups,dc=taotaosou.com
   </LimitExcept>
</Location>

一些LDAP与Httpd整合的资料:mod_auth_ldap

Mod_core中的一些指令:Limit 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章