diff options
| author | Simon MacMullen <simon@rabbitmq.com> | 2011-05-03 15:33:33 +0100 |
|---|---|---|
| committer | Simon MacMullen <simon@rabbitmq.com> | 2011-05-03 15:33:33 +0100 |
| commit | 698ef285f72be3a0f98457026bfbf54c1e37c850 (patch) | |
| tree | 119ea7a65a71384993cc889db1d20f6fb2f281f9 /src | |
| parent | ca1ad94464bde375a054162e2ee91a688ab9e7dd (diff) | |
| download | rabbitmq-server-git-698ef285f72be3a0f98457026bfbf54c1e37c850.tar.gz | |
Separate out different types for network and direct connections, don't check the password for direct ones.
Diffstat (limited to 'src')
| -rw-r--r-- | src/rabbit_direct.erl | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/rabbit_direct.erl b/src/rabbit_direct.erl index 0dac18d1fe..7ad63e815e 100644 --- a/src/rabbit_direct.erl +++ b/src/rabbit_direct.erl @@ -16,7 +16,7 @@ -module(rabbit_direct). --export([boot/0, connect/5, start_channel/8, disconnect/1]). +-export([boot/0, connect/4, start_channel/8, disconnect/1]). -include("rabbit.hrl"). @@ -25,7 +25,7 @@ -ifdef(use_specs). -spec(boot/0 :: () -> 'ok'). --spec(connect/5 :: (binary(), binary(), binary(), rabbit_types:protocol(), +-spec(connect/4 :: (binary(), binary(), rabbit_types:protocol(), rabbit_event:event_props()) -> {'ok', {rabbit_types:user(), rabbit_framing:amqp_table()}}). @@ -53,11 +53,11 @@ boot() -> %%---------------------------------------------------------------------------- -connect(Username, Password, VHost, Protocol, Infos) -> +connect(Username, VHost, Protocol, Infos) -> case lists:keymember(rabbit, 1, application:which_applications()) of true -> - try rabbit_access_control:user_pass_login(Username, Password) of - #user{} = User -> + case rabbit_access_control:check_user_login(Username, []) of + {ok, User} -> try rabbit_access_control:check_vhost_access(User, VHost) of ok -> rabbit_event:notify(connection_created, Infos), {ok, {User, @@ -65,9 +65,9 @@ connect(Username, Password, VHost, Protocol, Infos) -> catch exit:#amqp_error{name = access_refused} -> {error, access_refused} - end - catch - exit:#amqp_error{name = access_refused} -> {error, auth_failure} + end; + {refused, _Msg, _Args} -> + {error, auth_failure} end; false -> {error, broker_not_found_on_node} |
