Skip to content

Commit

Permalink
Returns unauthorized error when we do not have correct credentials
Browse files Browse the repository at this point in the history
  • Loading branch information
mremond committed Mar 30, 2016
1 parent ead83b0 commit 36ac1cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src/mod_http_api.erl
Expand Up @@ -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);
Expand Down
1 change: 0 additions & 1 deletion test/mod_http_api_test.exs
Expand Up @@ -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)
Expand Down

0 comments on commit 36ac1cd

Please sign in to comment.