@@ -33,20 +33,6 @@ fun(Conf) ->
3333 end
3434end}.
3535
36- %% Connect to the LDAP server using SSL
37- %%
38- %% {use_ssl, false},
39-
40- {mapping, "auth_ldap.use_ssl", "rabbitmq_auth_backend_ldap.use_ssl",
41- [{datatype, {enum, [true, false]}}]}.
42-
43- %% Connect to the LDAP server using StartTLS
44- %%
45- %% {use_starttls, false},
46-
47- {mapping, "auth_ldap.use_starttls", "rabbitmq_auth_backend_ldap.use_starttls",
48- [{datatype, {enum, [true, false]}}]}.
49-
5036%% Specify the LDAP port to connect to
5137%%
5238%% {port, 389},
@@ -210,3 +196,131 @@ end}.
210196%%
211197%% {tag_queries, []}
212198% ]},
199+
200+ %% Connect to the LDAP server using TLS
201+ %%
202+ %% {use_ssl, false},
203+
204+ {mapping, "auth_ldap.use_ssl", "rabbitmq_auth_backend_ldap.use_ssl",
205+ [{datatype, {enum, [true, false]}}]}.
206+
207+ %% Connect to the LDAP server using StartTLS
208+ %%
209+ %% {use_starttls, false},
210+
211+ {mapping, "auth_ldap.use_starttls", "rabbitmq_auth_backend_ldap.use_starttls",
212+ [{datatype, {enum, [true, false]}}]}.
213+
214+
215+ %% TLS options
216+
217+ {mapping, "auth_ldap.ssl_options", "rabbitmq_auth_backend_ldap.ssl_options", [
218+ {datatype, {enum, [none]}}
219+ ]}.
220+
221+ {translation, "rabbitmq_auth_backend_ldap.ssl_options",
222+ fun(Conf) ->
223+ case cuttlefish:conf_get("auth_ldap.ssl_options", Conf, undefined) of
224+ none -> [];
225+ _ -> cuttlefish:invalid("Invalid auth_ldap.ssl_options")
226+ end
227+ end}.
228+
229+ {mapping, "auth_ldap.ssl_options.verify", "rabbitmq_auth_backend_ldap.ssl_options.verify", [
230+ {datatype, {enum, [verify_peer, verify_none]}}]}.
231+
232+ {mapping, "auth_ldap.ssl_options.fail_if_no_peer_cert", "rabbitmq_auth_backend_ldap.ssl_options.fail_if_no_peer_cert", [
233+ {datatype, {enum, [true, false]}}]}.
234+
235+ {mapping, "auth_ldap.ssl_options.cacertfile", "rabbitmq_auth_backend_ldap.ssl_options.cacertfile",
236+ [{datatype, string}, {validators, ["file_accessible"]}]}.
237+
238+ {mapping, "auth_ldap.ssl_options.certfile", "rabbitmq_auth_backend_ldap.ssl_options.certfile",
239+ [{datatype, string}, {validators, ["file_accessible"]}]}.
240+
241+ {mapping, "auth_ldap.ssl_options.cacerts.$name", "rabbitmq_auth_backend_ldap.ssl_options.cacerts",
242+ [{datatype, string}]}.
243+
244+ {translation, "rabbitmq_auth_backend_ldap.ssl_options.cacerts",
245+ fun(Conf) ->
246+ Settings = cuttlefish_variable:filter_by_prefix("auth_ldap.ssl_options.cacerts", Conf),
247+ [ list_to_binary(V) || {_, V} <- Settings ]
248+ end}.
249+
250+ {mapping, "auth_ldap.ssl_options.cert", "rabbitmq_auth_backend_ldap.ssl_options.cert",
251+ [{datatype, string}]}.
252+
253+ {translation, "rabbitmq_auth_backend_ldap.ssl_options.cert",
254+ fun(Conf) ->
255+ list_to_binary(cuttlefish:conf_get("auth_ldap.ssl_options.cert", Conf))
256+ end}.
257+
258+ {mapping, "auth_ldap.ssl_options.client_renegotiation", "rabbitmq_auth_backend_ldap.ssl_options.client_renegotiation",
259+ [{datatype, {enum, [true, false]}}]}.
260+
261+ {mapping, "auth_ldap.ssl_options.crl_check", "rabbitmq_auth_backend_ldap.ssl_options.crl_check",
262+ [{datatype, [{enum, [true, false, peer, best_effort]}]}]}.
263+
264+ {mapping, "auth_ldap.ssl_options.depth", "rabbitmq_auth_backend_ldap.ssl_options.depth",
265+ [{datatype, integer}, {validators, ["byte"]}]}.
266+
267+ {mapping, "auth_ldap.ssl_options.dh", "rabbitmq_auth_backend_ldap.ssl_options.dh",
268+ [{datatype, string}]}.
269+
270+ {translation, "rabbitmq_auth_backend_ldap.ssl_options.dh",
271+ fun(Conf) ->
272+ list_to_binary(cuttlefish:conf_get("auth_ldap.ssl_options.dh", Conf))
273+ end}.
274+
275+ {mapping, "auth_ldap.ssl_options.dhfile", "rabbitmq_auth_backend_ldap.ssl_options.dhfile",
276+ [{datatype, string}, {validators, ["file_accessible"]}]}.
277+
278+ {mapping, "auth_ldap.ssl_options.honor_cipher_order", "rabbitmq_auth_backend_ldap.ssl_options.honor_cipher_order",
279+ [{datatype, {enum, [true, false]}}]}.
280+
281+ {mapping, "auth_ldap.ssl_options.honor_ecc_order", "rabbitmq_auth_backend_ldap.ssl_options.honor_ecc_order",
282+ [{datatype, {enum, [true, false]}}]}.
283+
284+ {mapping, "auth_ldap.ssl_options.key.RSAPrivateKey", "rabbitmq_auth_backend_ldap.ssl_options.key",
285+ [{datatype, string}]}.
286+
287+ {mapping, "auth_ldap.ssl_options.key.DSAPrivateKey", "rabbitmq_auth_backend_ldap.ssl_options.key",
288+ [{datatype, string}]}.
289+
290+ {mapping, "auth_ldap.ssl_options.key.PrivateKeyInfo", "rabbitmq_auth_backend_ldap.ssl_options.key",
291+ [{datatype, string}]}.
292+
293+ {translation, "rabbitmq_auth_backend_ldap.ssl_options.key",
294+ fun(Conf) ->
295+ case cuttlefish_variable:filter_by_prefix("auth_ldap.ssl_options.key", Conf) of
296+ [{[_,_,Key], Val}|_] -> {list_to_atom(Key), list_to_binary(Val)};
297+ _ -> undefined
298+ end
299+ end}.
300+
301+ {mapping, "auth_ldap.ssl_options.keyfile", "rabbitmq_auth_backend_ldap.ssl_options.keyfile",
302+ [{datatype, string}, {validators, ["file_accessible"]}]}.
303+
304+ {mapping, "auth_ldap.ssl_options.log_alert", "rabbitmq_auth_backend_ldap.ssl_options.log_alert",
305+ [{datatype, {enum, [true, false]}}]}.
306+
307+ {mapping, "auth_ldap.ssl_options.password", "rabbitmq_auth_backend_ldap.ssl_options.password",
308+ [{datatype, string}]}.
309+
310+ {mapping, "auth_ldap.ssl_options.psk_identity", "rabbitmq_auth_backend_ldap.ssl_options.psk_identity",
311+ [{datatype, string}]}.
312+
313+ {mapping, "auth_ldap.ssl_options.reuse_sessions", "rabbitmq_auth_backend_ldap.ssl_options.reuse_sessions",
314+ [{datatype, {enum, [true, false]}}]}.
315+
316+ {mapping, "auth_ldap.ssl_options.secure_renegotiate", "rabbitmq_auth_backend_ldap.ssl_options.secure_renegotiate",
317+ [{datatype, {enum, [true, false]}}]}.
318+
319+ {mapping, "auth_ldap.ssl_options.versions.$version", "rabbitmq_auth_backend_ldap.ssl_options.versions",
320+ [{datatype, atom}]}.
321+
322+ {translation, "rabbitmq_auth_backend_ldap.ssl_options.versions",
323+ fun(Conf) ->
324+ Settings = cuttlefish_variable:filter_by_prefix("auth_ldap.ssl_options.versions", Conf),
325+ [ V || {_, V} <- Settings ]
326+ end}.
0 commit comments