- Authentication: Added rate limit for password-authorized actions / login existence checks
- Metadata Link: Atom syndication Feed
- Mix task to re-count statuses for all users (`mix pleroma.count_statuses`)
- - Admin API: `POST /api/pleroma/admin/users/:nickname/permission_group/:permission_group` / `DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group` are deprecated in favor of: `POST /api/pleroma/admin/users/permission_group/:permission_group` / `DELETE /api/pleroma/admin/users/permission_group/:permission_group` (both accept `nicknames` array)
+ - Mastodon API: Add `exclude_visibilities` parameter to the timeline and notification endpoints
+- Admin API: `/users/:nickname/toggle_activation` endpoint is now deprecated in favor of: `/users/activate`, `/users/deactivate`, both accept `nicknames` array
++- Admin API: `POST/DELETE /api/pleroma/admin/users/:nickname/permission_group/:permission_group` are deprecated in favor of: `POST/DELETE /api/pleroma/admin/users/permission_group/:permission_group` (both accept `nicknames` array), `DELETE /api/pleroma/admin/users` (`nickname` query param or `nickname` sent in JSON body) is deprecated in favor of: `DELETE /api/pleroma/admin/users` (`nicknames` query array param or `nicknames` sent in JSON body).
### Changed
- **Breaking:** Elixir >=1.8 is now required (was >= 1.7)
}
```
--## `/api/pleroma/admin/users`
++## DEPRECATED `DELETE /api/pleroma/admin/users`
### Remove a user
- `nickname`
- Response: User’s nickname
++## `DELETE /api/pleroma/admin/users`
++
++### Remove a user
++
++- Method `DELETE`
++- Params:
++ - `nicknames`
++- Response: Array of user nicknames
++
### Create a user
- Method: `POST`
data: %{
"actor" => %{"nickname" => actor_nickname},
"action" => "delete",
-- "subject" => %{"nickname" => subject_nickname, "type" => "user"}
++ "subject" => subjects
}
}) do
-- "@#{actor_nickname} deleted user @#{subject_nickname}"
++ "@#{actor_nickname} deleted users: #{users_to_nicknames_string(subjects)}"
end
@spec get_log_entry_message(ModerationLog) :: String.t()
update_info(user, &User.Info.update_notification_settings(&1, settings))
end
++ def delete(users) when is_list(users) do
++ for user <- users, do: delete(user)
++ end
++
def delete(%User{} = user) do
BackgroundWorker.enqueue("delete_user", %{"user_id" => user.id})
end
ModerationLog.insert_log(%{
actor: admin,
-- subject: user,
++ subject: [user],
action: "delete"
})
|> json(nickname)
end
++ def user_delete(%{assigns: %{user: admin}} = conn, %{"nicknames" => nicknames}) do
++ users = nicknames |> Enum.map(&User.get_cached_by_nickname/1)
++ User.delete(users)
++
++ ModerationLog.insert_log(%{
++ actor: admin,
++ subject: users,
++ action: "delete"
++ })
++
++ conn
++ |> json(nicknames)
++ end
++
def user_follow(%{assigns: %{user: admin}} = conn, %{
"follower" => follower_nick,
"followed" => followed_nick
{:ok, _} =
ModerationLog.insert_log(%{
actor: moderator,
-- subject: subject1,
++ subject: [subject1],
action: "delete"
})
log = Repo.one(ModerationLog)
-- assert log.data["message"] == "@#{moderator.nickname} deleted user @#{subject1.nickname}"
++ assert log.data["message"] == "@#{moderator.nickname} deleted users: @#{subject1.nickname}"
end
test "logging user creation by moderator", %{
alias Pleroma.Web.MediaProxy
import Pleroma.Factory
-- describe "/api/pleroma/admin/users" do
-- test "Delete" do
++ describe "DELETE /api/pleroma/admin/users" do
++ test "single user" do
admin = insert(:user, info: %{is_admin: true})
user = insert(:user)
log_entry = Repo.one(ModerationLog)
-- assert log_entry.data["subject"]["nickname"] == user.nickname
-- assert log_entry.data["action"] == "delete"
--
assert ModerationLog.get_log_entry_message(log_entry) ==
-- "@#{admin.nickname} deleted user @#{user.nickname}"
++ "@#{admin.nickname} deleted users: @#{user.nickname}"
assert json_response(conn, 200) == user.nickname
end
++ test "multiple users" do
++ admin = insert(:user, info: %{is_admin: true})
++ user_one = insert(:user)
++ user_two = insert(:user)
++
++ conn =
++ build_conn()
++ |> assign(:user, admin)
++ |> put_req_header("accept", "application/json")
++ |> delete("/api/pleroma/admin/users", %{
++ nicknames: [user_one.nickname, user_two.nickname]
++ })
++
++ log_entry = Repo.one(ModerationLog)
++
++ assert ModerationLog.get_log_entry_message(log_entry) ==
++ "@#{admin.nickname} deleted users: @#{user_one.nickname}, @#{user_two.nickname}"
++
++ response = json_response(conn, 200)
++ assert response -- [user_one.nickname, user_two.nickname] == []
++ end
++ end
++
++ describe "/api/pleroma/admin/users" do
test "Create" do
admin = insert(:user, info: %{is_admin: true})