|
1 | | - |
2 | | -%% ========================================================================== |
3 | 1 | %% ---------------------------------------------------------------------------- |
4 | 2 | %% RabbitMQ HTTP Authorization |
5 | | -%% |
6 | 3 | %% ---------------------------------------------------------------------------- |
7 | 4 |
|
8 | 5 | {mapping, "auth_http.http_method", "rabbitmq_auth_backend_http.http_method", |
|
25 | 22 |
|
26 | 23 | {mapping, "auth_http.connection_timeout", "rabbitmq_auth_backend_http.connection_timeout", |
27 | 24 | [{datatype, integer}]}. |
| 25 | + |
| 26 | +%% TLS options |
| 27 | + |
| 28 | +{mapping, "auth_http.ssl_options", "rabbitmq_auth_backend_http.ssl_options", [ |
| 29 | + {datatype, {enum, [none]}} |
| 30 | +]}. |
| 31 | + |
| 32 | +{translation, "rabbitmq_auth_backend_http.ssl_options", |
| 33 | +fun(Conf) -> |
| 34 | + case cuttlefish:conf_get("auth_http.ssl_options", Conf, undefined) of |
| 35 | + none -> []; |
| 36 | + _ -> cuttlefish:invalid("Invalid auth_http.ssl_options") |
| 37 | + end |
| 38 | +end}. |
| 39 | + |
| 40 | +{mapping, "auth_http.ssl_options.verify", "rabbitmq_auth_backend_http.ssl_options.verify", [ |
| 41 | + {datatype, {enum, [verify_peer, verify_none]}}]}. |
| 42 | + |
| 43 | +{mapping, "auth_http.ssl_options.fail_if_no_peer_cert", "rabbitmq_auth_backend_http.ssl_options.fail_if_no_peer_cert", [ |
| 44 | + {datatype, {enum, [true, false]}}]}. |
| 45 | + |
| 46 | +{mapping, "auth_http.ssl_options.cacertfile", "rabbitmq_auth_backend_http.ssl_options.cacertfile", |
| 47 | + [{datatype, string}, {validators, ["file_accessible"]}]}. |
| 48 | + |
| 49 | +{mapping, "auth_http.ssl_options.certfile", "rabbitmq_auth_backend_http.ssl_options.certfile", |
| 50 | + [{datatype, string}, {validators, ["file_accessible"]}]}. |
| 51 | + |
| 52 | +{mapping, "auth_http.ssl_options.cacerts.$name", "rabbitmq_auth_backend_http.ssl_options.cacerts", |
| 53 | + [{datatype, string}]}. |
| 54 | + |
| 55 | +{translation, "rabbitmq_auth_backend_http.ssl_options.cacerts", |
| 56 | +fun(Conf) -> |
| 57 | + Settings = cuttlefish_variable:filter_by_prefix("auth_http.ssl_options.cacerts", Conf), |
| 58 | + [ list_to_binary(V) || {_, V} <- Settings ] |
| 59 | +end}. |
| 60 | + |
| 61 | +{mapping, "auth_http.ssl_options.cert", "rabbitmq_auth_backend_http.ssl_options.cert", |
| 62 | + [{datatype, string}]}. |
| 63 | + |
| 64 | +{translation, "rabbitmq_auth_backend_http.ssl_options.cert", |
| 65 | +fun(Conf) -> |
| 66 | + list_to_binary(cuttlefish:conf_get("auth_http.ssl_options.cert", Conf)) |
| 67 | +end}. |
| 68 | + |
| 69 | +{mapping, "auth_http.ssl_options.client_renegotiation", "rabbitmq_auth_backend_http.ssl_options.client_renegotiation", |
| 70 | + [{datatype, {enum, [true, false]}}]}. |
| 71 | + |
| 72 | +{mapping, "auth_http.ssl_options.crl_check", "rabbitmq_auth_backend_http.ssl_options.crl_check", |
| 73 | + [{datatype, [{enum, [true, false, peer, best_effort]}]}]}. |
| 74 | + |
| 75 | +{mapping, "auth_http.ssl_options.depth", "rabbitmq_auth_backend_http.ssl_options.depth", |
| 76 | + [{datatype, integer}, {validators, ["byte"]}]}. |
| 77 | + |
| 78 | +{mapping, "auth_http.ssl_options.dh", "rabbitmq_auth_backend_http.ssl_options.dh", |
| 79 | + [{datatype, string}]}. |
| 80 | + |
| 81 | +{translation, "rabbitmq_auth_backend_http.ssl_options.dh", |
| 82 | +fun(Conf) -> |
| 83 | + list_to_binary(cuttlefish:conf_get("auth_http.ssl_options.dh", Conf)) |
| 84 | +end}. |
| 85 | + |
| 86 | +{mapping, "auth_http.ssl_options.dhfile", "rabbitmq_auth_backend_http.ssl_options.dhfile", |
| 87 | + [{datatype, string}, {validators, ["file_accessible"]}]}. |
| 88 | + |
| 89 | +{mapping, "auth_http.ssl_options.honor_cipher_order", "rabbitmq_auth_backend_http.ssl_options.honor_cipher_order", |
| 90 | + [{datatype, {enum, [true, false]}}]}. |
| 91 | + |
| 92 | +{mapping, "auth_http.ssl_options.honor_ecc_order", "rabbitmq_auth_backend_http.ssl_options.honor_ecc_order", |
| 93 | + [{datatype, {enum, [true, false]}}]}. |
| 94 | + |
| 95 | +{mapping, "auth_http.ssl_options.key.RSAPrivateKey", "rabbitmq_auth_backend_http.ssl_options.key", |
| 96 | + [{datatype, string}]}. |
| 97 | + |
| 98 | +{mapping, "auth_http.ssl_options.key.DSAPrivateKey", "rabbitmq_auth_backend_http.ssl_options.key", |
| 99 | + [{datatype, string}]}. |
| 100 | + |
| 101 | +{mapping, "auth_http.ssl_options.key.PrivateKeyInfo", "rabbitmq_auth_backend_http.ssl_options.key", |
| 102 | + [{datatype, string}]}. |
| 103 | + |
| 104 | +{translation, "rabbitmq_auth_backend_http.ssl_options.key", |
| 105 | +fun(Conf) -> |
| 106 | + case cuttlefish_variable:filter_by_prefix("auth_http.ssl_options.key", Conf) of |
| 107 | + [{[_,_,Key], Val}|_] -> {list_to_atom(Key), list_to_binary(Val)}; |
| 108 | + _ -> undefined |
| 109 | + end |
| 110 | +end}. |
| 111 | + |
| 112 | +{mapping, "auth_http.ssl_options.keyfile", "rabbitmq_auth_backend_http.ssl_options.keyfile", |
| 113 | + [{datatype, string}, {validators, ["file_accessible"]}]}. |
| 114 | + |
| 115 | +{mapping, "auth_http.ssl_options.log_alert", "rabbitmq_auth_backend_http.ssl_options.log_alert", |
| 116 | + [{datatype, {enum, [true, false]}}]}. |
| 117 | + |
| 118 | +{mapping, "auth_http.ssl_options.password", "rabbitmq_auth_backend_http.ssl_options.password", |
| 119 | + [{datatype, string}]}. |
| 120 | + |
| 121 | +{mapping, "auth_http.ssl_options.psk_identity", "rabbitmq_auth_backend_http.ssl_options.psk_identity", |
| 122 | + [{datatype, string}]}. |
| 123 | + |
| 124 | +{mapping, "auth_http.ssl_options.reuse_sessions", "rabbitmq_auth_backend_http.ssl_options.reuse_sessions", |
| 125 | + [{datatype, {enum, [true, false]}}]}. |
| 126 | + |
| 127 | +{mapping, "auth_http.ssl_options.secure_renegotiate", "rabbitmq_auth_backend_http.ssl_options.secure_renegotiate", |
| 128 | + [{datatype, {enum, [true, false]}}]}. |
| 129 | + |
| 130 | +{mapping, "auth_http.ssl_options.versions.$version", "rabbitmq_auth_backend_http.ssl_options.versions", |
| 131 | + [{datatype, atom}]}. |
| 132 | + |
| 133 | +{translation, "rabbitmq_auth_backend_http.ssl_options.versions", |
| 134 | +fun(Conf) -> |
| 135 | + Settings = cuttlefish_variable:filter_by_prefix("auth_http.ssl_options.versions", Conf), |
| 136 | + [ V || {_, V} <- Settings ] |
| 137 | +end}. |
| 138 | + |
| 139 | +{mapping, "auth_http.ssl_options.sni", "rabbitmq_auth_backend_http.ssl_options.server_name_indication", |
| 140 | + [{datatype, [{enum, [none]}, string]}]}. |
| 141 | + |
| 142 | +{translation, "rabbitmq_auth_backend_http.ssl_options.server_name_indication", |
| 143 | +fun(Conf) -> |
| 144 | + case cuttlefish:conf_get("auth_http.ssl_options.sni", Conf, undefined) of |
| 145 | + undefined -> cuttlefish:unset(); |
| 146 | + none -> cuttlefish:unset(); |
| 147 | + Hostname -> Hostname |
| 148 | + end |
| 149 | +end}. |
| 150 | + |
| 151 | +{mapping, "auth_http.ssl_options.hostname_verification", "rabbitmq_auth_backend_http.ssl_hostname_verification", [ |
| 152 | + {datatype, {enum, [wildcard, none]}}]}. |
0 commit comments