summaryrefslogtreecommitdiff
path: root/components/authorize/src/authorize_keys.erl
diff options
context:
space:
mode:
authorUlf Wiger <ulf@wiger.net>2017-03-22 21:10:46 +0100
committerGitHub <noreply@github.com>2017-03-22 21:10:46 +0100
commiteab79c462572f150cac0778d9b4a450d3d376c23 (patch)
treef346d6f429e7de71fa6026bf4ed885aaec0f3b35 /components/authorize/src/authorize_keys.erl
parent9084fe5fe11a4a877f670a98651e805a31b9f976 (diff)
parent3f429df1393fd476b5639cef444421b57b242da2 (diff)
downloadrvi_core-eab79c462572f150cac0778d9b4a450d3d376c23.tar.gz
Merge pull request #113 from uwiger/uw-bug-fixes-170303
fix minor bugs
Diffstat (limited to 'components/authorize/src/authorize_keys.erl')
-rw-r--r--components/authorize/src/authorize_keys.erl15
1 files changed, 12 insertions, 3 deletions
diff --git a/components/authorize/src/authorize_keys.erl b/components/authorize/src/authorize_keys.erl
index b5ffd72..6369e70 100644
--- a/components/authorize/src/authorize_keys.erl
+++ b/components/authorize/src/authorize_keys.erl
@@ -21,6 +21,7 @@
-export([cache_authorizations/1,
remove_cached_authorizations/1,
remove_cached_authorizations_for_conn/1,
+ remove_creds_for_conn/1,
update_authorization_cache/2]).
-export([remove_connection/1]).
@@ -159,6 +160,9 @@ remove_cached_authorizations(Svcs) ->
remove_cached_authorizations_for_conn(Conn) ->
remove_cached_authorizations_for_conn_(normalize_conn(Conn)).
+remove_creds_for_conn(Conn) ->
+ remove_creds_for_conn_(normalize_conn(Conn)).
+
update_authorization_cache(Conn, CS) ->
gen_server:cast(?MODULE, {update_authorization_cache, Conn, CS}).
@@ -247,9 +251,10 @@ handle_cast({update_authorization_cache, Conn0, CS}, S) ->
update_authorization_cache_(Conn, CS),
{noreply, S};
handle_cast({remove_connection, Conn0}, S) ->
- Conn = normalize_conn(Conn0),
- ets:select_delete(?CACHE, [{ {{'_', Conn}, '_'}, [], [true] }]),
- ets:select_delete(?CREDS, [{ {{Conn, '_'}, '_'}, [], [true] }]),
+ %% Don't remove the credentials
+ %% Conn = normalize_conn(Conn0),
+ %% ets:select_delete(?CACHE, [{ {{'_', Conn}, '_'}, [], [true] }]),
+ %% ets:select_delete(?CREDS, [{ {{Conn, '_'}, '_'}, [], [true] }]),
{noreply, S};
handle_cast(_, S) ->
{noreply, S}.
@@ -681,6 +686,10 @@ remove_cached_authorizations_for_conn_(Conn) ->
ets:select_delete(?CACHE, [{ {{'_', Conn}, '_'}, [], [true] }]),
ok.
+remove_creds_for_conn_(Conn) ->
+ ets:select_delete(?CREDS, [{ {{Conn, '_'}, '_'}, [], [true] }]),
+ ok.
+
can_invoke(Svc, #cred{right_to_invoke = In}) ->
lists:any(fun(I) -> match_svc(I, Svc) end, In).