]> git.sur5r.net Git - openldap/blob - doc/man/man5/slapd-relay.5
ba011de055d5a5c989f7d99719b9af91bd5f9525
[openldap] / doc / man / man5 / slapd-relay.5
1 .TH SLAPD-RELAY 5 "RELEASEDATE" "OpenLDAP LDVERSION"
2 .\" Copyright 1998-2015 The OpenLDAP Foundation All Rights Reserved.
3 .\" Copying restrictions apply.  See COPYRIGHT/LICENSE.
4 .\" $OpenLDAP$
5 .SH NAME
6 slapd\-relay \- relay backend to slapd
7 .SH SYNOPSIS
8 ETCDIR/slapd.conf
9 .SH DESCRIPTION
10 The primary purpose of this
11 .BR slapd (8)
12 backend is to map a naming context defined in a database 
13 running in the same 
14 .BR slapd (8)
15 instance into a virtual naming context, with attributeType
16 and objectClass manipulation, if required.
17 It requires the
18 .BR slapo\-rwm (5)
19 overlay.
20 .LP
21 This backend and the above mentioned overlay are experimental.
22 .SH CONFIGURATION
23 The following
24 .B slapd.conf
25 directives apply to the relay backend database.
26 That is, they must follow a "database relay" line and come before any
27 subsequent "backend" or "database" lines.
28 Other database options are described in the
29 .BR slapd.conf (5)
30 manual page; only the
31 .B suffix
32 directive is allowed by the 
33 .I relay
34 backend.
35 .TP
36 .B relay <real naming context>
37 The naming context of the database that is presented 
38 under a virtual naming context.
39 The presence of this directive implies that one specific database,
40 i.e. the one serving the
41 .BR "real naming context" ,
42 will be presented under a virtual naming context.
43
44 .SH MASSAGING
45 The
46 .B relay
47 database does not automatically rewrite the naming context
48 of requests and responses.
49 For this purpose, the
50 .BR slapo\-rwm (5)
51 overlay must be explicitly instantiated, and configured
52 as appropriate.
53 Usually, the
54 .B rwm\-suffixmassage
55 directive suffices if only naming context rewriting is required.
56
57 .SH ACCESS RULES
58 One important issue is that access rules are based on the identity
59 that issued the operation.
60 After massaging from the virtual to the real naming context, the
61 frontend sees the operation as performed by the identity in the
62 real naming context.
63 Moreover, since
64 .B back\-relay
65 bypasses the real database frontend operations by short-circuiting
66 operations through the internal backend API, the original database
67 access rules do not apply but in selected cases, i.e. when the
68 backend itself applies access control.
69 As a consequence, the instances of the relay database must provide
70 own access rules that are consistent with those of the original
71 database, possibly adding further specific restrictions.
72 So, access rules in the
73 .B relay
74 database must refer to identities in the real naming context.
75 Examples are reported in the EXAMPLES section.
76
77 .SH SCENARIOS
78 .LP
79 If no
80 .B relay
81 directive is given, the 
82 .I relay
83 database does not refer to any specific database, but the most
84 appropriate one is looked-up after rewriting the request DN
85 for the operation that is being handled.
86 .LP
87 This allows to write carefully crafted rewrite rules that
88 cause some of the requests to be directed to one database, and
89 some to another; e.g., authentication can be mapped to one 
90 database, and searches to another, or different target databases
91 can be selected based on the DN of the request, and so.
92 .LP
93 Another possibility is to map the same operation to different 
94 databases based on details of the virtual naming context,
95 e.g. groups on one database and persons on another.
96 .LP
97 .SH EXAMPLES
98 To implement a plain virtual naming context mapping
99 that refers to a single database, use
100 .LP
101 .nf
102   database                relay
103   suffix                  "dc=virtual,dc=naming,dc=context"
104   relay                   "dc=real,dc=naming,dc=context"
105   overlay                 rwm
106   rwm\-suffixmassage       "dc=real,dc=naming,dc=context"
107 .fi
108 .LP
109 To implement a plain virtual naming context mapping
110 that looks up the real naming context for each operation, use
111 .LP
112 .nf
113   database                relay
114   suffix                  "dc=virtual,dc=naming,dc=context"
115   overlay                 rwm
116   rwm\-suffixmassage       "dc=real,dc=naming,dc=context"
117 .fi
118 .LP
119 This is useful, for instance, to relay different databases that
120 share the terminal portion of the naming context (the one that
121 is rewritten).
122 .LP
123 To implement the old-fashioned suffixalias, e.g. mapping
124 the virtual to the real naming context, but not the results
125 back from the real to the virtual naming context, use
126 .LP
127 .nf
128   database                relay
129   suffix                  "dc=virtual,dc=naming,dc=context"
130   relay                   "dc=real,dc=naming,dc=context"
131   overlay                 rwm
132   rwm\-rewriteEngine       on
133   rwm\-rewriteContext      default
134   rwm\-rewriteRule         "dc=virtual,dc=naming,dc=context"
135                           "dc=real,dc=naming,dc=context" ":@"
136   rwm\-rewriteContext      searchFilter
137   rwm\-rewriteContext      searchEntryDN
138   rwm\-rewriteContext      searchAttrDN
139   rwm\-rewriteContext      matchedDN
140 .fi
141 .LP
142 Note that the 
143 .BR slapo\-rwm (5)
144 overlay is instantiated, but the rewrite rules are written explicitly,
145 rather than automatically as with the
146 .B rwm\-suffixmassage
147 statement, to map all the virtual to real naming context data flow,
148 but none of the real to virtual.
149 .LP
150 Access rules:
151 .LP
152 .nf
153   database                mdb
154   suffix                  "dc=example,dc=com"
155   # skip...
156   access to dn.subtree="dc=example,dc=com"
157           by dn.exact="cn=Supervisor,dc=example,dc=com" write
158           by * read
159
160   database                relay
161   suffix                  "o=Example,c=US"
162   relay                   "dc=example,dc=com"
163   overlay                 rwm
164   rwm\-suffixmassage       "dc=example,dc=com"
165   # skip ...
166   access to dn.subtree="o=Example,c=US"
167           by dn.exact="cn=Supervisor,dc=example,dc=com" write
168           by dn.exact="cn=Relay Supervisor,dc=example,dc=com" write
169           by * read
170 .fi
171 .LP
172 Note that, in both databases, the identities (the 
173 .B <who> 
174 clause) are in the
175 .BR "real naming context" ,
176 i.e.
177 .BR "`dc=example,dc=com'" ,
178 while the targets (the 
179 .B <what> 
180 clause) are in the
181 .B real
182 and in the
183 .BR "virtual naming context" ,
184 respectively.
185 .SH ACCESS CONTROL
186 The
187 .B relay
188 backend does not honor any of the access control semantics described in
189 .BR slapd.access (5);
190 all access control is delegated to the relayed database(s).
191 Only
192 .B read (=r)
193 access to the
194 .B entry
195 pseudo-attribute and to the other attribute values of the entries
196 returned by the
197 .B search
198 operation is honored, which is performed by the frontend.
199 .SH FILES
200 .TP
201 ETCDIR/slapd.conf
202 default slapd configuration file
203 .SH SEE ALSO
204 .BR slapd.conf (5),
205 .BR slapd\-config (5),
206 .BR slapo\-rwm (5),
207 .BR slapd (8).