原文地址: http://www.openldap.org/doc/admin24/schema.html
本章介紹了如何對(duì)OpenLDAP中的Schema進(jìn)行擴(kuò)展,閱讀本章內(nèi)容的預(yù)備知識(shí)是LDAP/X.500信息模型。在介紹對(duì)Schema如何進(jìn)行擴(kuò)展之前,介紹了發(fā)行包中的已有的Schema。
隨軟件發(fā)行的Schema文件隨軟件發(fā)行Schema文件通過(guò)在配置文件slapd.conf中include進(jìn)來(lái)即可使用。不同的發(fā)行版Schema文件的位置不一樣,UbuntuServer把Schema文件存在/etc/ldap/schema目錄。下表是隨軟件發(fā)行的Schema文件。
Schema擴(kuò)展擴(kuò)展Schema的步驟:
- 獲得Object Identifier。
- 選擇名字的前綴。
- 創(chuàng)建本地Schema文件。
- 自定義屬性類型,如果有必要。
- 自定義object classes
OID
Schema中每個(gè)element都有一個(gè)全局唯一的OID。如果一個(gè)組織分配了一個(gè)OID,假定為1.1,那么可以按照下表分配使用。
順便說(shuō)一下,我在IANA申請(qǐng)了一個(gè)Object Identifier,36688。
給elements命名
每個(gè)element都需要一個(gè)名字。名字需要向IANA申請(qǐng),當(dāng)然也可以加一個(gè)x-前綴,表明是一個(gè)私用的名字。
屬性類型
attributetype指令用來(lái)定義一個(gè)新的屬性類型。參照RFC4512。The directive uses the sameAttribute Type Description (as defined in RFC4512) used by theattributeTypes attribute found in the subschema subentry,e.g.:
attributetype<RFC4512 Attribute TypeDescription>
Attribute Type Description的定義如下:
其中whsp表示空格。Syntax和Matchrule如下表所示:
Object Class
objectclasses 指令用于定義一個(gè)新的object class。The directive uses the sameObject Class Description (as defined in RFC4512) used by theobjectClasses attribute found in the subschema subentry,e.g.:
objectclass <RFC4512Object Class Description>
Object Class Description的定義如下:
本站僅提供存儲(chǔ)服務(wù),所有內(nèi)容均由用戶發(fā)布,如發(fā)現(xiàn)有害或侵權(quán)內(nèi)容,請(qǐng)
點(diǎn)擊舉報(bào)。