Skip to content

Commit cc64318

Browse files
author
root
committed
Allow the rabbitmq_auth_backend_http plug-in to be used only for user authentication and authorization against the HTTP backend by setting vhost_path, resource_path, and topic_path to 'disabled'.
1 parent e93afc5 commit cc64318

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

deps/rabbitmq_auth_backend_http/src/rabbit_auth_backend_http.erl

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,10 +148,17 @@ context_as_parameters(_) ->
148148
[].
149149

150150
bool_req(PathName, Props) ->
151-
case http_req(p(PathName), q(Props)) of
152-
"deny" -> false;
153-
"allow" -> true;
154-
E -> E
151+
Authpath = p(PathName),
152+
case Authpath of
153+
"disabled" ->
154+
rabbit_log:debug("auth_backend_http: Skip ~ts!", [PathName]),
155+
true;
156+
_Else ->
157+
case http_req(Authpath, q(Props)) of
158+
"deny" -> false;
159+
"allow" -> true;
160+
E -> E
161+
end
155162
end.
156163

157164
http_req(Path, Query) -> http_req(Path, Query, ?RETRY_ON_KEEPALIVE_CLOSED).

0 commit comments

Comments
 (0)