summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Klishin <michael@clojurewerkz.org>2019-07-03 10:37:21 +0200
committerMichael Klishin <michael@clojurewerkz.org>2019-07-03 10:37:21 +0200
commite7035269a9ddd665d7998aa649e49e046efec067 (patch)
tree31a52433090a472b1448187100110b9cbd23569d
parent624d6866a8f18434e98889305f33d600c13d1e14 (diff)
downloadrabbitmq-server-git-e7035269a9ddd665d7998aa649e49e046efec067.tar.gz
Adapt to rabbit_authz_backend interface changes in rabbitmq/rabbitmq-auth-backend-oauth2#28.
-rw-r--r--deps/rabbitmq_auth_backend_cache/src/rabbit_auth_backend_cache.erl11
1 files changed, 9 insertions, 2 deletions
diff --git a/deps/rabbitmq_auth_backend_cache/src/rabbit_auth_backend_cache.erl b/deps/rabbitmq_auth_backend_cache/src/rabbit_auth_backend_cache.erl
index b638ea60ad..af0cbdd12c 100644
--- a/deps/rabbitmq_auth_backend_cache/src/rabbit_auth_backend_cache.erl
+++ b/deps/rabbitmq_auth_backend_cache/src/rabbit_auth_backend_cache.erl
@@ -21,9 +21,10 @@
-behaviour(rabbit_authz_backend).
-export([user_login_authentication/2, user_login_authorization/2,
- check_vhost_access/3, check_resource_access/4, check_topic_access/4]).
+ check_vhost_access/3, check_resource_access/4, check_topic_access/4,
+ state_can_expire/0]).
-%% Implementation of rabbit_auth_backend
+%% API
user_login_authentication(Username, AuthProps) ->
with_cache(authn, {user_login_authentication, [Username, AuthProps]},
@@ -68,6 +69,12 @@ check_topic_access(#auth_user{} = AuthUser,
(_) -> unknown
end).
+state_can_expire() -> false.
+
+%%
+%% Implementation
+%%
+
with_cache(BackendType, {F, A}, Fun) ->
{ok, AuthCache} = application:get_env(rabbitmq_auth_backend_cache,
cache_module),