+ plug(:skip_plug, OAuthScopesPlug when action in [:create, :identity_proofs])
+
+ plug(
+ :skip_plug,
+ Pleroma.Plugs.EnsurePublicOrAuthenticatedPlug
+ when action in [:create, :show, :statuses]
+ )
+
+ plug(
+ OAuthScopesPlug,
+ %{fallback: :proceed_unauthenticated, scopes: ["read:accounts"]}
+ when action in [:show, :followers, :following, :endorsements]
+ )
+
+ plug(
+ OAuthScopesPlug,
+ %{fallback: :proceed_unauthenticated, scopes: ["read:statuses"]}
+ when action == :statuses
+ )
+
+ plug(
+ OAuthScopesPlug,
+ %{scopes: ["read:accounts"]}
+ when action in [:endorsements, :verify_credentials]
+ )
+
+ plug(OAuthScopesPlug, %{scopes: ["write:accounts"]} when action == :update_credentials)
+
+ plug(OAuthScopesPlug, %{scopes: ["read:lists"]} when action == :lists)
+
+ plug(
+ OAuthScopesPlug,
+ %{scopes: ["follow", "read:blocks"]} when action == :blocks
+ )
+
+ plug(
+ OAuthScopesPlug,
+ %{scopes: ["follow", "write:blocks"]} when action in [:block, :unblock]
+ )
+
+ plug(OAuthScopesPlug, %{scopes: ["read:follows"]} when action == :relationships)
+
+ plug(
+ OAuthScopesPlug,
+ %{scopes: ["follow", "write:follows"]} when action in [:follow_by_uri, :follow, :unfollow]
+ )
+
+ plug(OAuthScopesPlug, %{scopes: ["follow", "read:mutes"]} when action == :mutes)
+
+ plug(OAuthScopesPlug, %{scopes: ["follow", "write:mutes"]} when action in [:mute, :unmute])
+
+ @relationship_actions [:follow, :unfollow]