`
holdbelief
  • 浏览: 695846 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

LDAP Schema的概念和基本要素

    博客分类:
  • LDAP
 
阅读更多

Schema是LDAP的一个重要组成部分,类似于数据库的模式定义,LDAP的Schema定义了LDAP目录所应遵循的结构和规则,比如一个 objectclass会有哪些属性,这些属性又是什么结构等等,schema给LDAP服务器提供了LDAP目录中类别,属性等信息的识别方式,让这些可以被LDAP服务器识别。
    在LDAP的schema中,有四个重要的元素:
    1. Objectclass
    objectclass定义了一个类别,这个类别会被不同的目录(在LDAP中就是一个Entry)用到,它说明了该目录应该有哪些属性,哪些属性是必须的,哪些又是可选的。一个objectclass的定义包括名称(NAME),说明(DESC),类型(STRUCTURAL或AUXILARY ,表示是结构型的还是辅助型的),必须属性(MUST),可选属性(MAY)等信息。

      在BAP产品中,有下面几种类别

Java代码 复制代码 收藏代码
  1. # GalaxyTitle    
  2. objectclass ( 2.16.840.1.153730.3.4.2  
  3.     NAME 'GalaxyTitle'  
  4.     DESC 'GalaxyTitle use to manage title'  
  5.     SUP top   
  6.     STRUCTURAL   
  7.         MUST ( uid )   
  8.     MAY (   
  9.          sortid )   
  10.     )     
  11.        
  12. # GalaxyPost    
  13. objectclass ( 2.16.840.1.153730.3.4.32  
  14.     NAME 'GalaxyPost'  
  15.     DESC 'GalaxyPost use to manage post'  
  16.     SUP top   
  17.     STRUCTURAL   
  18.         MUST ( uid )   
  19.     MAY (   
  20.          sortid $ type )   
  21.     )    
  22.   
  23. # GalaxyDuty   
  24. objectclass ( 2.16.840.1.153730.3.4.22  
  25.     NAME 'GalaxyDuty'  
  26.     DESC 'GalaxyDuty use to manage duty'  
  27.     SUP top   
  28.     STRUCTURAL   
  29.         MUST ( dutyuid )   
  30.     MAY (   
  31.          sortid )   
  32.     )    
  33.   
  34.   
  35. # GalaxyGroup    
  36. objectclass ( 2.16.840.1.153730.3.2.12  
  37.     NAME 'GalaxyGroup'  
  38.     DESC 'GalaxyGroup use to manage group'  
  39.     SUP top   
  40.     STRUCTURAL   
  41.     MUST ( uid )   
  42.     MAY (   
  43.         sysid $ employeeids $ sortid $ groupType $ searchCondition $ groupManager $ telephone $   
  44.         email $ gfax $ others1 $ others2 $   
  45.         others3 $  uniqueMember $ searchConditionXml)   
  46.     )     
  47.   
  48.   
  49.   
  50. # GalaxyPeople   
  51. objectclass ( 2.16.840.1.153730.3.2.22  
  52.     NAME 'GalaxyPeople'  
  53.     DESC 'GalaxyPeople use to manage people'  
  54.     SUP InetOrgPerson   
  55.     STRUCTURAL   
  56.     MAY (   
  57.         otherDepartmentNumber  $ sortid   $  ifactivated  $  peopleLevel $ leadermember $ leaderFilter $ title $ post $ globalsortid $  virtualaccount   
  58.         )   
  59.     )    
  60.          
  61.        
  62. # GalaxyOrganization    
  63. objectclass ( 2.16.840.1.153730.3.2.2  
  64.     NAME 'GalaxyOrganization'  
  65.     DESC 'GalaxyOrganization use to manage dep'  
  66.     SUP top   
  67.     STRUCTURAL   
  68.         MUST ( uid )   
  69.     MAY (   
  70.         sysid $ employeeids $ sortid $ depmanager $ telephone $   
  71.         email $ gfax $ others1 $ others2 $   
  72.         others3 $ depmanagerFilter $ title $ post)   
  73.     )     
  74.   
  75.   
  76.        
  77. # GalaxyContainer    
  78. objectclass ( 2.16.840.1.153730.3.2.16  
  79.     NAME 'GalaxyContainer'  
  80.     DESC 'a container,can fill with people,org,group...'  
  81.     SUP top   
  82.     STRUCTURAL   
  83.         MUST ( cn )   
  84.     )       
  85.         
  86. # GalaxyLevel    
  87. objectclass ( 2.16.840.1.153730.3.3.18  
  88.     NAME 'GalaxyLevel'  
  89.     DESC 'level inof'  
  90.     SUP top   
  91.     STRUCTURAL   
  92.         MUST ( cn $ number )   
  93.     )      
  94.        
  95.        
  96. # GalaxyAttOfPeople    
  97. objectclass ( 2.16.840.1.153730.3.3.19  
  98.     NAME 'GalaxyAttOfPeople'  
  99.     DESC 'att name and sn'  
  100.     SUP top   
  101.     STRUCTURAL   
  102.         MUST ( sn $ cn )   
  103.     )        
# GalaxyTitle 
objectclass	( 2.16.840.1.153730.3.4.2
    NAME 'GalaxyTitle'
	DESC 'GalaxyTitle use to manage title'
    SUP top
    STRUCTURAL
        MUST ( uid )
	MAY (
		 sortid )
	)  
	
# GalaxyPost 
objectclass	( 2.16.840.1.153730.3.4.32
    NAME 'GalaxyPost'
	DESC 'GalaxyPost use to manage post'
    SUP top
    STRUCTURAL
        MUST ( uid )
	MAY (
		 sortid $ type )
	) 

# GalaxyDuty
objectclass	( 2.16.840.1.153730.3.4.22
    NAME 'GalaxyDuty'
	DESC 'GalaxyDuty use to manage duty'
    SUP top
    STRUCTURAL
        MUST ( dutyuid )
	MAY (
		 sortid )
	) 


# GalaxyGroup 
objectclass	( 2.16.840.1.153730.3.2.12
    NAME 'GalaxyGroup'
	DESC 'GalaxyGroup use to manage group'
    SUP top
    STRUCTURAL
    MUST ( uid )
	MAY (
		sysid $ employeeids $ sortid $ groupType $ searchCondition $ groupManager $ telephone $
		email $ gfax $ others1 $ others2 $
		others3 $  uniqueMember $ searchConditionXml)
	)  



# GalaxyPeople
objectclass	( 2.16.840.1.153730.3.2.22
    NAME 'GalaxyPeople'
	DESC 'GalaxyPeople use to manage people'
    SUP InetOrgPerson
    STRUCTURAL
	MAY (
		otherDepartmentNumber  $ sortid   $  ifactivated  $  peopleLevel $ leadermember $ leaderFilter $ title $ post $ globalsortid $  virtualaccount
	    )
	) 
	  
	
# GalaxyOrganization 
objectclass	( 2.16.840.1.153730.3.2.2
    NAME 'GalaxyOrganization'
	DESC 'GalaxyOrganization use to manage dep'
    SUP top
    STRUCTURAL
        MUST ( uid )
	MAY (
		sysid $ employeeids $ sortid $ depmanager $ telephone $
		email $ gfax $ others1 $ others2 $
		others3 $ depmanagerFilter $ title $ post)
	)  


	
# GalaxyContainer 
objectclass	( 2.16.840.1.153730.3.2.16
    NAME 'GalaxyContainer'
	DESC 'a container,can fill with people,org,group...'
    SUP top
    STRUCTURAL
        MUST ( cn )
    )    
     
# GalaxyLevel 
objectclass	( 2.16.840.1.153730.3.3.18
    NAME 'GalaxyLevel'
	DESC 'level inof'
    SUP top
    STRUCTURAL
        MUST ( cn $ number )
    )  	
    
    
# GalaxyAttOfPeople 
objectclass	( 2.16.840.1.153730.3.3.19
    NAME 'GalaxyAttOfPeople'
	DESC 'att name and sn'
    SUP top
    STRUCTURAL
        MUST ( sn $ cn )
    )      

  
    2. Attribute
    attribute就是一个上面objectclass中可能包含的属性,对其的定义包括名称,数据类型,单值还是多值以及匹配规则等。后面用具体的例子来说明。
    3. Syntax
    syntax是LDAP中的“语法”,其实就是LDAP中会用到的数据类型和数据约束,这个语法是遵从X.500中数据约束的定义的。其定义需要有一个ID(遵从X.500)以及说明(DESP)
    4. Matching Rules
    是用来指定某属性的匹配规则,实际上就是定义一个特殊的Syntax的别名,让LDAP服务器可以识别,并对定义的属性进行匹配。
    LDAP的schema的主要元素就是这些了,下面列举出了一些LDAP规定好的或是现在比较通用的schema,一般的LDAP服务器都应该可以识别这些定义。
    这就是一个名为subschema的objectclass的定义:
    (2.5.20.1 NAME 'subschema'  AUXILIARY
     MAY ( dITStructureRules $ nameForms $ ditContentRules $
                 objectClasses $ attributeTypes $ matchingRules $ matchingRuleUse ) )
    首先是ID,这里是2.5.20.1,接着是NAME,AUXILIARY说明是辅助型,之后是可选属性的定义,subschema中没有定义必须属性,如果需要定义,应该和MAY一样,将属性放在MUST()中并用$隔开
  
    再来看一个属性定义:
    ( 2.5.4.3 NAME 'cn' SUP name EQUALITY caseIgnoreMatch )
  可以看到cn属性的父属性是name,它相等性匹配于caseIgnoreMatch(匹配原则为EQUALITY,还有如SUBSTR是字符串匹配,ORDERING是顺序匹配)
  
    syntax定义一般都比较简单,如:
    ( 1.3.6.1.4.1.1466.115.121.1.6  DESC  'String' )
    这个定义说明,这一串数字1.3.6.1.4.1.1466.115.121.1.5就代表了LDAP中的字符串,这个数字串的定义和X.500相关,包括了它的存储方式,所占空间大小等。

    最后看看Matching Rule的例子,前面提到了caseIgnoreMatch,就看他的吧
  ( 2.5.13.2 NAME 'caseIgnoreMatch'
      SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )  
    其实1.3.6.1.4.1.1466.115.121.1.15 就是LDAP数据类型Directory String的ID,说明前面的cn需要等于这个数据类型才有效。
    还有很多常用schema的定义都在了RFC2252中,LDAP服务器都应该支持这些基本的schema。好了,现在基本对LDAP中的schema有个一个大致的说明,可能有不到位或不妥之处,还望大家指正。

分享到:
评论

相关推荐

    LDAP_Schema的概念和基本要素

    Schema是LDAP的一个重要组成部分,类似于数据库的模式定义,LDAP的Schema定义了LDAP目录所应遵循的结构和规则,比如一个 objectclass会有哪些属性,这些属性又是什么结构等等,schema给LDAP服务器提供了LDAP目录中...

    LDAP的概念和原理

    LDAP的概念和原理介绍了LDAP基本概念和基本原理,LDAP现在比较普遍应用在企业查询上的应用,速度比较快

    LDAP基本概念和基础

    ldap基本概念的系统介绍,入门级别的实用手册

    LDAP协议基础概念

    从数据结构上阐述LDAP,它是一个树型结构,能有效明确的描述一个组织结构特性的相关信息。在这个树型结构上的每个节点,我们称之为“条目(Entry)”,每个条目有自己的唯一可区别的名称(Distinguished Name ,DN)...

    LDAP SCHEMA DESIGN

    ldap模式设计,介绍有关LDAP的模式设计的相关问题与算法,思路.

    对LDAP的基本操作(Spring-ldap)+Ext实现显示LDAP的树状结构

    rar包:一个Web工程, 主要有,利用Spring-ldap对LDAP的基本操作(查询,增删改);Extjs实现的对Ldap的树状结构的显示,结构有点类似Softerra LDAP;一个测试类。 pdf:spring-ldap-reference.pdf Extjs.pdf ...

    LDAP_-_概念、体系结构和设计

    LDAP_-_概念、体系结构和设计 LDAP_-_概念、体系结构和设计

    owncloud-ldap-schema:OwnCloud配额的LDAP模式

    OwnCloud的LDAP架构参考: : ownCloud架构OwnCloud Inc.已注册 ,我们对其进行了扩展以定义所需的LDAP对象OID :1.3.6.1.4.1.39430.1.2.1 ObjectClass :ownCloud配额字段ownCloud可以读取LDAP属性并根据其值设置...

    openldap,ldapbrowser,mozillaOrgPerson.schema

    资源包括 LdapBrowser282 openldap2.2.29 thunderbird 用的schema mozillaOrgPerson.schema

    LdapBrowser2.82版和LDAP使用手册

    LdapBrowser2.82版,能浏览服务器的ldap数据,还有一份word详细使用文档及ldap安装说明

    LDAP入門LDAP入門LDAP入門

    LDAP入門,LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門LDAP入門

    LDAP和SVN集成

    inux下LDAP ServerClient配置 --OpenLDAP

    java连接LDAP的jar包和实例

    java连接LDAP实例和jar包,里面包含ssl连接和更改LDAP属性的例子,公参考

    spring boot集成ldap

    项目中使用spring boot框架集成了ldap协议的方法,调用了增删改查的API,基本实现了spring boot对于ldap的所有方法,只要搭建好了ldap服务器,改一下配置文件即可运行。

    LDAP轻量级目录访问协议

    LDAP的基本概念LDAP是轻量目录访问协议(Lightweight Directory Access Protocol)的缩写,是一种基于 客户机/服务器模式的目录服务访问协议.其实是一话号码簿,LDAP是一种特殊的数据库。LDAP目录的优势LDAP协议是跨...

    ldap 浏览器 LdapBrowser282

    LdapBrowser282 ldap浏览器 LdapBrowser 查看openldap的好工具。 使用需要有JDK环境。

    java连接和验证ldap文档

    java连接和验证的ldap学习文档,密码的校验,通过jndi连接ldap服务

    LDAP使用手册

    LDAP使用手册,介绍LDAP的概念和编程技术,相关API的应用

    什么是LDAP连接工具?如何利用好它.docx

    它提供了一个直观的界面,可以浏览和编辑LDAP目录,并支持多种LDAP服务器。 ## 4. LdapAdmin LdapAdmin是一个LDAP浏览器和编辑器。它提供了一个简单的用户界面,可以浏览和编辑LDAP目录,同时支持多种LDAP服务器。...

    LDAP服务器.pdf

    1 LDAP 基础 LDAP 的英文全称是 Lightweight Directory Access Protocol, 一般都简称为 LDAP。 它是基于 X.500 标准的,但是简单多了并且可以根据需要定制。与 X.500 不同,LDAP 支 持 TCP/IP,这对访问 Internet ...

Global site tag (gtag.js) - Google Analytics