diff options
author | Simon MacMullen <simon@rabbitmq.com> | 2014-12-05 11:36:11 +0000 |
---|---|---|
committer | Simon MacMullen <simon@rabbitmq.com> | 2014-12-05 11:36:11 +0000 |
commit | 1977561b78a0b75400e683db860bf412445224af (patch) | |
tree | 7c0543204862ea4e0bcc43f3998d10bd1d2bbce8 /src/rabbit_auth_backend_dummy.erl | |
parent | f106429bc42ff46944790acc0a8c917db9ff9405 (diff) | |
parent | d205a4285ca02d12493ac0dd0f5256af4294723c (diff) | |
download | rabbitmq-server-1977561b78a0b75400e683db860bf412445224af.tar.gz |
stable to default
Diffstat (limited to 'src/rabbit_auth_backend_dummy.erl')
-rw-r--r-- | src/rabbit_auth_backend_dummy.erl | 25 |
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. |