summaryrefslogtreecommitdiff
path: root/src/rabbit_auth_backend_dummy.erl
diff options
context:
space:
mode:
authorSimon MacMullen <simon@rabbitmq.com>2014-11-14 17:41:03 +0000
committerSimon MacMullen <simon@rabbitmq.com>2014-11-14 17:41:03 +0000
commit4f241346ab6e8b24546ff75298ad6fc99b946e01 (patch)
treedf002ab0cee79355b05a75ab1973075b6585ffc9 /src/rabbit_auth_backend_dummy.erl
parent54f8c42b87e4131ec02e9103629b59147b14bbd2 (diff)
parent8a6ad3517e031b8b7b85c63ab24d062d1d647b5b (diff)
downloadrabbitmq-server-4f241346ab6e8b24546ff75298ad6fc99b946e01.tar.gz
Merge bug26469
Diffstat (limited to 'src/rabbit_auth_backend_dummy.erl')
-rw-r--r--src/rabbit_auth_backend_dummy.erl25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/rabbit_auth_backend_dummy.erl b/src/rabbit_auth_backend_dummy.erl
index 5daca368..d2f07c1d 100644
--- a/src/rabbit_auth_backend_dummy.erl
+++ b/src/rabbit_auth_backend_dummy.erl
@@ -17,11 +17,12 @@
-module(rabbit_auth_backend_dummy).
-include("rabbit.hrl").
--behaviour(rabbit_auth_backend).
+-behaviour(rabbit_authn_backend).
+-behaviour(rabbit_authz_backend).
--export([description/0]).
-export([user/0]).
--export([check_user_login/2, check_vhost_access/2, check_resource_access/3]).
+-export([user_login_authentication/2, user_login_authorization/1,
+ check_vhost_access/3, check_resource_access/3]).
-ifdef(use_specs).
@@ -31,19 +32,17 @@
%% A user to be used by the direct client when permission checks are
%% not needed. This user can do anything AMQPish.
-user() -> #user{username = <<"none">>,
- tags = [],
- auth_backend = ?MODULE,
- impl = none}.
+user() -> #user{username = <<"none">>,
+ tags = [],
+ authz_backends = [{?MODULE, none}]}.
%% Implementation of rabbit_auth_backend
-description() ->
- [{name, <<"Dummy">>},
- {description, <<"Database for the dummy user">>}].
+user_login_authentication(_, _) ->
+ {refused, "cannot log in conventionally as dummy user", []}.
-check_user_login(_, _) ->
+user_login_authorization(_) ->
{refused, "cannot log in conventionally as dummy user", []}.
-check_vhost_access(#user{}, _VHostPath) -> true.
-check_resource_access(#user{}, #resource{}, _Permission) -> true.
+check_vhost_access(#auth_user{}, _VHostPath, _Sock) -> true.
+check_resource_access(#auth_user{}, #resource{}, _Permission) -> true.