Hello
I'd like to use the slapo-dynlist overlay, to generate an automatically updated list of attributes onan object. My problem is that I want the attribute name to be different than the original:
I have
dn: cn=list,o=home objectClass: groupOfURLs cn: list memberURL: ldap:///o=home?foo?sub?(objectClass=fooClass)
In slapd.conf: overlay dynlist dynlist-attrset groupOfURLs memberURL
A search on cn=list,o=home gives me: dn: cn=list,o=home objectClass: groupOfURLs cn: list foo: value1 foo: value2 foo; value3 ...
But I would like it to be displayed that way: dn: cn=list,o=home objectClass: groupOfURLs cn: list bar: value1 bar: value2 bar; value3 ...
It seems this is not possible with current software (please correct me if I'm wrong). I propose a contribution to slapo-dynlist, to include attribute name remapping capability. In the config file, this qould be configured by extending the member-ad parameter:
overlay dynlist dynlist-attrset groupOfURLs memberURL foo:bar
Of course, for backward compatibility, dynlist-attrset groupOfURLs memberURL foo would still be equivalent to dynlist-attrset groupOfURLs memberURL foo:dn
Opinions?
Emmanuel Dreyfus wrote:
Hello
I'd like to use the slapo-dynlist overlay, to generate an automatically updated list of attributes onan object. My problem is that I want the attribute name to be different than the original:
I have
dn: cn=list,o=home objectClass: groupOfURLs cn: list memberURL: ldap:///o=home?foo?sub?(objectClass=fooClass)
In slapd.conf: overlay dynlist dynlist-attrset groupOfURLs memberURL
A search on cn=list,o=home gives me: dn: cn=list,o=home objectClass: groupOfURLs cn: list foo: value1 foo: value2 foo; value3 ...
But I would like it to be displayed that way: dn: cn=list,o=home objectClass: groupOfURLs cn: list bar: value1 bar: value2 bar; value3 ...
It seems this is not possible with current software (please correct me if I'm wrong).
You can already do this, if I understand what you are trying to do:
dynlist-attrset groupOfURLs memberURL foo
and miss out foo from:
memberURL: ldap:///o=home??sub?(objectClass=fooClass)
See the man page:
"In this case, the <attrs> portion of the URI must be absent,and the DNs of all the entries resulting from the expansion of the URI are listed as values of this attribute."
Is that what you are after?
Gavin Henry ghenry@OpenLDAP.org wrote:
dynlist-attrset groupOfURLs memberURL foo
and miss out foo from:
memberURL: ldap:///o=home??sub?(objectClass=fooClass)
See the man page:
"In this case, the <attrs> portion of the URI must be absent,and the DNs of all the entries resulting from the expansion of the URI are listed as values of this attribute."
You get the DN of the returned entries in foo, not the values of the attributes.
I'll try to give a more complete example. I have this: dn: cn=buz1,o=home objectClass: fooClass cn: buz1 foo: value1
dn: cn=buz2,o=home objectClass: fooClass cn: buz2 foo: value2
dn: cn=buz3,o=home objectClass: fooClass cn: buz3 foo: value3
dn: cn=list,o=home objectClass: groupOfURLs cn: list memberURL: ldap:///o=home?foo?sub?(objectClass=fooClass)
When looking up cn=list,o=home, I would like to have the foo attribute values listed as bar attributes: dn: cn=list,o=home objectClass: groupOfURLs cn: list bar: value1 bar: value2 bar: value3
If I configure as you suggest dynlist-attrset groupOfURLs memberURL foo
I'll get this: dn: cn=list,o=home objectClass: groupOfURLs cn: list bar: cn=buz1,o=home bar: cn=buz2,o=home bar: cn=buz3,o=home
Emmanuel Dreyfus wrote:
Hello
I'd like to use the slapo-dynlist overlay, to generate an automatically updated list of attributes onan object. My problem is that I want the attribute name to be different than the original:
I have
dn: cn=list,o=home objectClass: groupOfURLs cn: list memberURL: ldap:///o=home?foo?sub?(objectClass=fooClass)
In slapd.conf: overlay dynlist dynlist-attrset groupOfURLs memberURL
A search on cn=list,o=home gives me: dn: cn=list,o=home objectClass: groupOfURLs cn: list foo: value1 foo: value2 foo; value3 ...
But I would like it to be displayed that way: dn: cn=list,o=home objectClass: groupOfURLs cn: list bar: value1 bar: value2 bar; value3 ...
It seems this is not possible with current software (please correct me if I'm wrong). I propose a contribution to slapo-dynlist, to include attribute name remapping capability. In the config file, this qould be configured by extending the member-ad parameter:
overlay dynlist dynlist-attrset groupOfURLs memberURL foo:bar
Of course, for backward compatibility, dynlist-attrset groupOfURLs memberURL foo would still be equivalent to dynlist-attrset groupOfURLs memberURL foo:dn
The modification you propose could make sense, but I believe it could be more general if more than one attribute could be mapped. The behavior in case an optional arg#3 is added to the dynlist-attrset statement should be viewed as something different: it is basically intended to make slapo-dynlist implement dynamic groups, that's why it expands to the dn. To obtain what you mean, the syntax should rather be something like
dynlist-attrset groupOfURLs memberURL [foo:]bar [...]
where if [foo:] is absent, [dn:] is used instead. Any further attribute pair, if present, would be mapped as well.
I suggest you file an ITS for this proposed enhancement.
p.
Ing. Pierangelo Masarati OpenLDAP Core Team
SysNet s.r.l. via Dossi, 8 - 27100 Pavia - ITALIA http://www.sys-net.it --------------------------------------- Office: +39 02 23998309 Mobile: +39 333 4963172 Email: pierangelo.masarati@sys-net.it ---------------------------------------
Pierangelo Masarati ando@sys-net.it wrote:
dynlist-attrset groupOfURLs memberURL [foo:]bar [...] where if [foo:] is absent, [dn:] is used instead. Any further attribute pair, if present, would be mapped as well. I suggest you file an ITS for this proposed enhancement.
Sure, but I need to implement it first.
Pierangelo Masarati ando@sys-net.it wrote:
dynlist-attrset groupOfURLs memberURL [foo:]bar [...]
where if [foo:] is absent, [dn:] is used instead. Any further attribute pair, if present, would be mapped as well.
I suggest you file an ITS for this proposed enhancement.
Here it is, with a patch implementing the feature: ITS #5466 http://www.openldap.org/its/index.cgi/Incoming?id=5466;page=1
Feedback is welcome.