1SLAPO-CONSTRAINT(5)           File Formats Manual          SLAPO-CONSTRAINT(5)
2
3
4

NAME

6       slapo-constraint - Attribute Constraint Overlay to slapd
7

SYNOPSIS

9       /etc/openldap/slapd.conf
10

DESCRIPTION

12       The  constraint  overlay  is used to ensure that attribute values match
13       some constraints beyond basic LDAP syntax.  Attributes can have  multi‐
14       ple  constraints placed upon them, and all must be satisfied when modi‐
15       fying an attribute value under constraint.
16
17       This overlay is intended to be used to force syntactic regularity  upon
18       certain  string represented data which have well known canonical forms,
19       like telephone numbers, post codes, FQDNs, etc.
20
21       It constrains only LDAP add, modify and rename commands and only  seeks
22       to control the add and replace values of modify and rename requests.
23
24       No constraints are applied for operations performed with the relax con‐
25       trol set.
26

CONFIGURATION

28       This slapd.conf option applies to the constraint  overlay.   It  should
29       appear after the overlay directive.
30
31       constraint_attribute  <attribute_name>[,...]  <type>  <value>  [<extra>
32       [...]]
33              Specifies the constraint which should apply to  the  comma-sepa‐
34              rated attribute list named as the first parameter.  Six types of
35              constraint are currently  supported  -  regex,  negregex,  size,
36              count, uri, and set.
37
38              The  parameter  following  the  regex or negregex type is a Unix
39              style regular expression (See regex(7) ). The parameter  follow‐
40              ing the uri type is an LDAP URI. The URI will be evaluated using
41              an internal search.  It must not include a hostname, and it must
42              include a list of attributes to evaluate.
43
44              The  parameter following the set type is a string that is inter‐
45              preted according to the syntax in use for ACL sets.  This allows
46              one to construct constraints based on the contents of the entry.
47
48              The  size  type  can  be used to enforce a limit on an attribute
49              length, and the count type limits the number of values of an at‐
50              tribute.
51
52              Extra  parameters  can  occur in any order after those described
53              above.
54
55              <extra> : restrict=<uri>
56
57              This extra parameter allows one to restrict the  application  of
58              the  corresponding  constraint  only  to  entries that match the
59              base, scope and filter portions of the LDAP URI.  The  base,  if
60              present, must be within the naming context of the database.  The
61              scope is only used when the base  is  present;  it  defaults  to
62              base.  The other parameters of the URI are not allowed.
63
64
65       Any  attempt  to  add  or modify an attribute named as part of the con‐
66       straint overlay specification which does not fit the constraint  listed
67       will fail with a LDAP_CONSTRAINT_VIOLATION error.
68

EXAMPLES

70              overlay constraint
71              constraint_attribute jpegPhoto size 131072
72              constraint_attribute userPassword count 3
73              constraint_attribute mail regex ^[[:alnum:]]+@mydomain.com$
74              constraint_attribute mail negregex ^[[:alnum:]]+@notallowed.com$
75              constraint_attribute title uri
76                ldap:///dc=catalog,dc=example,dc=com?title?sub?(objectClass=titleCatalog)
77              constraint_attribute cn,sn,givenName set
78                "(this/givenName + [ ] + this/sn) & this/cn"
79                restrict="ldap:///ou=People,dc=example,dc=com??sub?(objectClass=inetOrgPerson)"
80
81       A  specification  like  the above would reject any mail attribute which
82       did not look like <alphanumeric string>@mydomain.com or that looks like
83       <alphanumeric  string>@notallowed.com.   It would also reject any title
84       attribute whose values were not listed in the title  attribute  of  any
85       titleCatalog  entries  in  the  given  scope.  (Note that the "dc=cata‐
86       log,dc=example,dc=com" subtree ought to reside in a separate  database,
87       otherwise  the  initial  set of titleCatalog entries could not be popu‐
88       lated while the constraint is in effect.)   Finally,  it  requires  the
89       values  of  the attribute cn to be constructed by pairing values of the
90       attributes sn and givenName, separated by a space, but only for entries
91       derived from the objectClass inetOrgPerson.
92

FILES

94       /etc/openldap/slapd.conf
95              default slapd configuration file
96

SEE ALSO

98       slapd.conf(5), slapd-config(5),
99

ACKNOWLEDGEMENTS

101       This  module  was written in 2005 by Neil Dunbar of Hewlett-Packard and
102       subsequently extended by Howard Chu  and  Emmanuel  Dreyfus.   OpenLDAP
103       Software   is   developed   and  maintained  by  The  OpenLDAP  Project
104       <http://www.openldap.org/>.  OpenLDAP Software is derived from the Uni‐
105       versity of Michigan LDAP 3.3 Release.
106
107
108
109OpenLDAP 2.6.6                    2023/07/31               SLAPO-CONSTRAINT(5)
Impressum