do not allow non-admins to register tokens with admin scopes
[akkoma] / test / pleroma / web / o_auth / ldap_authorization_test.exs
index 9ebd084a5bbd6b721d8a1f9312b9b3315e69493a..c8a1d65ab5f0614c6174186df96a662b589aa597 100644 (file)
@@ -18,7 +18,7 @@ defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do
   @tag @skip
   test "authorizes the existing user using LDAP credentials" do
     password = "testpassword"
-    user = insert(:user, password_hash: Pleroma.Password.hash_pwd_salt(password))
+    user = insert(:user, password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password))
     app = insert(:oauth_app, scopes: ["read", "write"])
 
     host = Pleroma.Config.get([:ldap, :host]) |> to_charlist
@@ -71,7 +71,7 @@ defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do
          equalityMatch: fn _type, _value -> :ok end,
          wholeSubtree: fn -> :ok end,
          search: fn _connection, _options ->
-           {:ok, {:eldap_search_result, [{:eldap_entry, '', []}], []}}
+           {:ok, {:eldap_search_result, [{:eldap_entry, '', []}], [], []}}
          end,
          close: fn _connection ->
            send(self(), :close_connection)
@@ -101,7 +101,7 @@ defmodule Pleroma.Web.OAuth.LDAPAuthorizationTest do
   @tag @skip
   test "disallow authorization for wrong LDAP credentials" do
     password = "testpassword"
-    user = insert(:user, password_hash: Pleroma.Password.hash_pwd_salt(password))
+    user = insert(:user, password_hash: Pleroma.Password.Pbkdf2.hash_pwd_salt(password))
     app = insert(:oauth_app, scopes: ["read", "write"])
 
     host = Pleroma.Config.get([:ldap, :host]) |> to_charlist