OpenLDAP - Add open-ldap defined attributes to custom class

不想你离开。 提交于 2019-12-24 18:43:34

问题


I want to create an object class called request, it would have fields like requestID, requestType and timestamp (among others).

requestType is string, created like this:

attributetype ( <some oid> NAME 'requestType' DESC 'the type of the request' EQUALITY caseExactMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.44{250} )

instead of defining custom attributes requestID and timestamp I want to use the attributes defined by openldap like entryUUID and createTimestamp, so that I don't have to deal with generating a UUID or the timestamp for the request at the client side, how do I achieve that?

This is how my object class schema definition looks like right now,

objectclass ( <some oid> NAME 'request' SUP top STRUCTURAL DESC 'request' MUST ( requestType ))


回答1:


The attributes entryUUID and createTimestamp are so-called operational attributes which are added to each LDAP entry anyway. No need to add them explicitly in the schema.

However when querying your LDAP entries you have to explicitly list those attribute in your LDAP search request (e.g. at the ldapsearch command-line). Otherwise the OpenLDAP server will not return them.

BTW: I'm not sure what you're trying to achieve but did you have a look at OpenLDAP's overlay slapo-accesslog?




回答2:


If you want to set specific values to the requestID and timeStamp you must define your own attributes, you cannot use the operational attributes entryUUID and createTimestamp. These attributes are managed by the server and the values are controlled/generated by the server. They are not meant to be used as user data.

You can define attributes that have similar syntax though.



来源:https://stackoverflow.com/questions/51357686/openldap-add-open-ldap-defined-attributes-to-custom-class

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!