diff options
author | Mickael Remond <mremond@process-one.net> | 2016-03-30 15:49:19 +0300 |
---|---|---|
committer | Mickael Remond <mremond@process-one.net> | 2016-03-30 15:49:19 +0300 |
commit | 36ac1cd6c7a86cd57e14121756efa590f2d8b1b7 (patch) | |
tree | 37c90cc77fc42270440bd3ed7f373fae970a69d1 | |
parent | ead83b008c25e2619cbc7cfbf4bde5fb46c4e677 (diff) |
Returns unauthorized error when we do not have correct credentials
-rw-r--r-- | src/mod_http_api.erl | 4 | ||||
-rw-r--r-- | test/mod_http_api_test.exs | 1 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/mod_http_api.erl b/src/mod_http_api.erl index 96fa90735..bbd4a28de 100644 --- a/src/mod_http_api.erl +++ b/src/mod_http_api.erl @@ -183,7 +183,9 @@ check_permissions2(#request{ip={IP, _Port}}, Call, _Policy) -> end; _ -> unauthorized_response() - end. + end; +check_permissions2(_Request, _Call, _Policy) -> + unauthorized_response(). oauth_check_token(Scope, Token) when is_atom(Scope) -> oauth_check_token(atom_to_binary(Scope, utf8), Token); diff --git a/test/mod_http_api_test.exs b/test/mod_http_api_test.exs index 11aad0689..adcb47061 100644 --- a/test/mod_http_api_test.exs +++ b/test/mod_http_api_test.exs @@ -43,7 +43,6 @@ defmodule ModHttpApiTest do {200, _, _} = :mod_http_api.process(["open_cmd"], request) end - @tag pending: true test "Call to user, admin, restricted commands without authentication are rejected" do request = request(method: :POST, data: "[]") {401, _, _} = :mod_http_api.process(["user_cmd"], request) |