Merge branch 'feature/rich-media-part-2-electric-boogaloo' into 'develop'
authorHaelwenn <contact+git.pleroma.social@hacktivis.me>
Tue, 29 Jan 2019 05:11:08 +0000 (05:11 +0000)
committerHaelwenn <contact+git.pleroma.social@hacktivis.me>
Tue, 29 Jan 2019 05:11:08 +0000 (05:11 +0000)
Rich Media support, part 2.

See merge request pleroma/pleroma!719

README.md
installation/init.d/pleroma
lib/pleroma/web/mastodon_api/views/status_view.ex
lib/pleroma/web/oauth/fallback_controller.ex
test/web/oauth/oauth_controller_test.exs

index d9896f7ba70abeaaafba13fdf2643dcf576d8621..d390485d2905f38657c373824149677300c1bba9 100644 (file)
--- a/README.md
+++ b/README.md
@@ -8,14 +8,17 @@ Pleroma is written in Elixir, high-performance and can run on small devices like
 
 For clients it supports both the [GNU Social API with Qvitter extensions](https://twitter-api.readthedocs.io/en/latest/index.html) and the [Mastodon client API](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md).
 
+Client applications that are committed to supporting Pleroma:
+
+* Mastalab (Android)
+* Tusky (Android)
+* Twidere (Android)
+* Mast (iOS)
+* Amaroq (iOS)
+
 Client applications that are known to work well:
 
-* Twidere
-* Tusky
-* Mastalab
 * Pawoo (Android + iOS)
-* Subway Tooter
-* Amaroq (iOS)
 * Tootdon (Android + iOS)
 * Tootle (iOS)
 * Whalebird (Windows + Mac + Linux)
index 9582d65d45c37c6d326bae49dc9a59b206d5f780..2b211df65ff59cebc2167a53c4950495a89191fa 100755 (executable)
@@ -12,7 +12,7 @@ export PORT=4000
 export MIX_ENV=prod
 
 # Ask process to terminate within 30 seconds, otherwise kill it
-retry="SIGTERM/30 SIGKILL/5"
+retry="SIGTERM/30/SIGKILL/5"
 
 pidfile="/var/run/pleroma.pid"
 
index d3e30b656df939ad7b7687a298010a0ab523198c..b14ca9f5d65a59a4dab62b89868424182979486a 100644 (file)
@@ -54,7 +54,6 @@ defmodule Pleroma.Web.MastodonAPI.StatusView do
       "status.json",
       Map.put(opts, :replied_to_activities, replied_to_activities)
     )
-    |> Enum.filter(fn x -> not is_nil(x) end)
   end
 
   def render(
index 1eeda3d245a2cba087413b8b0f7bc4f81fa8d9eb..f0fe3b5785b11902d02cf852d625d7f1fc2e3668 100644 (file)
@@ -9,7 +9,8 @@ defmodule Pleroma.Web.OAuth.FallbackController do
   # No user/password
   def call(conn, _) do
     conn
+    |> put_status(:unauthorized)
     |> put_flash(:error, "Invalid Username/Password")
-    |> OAuthController.authorize(conn.params)
+    |> OAuthController.authorize(conn.params["authorization"])
   end
 end
index ccd55225859fa699fda02cdf41426ace62155fe9..e0d3cb55f916d0ccafc777457251028db12e90bf 100644 (file)
@@ -34,6 +34,31 @@ defmodule Pleroma.Web.OAuth.OAuthControllerTest do
     assert Repo.get_by(Authorization, token: code)
   end
 
+  test "correctly handles wrong credentials", %{conn: conn} do
+    user = insert(:user)
+    app = insert(:oauth_app)
+
+    result =
+      conn
+      |> post("/oauth/authorize", %{
+        "authorization" => %{
+          "name" => user.nickname,
+          "password" => "wrong",
+          "client_id" => app.client_id,
+          "redirect_uri" => app.redirect_uris,
+          "state" => "statepassed"
+        }
+      })
+      |> html_response(:unauthorized)
+
+    # Keep the details
+    assert result =~ app.client_id
+    assert result =~ app.redirect_uris
+
+    # Error message
+    assert result =~ "Invalid"
+  end
+
   test "issues a token for an all-body request" do
     user = insert(:user)
     app = insert(:oauth_app)