[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: options to maintain computed attributes?



Jephte Clain wrote:
> Le 04/12/2015 15:30, Michael Ströder a écrit :
>> Jephte Clain wrote:
>>> I may have a need soon to implement "computed" attributes in LDAP, to
>>> accommodate dumb clients that are unable to properly update the database
>>>
>>> for example, an attribute masterAttr may have values like "A:B" (its value
>>> updated by the dumb client), but other clients need the A or B part separately.
>>> So whenever masterAttr is updated with value "A:B", firstPartAttr have to be
>>> updated with "A" and secondPartAttr with "B"
> thank you for your response,
> 
>> Note that splitting the value pairs into distinct attributes within the same
>> entry does not work for multi-valued attributes.
> what do you mean? if masterAttr, firstPartAttr and secondPartAttr are
> multivalued, shouldn't it be possible?
> I mean, with:
> masterAttr: A:B
> masterAttr: A:C
> 
> I would get:
> firstPartAttr: A
> firstPartAttr: A
> secondPartAttr: B
> secondPartAttr: C
> 
> Or am I missing something? Would the *PartAttr attributes have to have special
> syntax to allow duplicate values?

Strictly speaking it's an information loss.

You can of course do that if the value pairing has no special meaning/relation
in your deployment.

>>> - using back-sock as an overlay to monitor modifications and update the modified
>>> objects accordingly?
>> Yes. Not the best performance though. And you need a recent OpenLDAP release
>> with back-sock fixes.
>>
>>> - a script that monitor the accesslog database and update the modified objects
>>> accordingly?
>> Yes.
>>
>>> - biting the bullet and writing an overlay myself?
>> Yes, most probably gives the best performance.
> OK. So what do you recommend?
> I know a bit of C, but I haven't written in that language for some years now
> (the last thing I wrote was a plugin for PostgreSQL)
> I could use some help, especially where to start? I have trouble finding docs
> about native plugins.

I'm also not a C developer, so I wrote a back-sock listener in Python.

If you want to implement a native overlay it might be useful to have a look at
the sources of various small overlays in contrib/slapd-modules/.

YMMV.

Ciao, Michael.

Attachment: smime.p7s
Description: S/MIME Cryptographic Signature