summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMagnus Ahltorp <map@kth.se>2015-02-27 13:47:04 +0100
committerMagnus Ahltorp <map@kth.se>2015-02-27 13:47:04 +0100
commit7cc474935a0c86ec077efffe321cd80b586ced88 (patch)
tree7acc5fb5aa0f1bc9dd3446dca9210a6690f13dea
parentab8adabdf45e573561ff2d7c478e1f8d0d444245 (diff)
Do not try to verify authtoken if key is unknown
-rw-r--r--src/http_auth.erl5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/http_auth.erl b/src/http_auth.erl
index 3186751..6a076fa 100644
--- a/src/http_auth.erl
+++ b/src/http_auth.erl
@@ -118,6 +118,9 @@ verify_auth(AuthHeader, Method, Path, Data) ->
AuthSuccess = case lookup_publickey(KeyName) of
nokey ->
false;
+ failure ->
+ lager:info("key name ~p could not be found", [KeyName]),
+ false;
Key ->
verify(AuthToken, Key, Method, Path, Data)
end,
@@ -125,7 +128,7 @@ verify_auth(AuthHeader, Method, Path, Data) ->
true ->
check_acl(Method, KeyName, Path);
_ ->
- lager:info("authentication token ~p was not valid for key name ~p", [mochihex:to_hex(AuthToken), KeyName]),
+ lager:info("authentication token ~p was not valid for key name ~p: ~p ~p ~p", [mochihex:to_hex(AuthToken), KeyName, Method, Path, Data]),
failure
end.