README.txt in dm-ldap-adapter-0.4.1 vs README.txt in dm-ldap-adapter-0.4.2
- old
+ new
@@ -44,12 +44,10 @@
=== examples
see 'example/posix.rb' for user/group setup works with default installation of openldap on ubuntu (just change your password as needed in the code)
-the 'example/identity_map.rb' shows the usage of identity maps, see also below.
-
== FEATURES/PROBLEMS:
* the net-ldap has some issues with not closing the connections when an exception/error got raised, with limit the search result to 126 entries which gets fixed by making consecutives searches and collect the result.
* error from the ldap server are only logged and do not raise any exceptions (to be changed in next release) with one exception: when creating a new ldap entry a duplicated entry will raise DataMapper::PersistenceError
@@ -60,11 +58,11 @@
there are three parts which makes the DN of a model, the base from the ldap conncetion, the `treebase` of the model and `dn_prefix` of an instance.
class User
include DataMapper::Resource
- property :id, Serial, :field => "uidnumber"
+ property :id, Serial, :field => "uidNumber"
dn_prefix { |user| "uid=#{user.login}"}
treebase "ou=people"
end
with a base `dc=example,dc=com` we get a DN like the user 'admin'
@@ -75,11 +73,11 @@
for example the ldap posixGroup has more attributes than the model class, it needs the `objectclass` attribute set to `posixGroup`.
class Group
include DataMapper::Resource
- property :id, Serial, :field => "gidnumber"
+ property :id, Serial, :field => "gidNumber"
property :name, String, :field => "cn"
dn_prefix { |group| "cn=#{group.name}" }
treebase "ou=groups"
ldap_properties {{ :objectclass => "posixGroup"}}
end
@@ -167,12 +165,12 @@
staying with posix example there the groups has a memberuid attribute BUT unlike with relational databases it can have multiple values. to achieve a relationship with these values the underlying adapter needs to know that this specific attribute needs to be handled differently. for this `multivalue_field` comes into play. the ldap adapter clones the model and places the each memberuid in its own clone.
class GroupUser
include DataMapper::Resource
- property :memberuid, String, :key => true
- property :gidnumber, Integer, :key => true
+ property :memberUid, String, :key => true
+ property :gidNumber, Integer, :key => true
dn_prefix { |group_user| "cn=#{group_user.group.name}" }
treebase "ou=groups"
ldap_properties do |group_user|
{:cn=>"#{group_user.group.name}", :objectclass => "posixGroup"}
end
@@ -185,17 +183,17 @@
let's say your LDAP has multiple email values for a users then you can define your resource class like that using the type *LdapArray* for such multivalue fields
class User
include DataMapper::Resource
- property :id, Serial, :field => "uidnumber"
+ property :id, Serial, :field => "uidNumber"
property :login, String, :field => "uid", :unique_index => true
property :mail, LdapArray
dn_prefix { |user| "uid=#{user.login}"}
treebase "ou=people"
ldap_properties do |user|
- properties = { :objectclass => ["inetOrgPerson", "posixAccount", "shadowAccount"], :loginshell => "/bin/bash", :gidnumber => "10000" }
+ properties = { :objectclass => ["inetOrgPerson", "posixAccount", "shadowAccount"], :loginshell => "/bin/bash", :gidNumber => "10000" }
properties
end
end
== REQUIREMENTS: