From 92992c022d454f9489ce54aa8f6189456435a48a Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 31 Jan 2024 11:29:06 -0500 Subject: [PATCH] Pleroma.Web.OAuth.OAuthController: dialyzer error validate_scopes/2 can never receive a map as it is only called in one place with a guard requiring a list lib/pleroma/web/o_auth/o_auth_controller.ex:615:guard_fail The guard test: is_map(_params :: maybe_improper_list()) can never succeed. --- lib/pleroma/web/o_auth/o_auth_controller.ex | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/pleroma/web/o_auth/o_auth_controller.ex b/lib/pleroma/web/o_auth/o_auth_controller.ex index 2bbe5d5fa..47b03215f 100644 --- a/lib/pleroma/web/o_auth/o_auth_controller.ex +++ b/lib/pleroma/web/o_auth/o_auth_controller.ex @@ -610,13 +610,8 @@ defmodule Pleroma.Web.OAuth.OAuthController do end end - @spec validate_scopes(App.t(), map() | list()) :: + @spec validate_scopes(App.t(), list()) :: {:ok, list()} | {:error, :missing_scopes | :unsupported_scopes} - defp validate_scopes(%App{} = app, params) when is_map(params) do - requested_scopes = Scopes.fetch_scopes(params, app.scopes) - validate_scopes(app, requested_scopes) - end - defp validate_scopes(%App{} = app, requested_scopes) when is_list(requested_scopes) do Scopes.validate(requested_scopes, app.scopes) end