diff --git a/deps/rabbitmq_auth_backend_http/README.md b/deps/rabbitmq_auth_backend_http/README.md index fefb2889d862..7fd0510b2989 100644 --- a/deps/rabbitmq_auth_backend_http/README.md +++ b/deps/rabbitmq_auth_backend_http/README.md @@ -93,7 +93,7 @@ For instance, if the user accessed RabbitMQ via the MQTT protocol, it is expecte * `vhost`: the name of the virtual host being accessed * `ip`: the client ip address -Note that you cannot create arbitrary virtual hosts using this plugin; you can only determine whether your users can see / access the ones that exist. +Note that you cannot create arbitrary virtual hosts using this plugin; you can only determine whether your users can see / access the ones that exist. By setting `vhost_path` to `disabled`, this authentication request is skipped, and unrestricted access is granted. ### resource_path @@ -105,6 +105,7 @@ Note that you cannot create arbitrary virtual hosts using this plugin; you can o Note: This request may include additional http request parameters in addition to the ones listed above. For instance, if the user accessed RabbitMQ via the MQTT protocol, it is expected `client_id` request parameter too. +By setting `resource_path` to `disabled`, this authentication request is skipped, and unrestricted access is granted. ### topic_path @@ -116,6 +117,8 @@ For instance, if the user accessed RabbitMQ via the MQTT protocol, it is expecte * `routing_key`: the routing key of a published message (when the permission is `write`) or routing key of the queue binding (when the permission is `read`) +Note: By setting `topic_path` to `disabled`, this authentication request is skipped, and unrestricted access is granted. + See [topic authorisation](http://www.rabbitmq.com/access-control.html#topic-authorisation) for more information about topic authorisation. diff --git a/deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl b/deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl index f2bd50800935..e90feb6994f6 100644 --- a/deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl +++ b/deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl @@ -148,10 +148,17 @@ context_as_parameters(_) -> []. bool_req(PathName, Props) -> - case http_req(p(PathName), q(Props)) of - "deny" -> false; - "allow" -> true; - E -> E + Authpath = p(PathName), + case Authpath of + "disabled" -> + rabbit_log:debug("auth_backend_http: Skip ~ts!", [PathName]), + true; + _Else -> + case http_req(Authpath, q(Props)) of + "deny" -> false; + "allow" -> true; + E -> E + end end. http_req(Path, Query) -> http_req(Path, Query, ?RETRY_ON_KEEPALIVE_CLOSED).