openldap/doc/man/man5/slapo-constraint.5

111 lines
3.2 KiB
Groff
Raw Normal View History

2006-04-29 18:03:36 +08:00
.TH SLAPO-CONSTRAINT 5 "RELEASEDATE" "OpenLDAP LDVERSION"
.\" Copyright 2005-2006 Hewlett-Packard Company
2008-01-08 08:19:56 +08:00
.\" Copyright 2006-2008 The OpenLDAP Foundation All Rights Reserved.
2006-04-29 18:03:36 +08:00
.\" Copying restrictions apply. See COPYRIGHT/LICENSE.
.\" $OpenLDAP$
2006-04-29 18:03:36 +08:00
.SH NAME
slapo-constraint \- Attribute Constraint Overlay to slapd
2006-04-29 18:03:36 +08:00
.SH SYNOPSIS
ETCDIR/slapd.conf
.SH DESCRIPTION
The constraint overlay is used to ensure that attribute values match
some constraints beyond basic LDAP syntax. Attributes can
2006-04-29 18:03:36 +08:00
have multiple constraints placed upon them, and all must be satisfied
when modifying an attribute value under constraint.
.LP
This overlay is intended to be used to force syntactic regularity upon
certain string represented data which have well known canonical forms,
like telephone numbers, post codes, FQDNs, etc.
.LP
It constrains only LDAP adds and modify commands and only seeks to
control the add and modify value of a modify request.
2006-04-29 18:03:36 +08:00
.SH CONFIGURATION
This
.B slapd.conf
option applies to the constraint overlay.
It should appear after the
.B overlay
directive.
.TP
2008-09-17 08:40:18 +08:00
.B constraint_attribute <attribute_name>[,...] <type> <value>
2006-04-29 18:03:36 +08:00
Specifies the constraint which should apply to the attribute named as
the first parameter.
Two types of constraint are currently supported -
2008-09-17 08:40:18 +08:00
.BR regex ,
.BR size ,
.BR count ,
.BR uri ,
and
2008-09-17 08:40:18 +08:00
.BR set .
2006-04-29 18:03:36 +08:00
The parameter following the
.B regex
2006-04-29 18:03:36 +08:00
type is a Unix style regular expression (See
.BR regex (7)
). The parameter following the
.B uri
type is an LDAP URI. The URI will be evaluated using an internal search.
It must not include a hostname, and it must include a list of attributes
to evaluate.
2006-04-29 18:03:36 +08:00
2008-09-17 08:40:18 +08:00
The parameter following the
.B set
type is a string that is interpreted according to the syntax in use
for ACL sets. This allows to construct constraints based on the contents
of the entry.
The
.B size
2008-09-17 05:38:12 +08:00
type can be used to enforce a limit on an attribute length, and the
.B count
2008-09-17 05:38:12 +08:00
type limits the number of values of an attribute.
2006-04-29 18:03:36 +08:00
Any attempt to add or modify an attribute named as part of the
constraint overlay specification which does not fit the
constraint listed will fail with a
2006-04-29 18:03:36 +08:00
LDAP_CONSTRAINT_VIOLATION error.
.SH EXAMPLES
.LP
.RS
.nf
overlay constraint
constraint_attribute jpegPhoto size 131072
constraint_attribute userPassword count 3
2006-04-29 18:03:36 +08:00
constraint_attribute mail regex ^[:alnum:]+@mydomain.com$
constraint_attribute title uri
ldap:///dc=catalog,dc=example,dc=com?title?sub?(objectClass=titleCatalog)
2008-09-17 08:40:18 +08:00
constraint_attribute cn,sn,givenName set
"(this/givenName + [ ] + this/sn) & this/cn"
.fi
2006-04-29 18:03:36 +08:00
2008-09-17 08:40:18 +08:00
.RE
2006-04-29 18:03:36 +08:00
A specification like the above would reject any
.B mail
2006-04-29 18:03:36 +08:00
attribute which did not look like
.BR "<alpha-numeric string>@mydomain.com" .
It would also reject any
.B title
attribute whose values were not listed in the
.B title
attribute of any
.B titleCatalog
entries in the given scope.
2008-09-17 08:40:18 +08:00
Finally, it requires the values of the attribute
.B cn
to be constructed by pairing values of the attributes
.B sn
and
.BR givenName ,
separated by a space.
.RE
2006-04-29 18:03:36 +08:00
.SH FILES
.TP
ETCDIR/slapd.conf
default slapd configuration file
.SH SEE ALSO
.BR slapd.conf (5).
.SH ACKNOWLEDGEMENTS
This module was written in 2005 by Neil Dunbar of Hewlett-Packard and subsequently
extended by Howard Chu and Emmanuel Dreyfus.
.so ../Project