参考官方文档 13. Schema Specification
http://www.verydemo.com/demo_c161_i74426.html
https://oskb.wordpress.com/2008/08/13/openldap学习笔记转-openldap介绍/
ldapns.schema
attributetype ( 1.3.6.1.4.1.5322.17.2.1 NAME 'authorizedService'
DESC 'IANA GSS-API authorized service name'
EQUALITY caseIgnoreMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} )
attributetype ( 1.3.6.1.4.1.5322.17.2.2 NAME 'loginStatus'
DESC 'Currently logged in sessions for a user'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
ORDERING caseIgnoreOrderingMatch
SYNTAX OMsDirectoryString )
objectclass ( 1.3.6.1.4.1.5322.17.1.1 NAME 'authorizedServiceObject'
DESC 'Auxiliary object class for adding authorizedService attribute'
SUP top
AUXILIARY
MAY authorizedService )
objectclass ( 1.3.6.1.4.1.5322.17.1.2 NAME 'hostObject'
DESC 'Auxiliary object class for adding host attribute'
SUP top
AUXILIARY
MAY host )
objectclass ( 1.3.6.1.4.1.5322.17.1.3 NAME 'loginStatusObject'
DESC 'Auxiliary object class for login status attribute'
SUP top
AUXILIARY
MAY loginStatus )
my.schema
attributetype ( 1.3.6.1.4.1.30000.500.1.1.1 NAME 'active'
DESC 'MANDATORY: Account active stauts 0-disable 1-enable'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27 SINGLE-VALUE )
attributetype ( 1.3.6.1.4.1.30000.500.1.1.2 NAME 'access'
DESC 'MANDATORY: Access Control'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 )
attributetype ( 1.3.6.1.4.1.30000.500.1.1.3 NAME 'gauthcode'
DESC 'MANDATORY: Google authenticator'
EQUALITY caseExactIA5Match
SYNTAX 1.3.6.1.4.1.1466.115.121.1.26 SINGLE-VALUE )
objectclass ( 1.3.6.1.4.1.30000.500.1.2.0 NAME 'MyAccount'
SUP top
AUXILIARY
DESC 'MANDATORY: conf user account'
MUST ( active )
MAY ( access $ gauthcode $ sn $ givenName $ displayName $ mobile $ mail $ photo)
)
#1 oid使用1.3.6.1.4.1 - IANA-registered Private Enterprises,从http://www.alvestrand.no/objectid/1.3.6.1.4.1.html查询一个未经占用的。
#2 Commonly Used Syntaxes
boolean: 1.3.6.1.4.1.1466.115.121.1.7
directoryString(utf8): 1.3.6.1.4.1.1466.115.121.1.15
distinguishedName: 1.3.6.1.4.1.1466.115.121.1.15
integer: 1.3.6.1.4.1.1466.115.121.1.27
numericString: 1.3.6.1.4.1.1466.115.121.1.3
OID: 1.3.6.1.4.1.1466.115.121.1.38
octetString: 1.3.6.1.4.1.1466.115.121.1.40
#3 Commonly Used Matching Rules
booleanMatch 布尔比较
caseIgnoreMatch 忽略大小写,忽略空格
caseExactMatch 区分大小写,忽略空格
integerMatch 整型数值比较
numericStringMatch 字符型数值比较
cat > /etc/openldap/schema/my.schema << _EOF_
attributetype ( 1.3.6.1.4.1.30000.500.1.1.1 NAME 'active'
DESC 'MANDATORY: Account active stauts 0-disable 1-enable'
EQUALITY integerMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.27
SINGLE-VALUE
)
attributetype ( 1.3.6.1.4.1.30000.500.1.1.2 NAME 'access'
DESC 'Access Control: ssh vpn web ...'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
)
attributetype ( 1.3.6.1.4.1.30000.500.1.1.3 NAME 'gauthcode'
DESC 'Google authenticator'
EQUALITY caseExactMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15
SINGLE-VALUE
)
objectclass ( 1.3.6.1.4.1.30000.500.1.2.1 NAME 'myAccount'
DESC 'my user account'
SUP top
AUXILIARY
MUST ( active )
MAY ( access $ gauthcode $ sn $ givenName $ displayName $ mobile $ mail $ photo)
)
objectclass ( 1.3.6.1.4.1.30000.500.1.2.2 NAME 'hostObject'
DESC 'adding host attribute'
SUP top
AUXILIARY
MAY host
)
_EOF_
标签:
openldap
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· .NET Core 中如何实现缓存的预热?
· 从 HTTP 原因短语缺失研究 HTTP/2 和 HTTP/3 的设计差异
· AI与.NET技术实操系列:向量存储与相似性搜索在 .NET 中的实现
· 基于Microsoft.Extensions.AI核心库实现RAG应用
· Linux系列:如何用heaptrack跟踪.NET程序的非托管内存泄露
· TypeScript + Deepseek 打造卜卦网站:技术与玄学的结合
· 阿里巴巴 QwQ-32B真的超越了 DeepSeek R-1吗?
· 【译】Visual Studio 中新的强大生产力特性
· 【设计模式】告别冗长if-else语句:使用策略模式优化代码结构
· AI与.NET技术实操系列(六):基于图像分类模型对图像进行分类