Changes between Version 65 and Version 66 of LdapPlugin


Ignore:
Timestamp:
Nov 7, 2015, 1:05:20 PM (8 years ago)
Author:
figaro
Comment:

Cosmetic changes

Legend:

Unmodified
Added
Removed
Modified
  • LdapPlugin

    v65 v66  
    1 [[PageOutline(2-4)]]
     1[[PageOutline(2-5,Contents,pullout)]]
    22
    33= LDAP extensions to grant group permissions
     
    77LDAP support with group management has been added as a Trac extension. This extension enables the use of existing LDAP groups to grant permissions rather than defining permissions for every single user on the system.
    88
    9 The latest release also permits storage of permissions (both users and groups permissions) in the LDAP directory itself rather than in the SQL backend.
     9The latest release also permits storage of permissions (both users and groups permissions) in the LDAP directory itself rather than in the database backend.
    1010
    1111The original proposal for LDAP ACL is documented under ticket trac:#535 on the official web site.
     
    1313This plugin uses the same license as Trac.
    1414
    15 == Requirements
     15=== Requirements
    1616
    1717This plugin works with the following versions:
     
    3333 1. You need to grab a recent version of Trac from the trunk to make the (optional) Ldap permission store extension work as expected. As the trunk API may vary without notice, the plugin may be broken if you run it with a different release.
    3434
     35== Bugs/Feature Requests
     36
     37Existing bugs and feature requests for !LdapPlugin are [report:9?COMPONENT=LdapPlugin here].
     38
     39If you have any issues, create a [/newticket?component=LdapPlugin new ticket].
     40
     41[[TicketQuery(component=LdapPlugin&group=type,format=progress)]]
     42
    3543== Download
    3644
    37 Download the zipped source from [download:ldapplugin here].
     45Download the zipped source from [export:ldapplugin here].
    3846
    3947== Source
    4048
    41 You can check out LdapPlugin from [http://trac-hacks.org/svn/ldapplugin here] using Subversion, or [source:ldapplugin browse the source] with Trac.
     49You can check out LdapPlugin from [/svn/ldapplugin here] using Subversion, or [source:ldapplugin browse the source] with Trac.
    4250
    4351== Configuration
    4452
    45 You must configure 3 different places:
     53You must configure this plugin in the following places:
    4654 1. Authentication (Apache configuration): Get access to the ldap server for reading out the groups.
    4755 1. Configure the plugin (section [ldap] in trac.ini): Get the groups by mapping the interesting part of the server's LDAP directory to this plugin.
     
    6371Here is an example of a typical LDAP section of an Apache2.0 configuration file:
    6472
    65 {{{
    66 #!apache
     73{{{#!apache
    6774<Location /trac/project>
    6875   PythonOption TracEnv "/local/var/trac/project"
     
    7986==== Apache 2.2
    8087
    81 Since the mod_auth_ldap module has been superseded by the mod_authnz_ldap module for Apache 2.2, the configuration also needs a little tweaking. The above example would now look like:
    82 
    83 {{{
    84 #!apache
     88Since the mod_auth_ldap module has been superseded by the mod_authnz_ldap module for Apache 2.2, the configuration also needs tweaking. The above example would now look like:
     89
     90{{{#!apache
    8591<Location /trac/project>
    8692   PythonOption TracEnv "/local/var/trac/project"
     
    109115To enable LdapPlugin you must add this line to the `[components]` section of `trac.ini`:
    110116
    111 {{{
    112 #!ini
     117{{{#!ini
    113118[components]
    114119ldapplugin.* = enabled
     
    117122The `[ldap]` section may contain the following options (presented here with their default values):
    118123
    119 {{{
    120 #!ini
     124{{{#!ini
    121125[ldap]
    122126# enable LDAP support for Trac
     
    172176A typical setup for group resolution would look like this:
    173177
    174 {{{
    175 #!ini
     178{{{#!ini
    176179[ldap]
    177180enable = true
     
    181184A typical setup for all LDAP support (group resolution and permission store) would look like this:
    182185
    183 {{{
    184 #!ini
     186{{{#!ini
    185187[ldap]
    186188enable = true
     
    196198
    197199If you get an error message like this:
    198 {{{
    199 #!sh
     200{{{#!sh
    200201File "build/bdist.linux-x86_64/egg/ldapplugin/api.py", line 106, in get_permission_groups
    201202TypeError: __init__() keywords must be strings
    202203}}}
    203 you may have to patch the LdapPlugin source, see:
    204 https://trac-hacks.org/ticket/6183
     204
     205you may have to patch the LdapPlugin source, see #6183.
    205206
    206207===== Note about `group_rdn` and `user_rdn`
    207208
    208 Starting from release '''v0.4.0''', `group_basedn` and `user_basedn` options have been superseeded with `group_rdn` and `user_rdn`.[[BR]]
     209Starting from release '''v0.4.0''', `group_basedn` and `user_basedn` options have been superseded with `group_rdn` and `user_rdn`.
     210
    209211The new settings define the relative DNs respectively for the group and the user subtree, based on the common `basedn` trunk. For example:
    210212  * `ou=people,dc=example,dc=org` would require the following settings:
    211 {{{
    212 #!ini
     213{{{#!ini
    213214basedn = dc=example,dc=org
    214215user_rdn = ou=people
    215216}}}
    216217  * `ou=groups,dc=example,dc=org` would require the following settings:
    217 {{{
    218 #!ini
     218{{{#!ini
    219219basedn = dc=example,dc=org
    220220group_rdn = ou=groups
     
    225225If the server requires an authenticated connection to retrieve group permissions, you want to set `group_bind = true` in the `[ldap]` section and define the credentials as follows:
    226226
    227 {{{
    228 #!ini
     227{{{#!ini
    229228[ldap]
    230229group_bind = true
     
    235234If the server requires an authenticated connection to modify group permissions, you want to set `store_bind = true` in the `[ldap]` section and define the credentials as follows:
    236235
    237 {{{
    238 #!ini
     236{{{#!ini
    239237[ldap]
    240238store_bind = true
     
    247245==== Ldap permission store
    248246
    249 If you wish to use the LDAP permission store feature, you need to tell Trac to use the LDAP extension rather than the internal default permission store which relies on the SQL database.
     247If you wish to use the LDAP permission store feature, you need to tell Trac to use the LDAP extension rather than the internal default permission store which relies on the database.
    250248
    251249Note that if you decide to store Trac permissions as a ''new'' LDAP attribute, you will need LDAP schema management rights. Furthermore, some LDAP servers, eg Active Directory, might not allow the deletion of attribute definitions.
     
    253251To achieve this setting, add the following line to the main `[trac]` section of your `trac.ini` configuration file:
    254252
    255 {{{
    256 #!ini
     253{{{#!ini
    257254[trac]
    258255# ...
     
    262259You also need to enable `LdapPermissionStore` for LdapPlugin by adding:
    263260
    264 {{{
    265 #!ini
     261{{{#!ini
    266262[components]
    267263ldapplugin.* = enabled
     
    279275tracperm: TICKET_ADMIN
    280276}}}
    281 and define user permission to LDAP entries such as
     277
     278and define user permission to LDAP entries such as:
    282279{{{
    283280dn: uid=courtney,dc=example,dc=org
     
    291288It is worth noting that the '''dn''' used for groups and for users may be different, which should make things easier to add TracPermissions into your existing LDAP directory.
    292289
    293 To differentiate a group name from a user name in `trac-admin`, prefix the group name with the `@` characters. This syntax has been borrowed from Samba and many other software dealing with group management.
     290To differentiate a group name from a user name in `trac-admin`, prefix the group name with the `@` characters. This syntax has been borrowed from [https://www.samba.org/ Samba] and many other software dealing with group management.
    294291
    295292One would grant the above permissions using the following `trac-admin` commands:
    296 {{{
    297 #!sh
     293{{{#!sh
    298294permission add @managers WIKI_ADMIN
    299295permission add @managers TICKET_ADMIN
     
    313309A LDAP group should start with the '`@`' character, such as:
    314310
    315 {{{
    316 #!sh
     311{{{#!sh
    317312Trac [/var/local/db/trac/public]> permission list
    318313
     
    336331You can obviously still use permissions for regular user such as ''eblot'' in the example above.
    337332
    338 '''Note''': Please remember that ''anonymous'' and ''authenticated'' are special users but are considered by the permission backend just like any other regular user.[[BR]]
    339 This means that you need to add both these special users in your LDAP directory if you wish to assign permission to these joker entries.
    340 The directory configuration proposed in the test page may give you some hints about how to setup your LDAP directory.
     333'''Note''': Please remember that ''anonymous'' and ''authenticated'' are special users but are considered by the permission backend just like any other regular user. This means that you need to add both these special users in your LDAP directory if you wish to assign permission to these joker entries. The directory configuration proposed in the test page may give you some hints about how to setup your LDAP directory.
    341334
    342335===== Group of names
     
    355348}}}
    356349   With such an environment, your [ldap] section would contain the following:
    357 {{{
    358 #!ini
     350{{{#!ini
    359351[ldap]
    360352...
     
    375367}}}
    376368   With such an environment, your [ldap] section would contain the following:
    377 {{{
    378 #!ini
     369{{{#!ini
    379370[ldap]
    380371...
     
    387378Beware, if you use this second scheme, you should have these lines in your apache configuration:
    388379
    389 {{{
    390 #!apache
     380{{{#!apache
    391381<Location /trac/project>
    392382   ...
     
    415405
    416406It is still possible to use global permissions by setting in the `[ldap]` section of the environment configuration file:
    417 {{{
    418 #!ini
     407{{{#!ini
    419408global_perms = true
    420409}}}
     
    442431
    443432The following permission command:
    444 {{{
    445 #!sh
     433{{{#!sh
    446434permission add eblot @developers
    447435}}}
     
    490478The LdapPluginTests page gives some hints about how to test the Ldap extension for Trac.
    491479
    492 == Bugs/Feature Requests
    493 
    494 Existing bugs and feature requests for !LdapPlugin are [report:9?COMPONENT=LdapPlugin here].
    495 
    496 If you have any issues, create a [/newticket?component=LdapPlugin new ticket].
    497 
    498 [[TicketQuery(component=LdapPlugin&group=type,format=progress)]]
    499 
    500480== History
    501481
     
    504484   * includes a cache to dramatically reduce LDAP requests
    505485   * better handling of LDAP errors[[BR]]This extension works with Trac 0.9-pre1 and requires the setuptools, version 0.5a13
    506  * '''v0.2''': This new release fixes up a couple of bugs and works with Trac 0.9-pre2. It requires the [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version 0.6+.[[BR]]It introduces support for LDAP permission store: TracPermissions can now be stored into the LDAP directory, rather than in the SQL backend.[[BR]]Each feature (LDAP as a provider of group permissions, LDAP as a permission store) are independent and can be enabled or disabled on demand.
     486 * '''v0.2''': This new release fixes up a couple of bugs and works with Trac 0.9-pre2. It requires the [http://peak.telecommunity.com/DevCenter/setuptools setuptools], version 0.6+.[[BR]]It introduces support for LDAP permission store: TracPermissions can now be stored into the LDAP directory, rather than in the database backend.[[BR]]Each feature (LDAP as a provider of group permissions, LDAP as a permission store) are independent and can be enabled or disabled on demand.
    507487 * '''v0.2.1''': Bug fixing
    508488 * '''v0.2.2''': Introduce support for disting DN for users and groups (implemented suggestion described in #75)