On 1/19/07, P. Martinez martinezino@googlemail.com wrote:
Hello List,
before i start, i am very new to directory services, therefore please be patient to me. I am with myself ;)
I am writing an custom schema - and thought about a way to mapping attributes.
attributeType ( OIDXXX NAME ( 'cn' 'commonName' ) SUP name )
Here we have two ways to query for entries - cn and commonName, right.
My question: Is is possible to construct a schema that maps attributes to another attribute of a different objectclass/schema.
Why? - Lets say an application ask for "unordinaryattributeName". Now i want to map it to cn transparently. So i need only to manipulate cn fields etc.
This idea comes to me as a flash of genius. But i hope that it is quite old and therefore possible.
Although this might be possible, (I'm not sure how many NAME's you're allowed in a schema), openldap provides mechanisms to do this already. And you wouldn't have to hijack namespace, or get into other nasty things like that.
See slapo-rwm(5) --- DESCRIPTION The rwm overlay to slapd(8) performs basic DN/data rewrite and object- Class/attributeType mapping. Its usage is mostly intended to provide virtual views of existing data either remotely, in conjunction with the proxy backend described in slapd-ldap(5), or locally, in conjunction with the relay backend described in slapd-relay(5).
Am 22.01.2007 um 15:43 schrieb matthew sporleder:
On 1/19/07, P. Martinez martinezino@googlemail.com wrote:
Hello List,
before i start, i am very new to directory services, therefore please be patient to me. I am with myself ;)
I am writing an custom schema - and thought about a way to mapping attributes.
attributeType ( OIDXXX NAME ( 'cn' 'commonName' ) SUP name )
Here we have two ways to query for entries - cn and commonName, right.
My question: Is is possible to construct a schema that maps attributes to another attribute of a different objectclass/schema.
Why? - Lets say an application ask for "unordinaryattributeName". Now i want to map it to cn transparently. So i need only to manipulate cn fields etc.
This idea comes to me as a flash of genius. But i hope that it is quite old and therefore possible.
Although this might be possible, (I'm not sure how many NAME's you're allowed in a schema), openldap provides mechanisms to do this already. And you wouldn't have to hijack namespace, or get into other nasty things like that.
See slapo-rwm(5)
Thank you.
I work with OSX and the shipped version (2.1.22) don't support rwm.
I compiled my own openldap now. With:
./configure --enable-slapd \ --enable-slurpd \ --enable-wrappers \ --enable-bdb \ --enable-hdb \ --enable-ldap \ --enable-ldbm \ --enable-ldbm-api=berkeley \ --enable-meta \ --enable-monitor \ --enable-null \ --enable-rwm \ --enable-shared \ --enable-static \ --with-pic \ --without-kerberos \ --disable-perl \ --enable-dynamic LDFLAGS="-L/usr/local/BerkeleyDB.4.3/lib" CPPFLAGS="-I/usr/local/BerkeleyDB.4.3/include"
After setting all up - i was very impressed how fast it is now (2.1.22 > 2.3.32) - compliment, by the way.
So, i added into slapd.conf:
overlay rwm map attribute labeledURI URL
before any database statement.
Doing operations on this labeledURI, URL attributes, shows me that data is showed as labeledURI and URL stays "empty". Well if i disable the overlay all data actually is stored into URL, so far okay.
I was thinking about seeing my data on both places. Internally it can be store lets say into URL. but if i search for URL _or_ labeledURI it should show the same contens. Possible ?
Thanks for hints
P.M.
openldap-software@openldap.org