From 2646fdea224cb2af7d2adc66265c334ae1c69669 Mon Sep 17 00:00:00 2001 From: rinpatch Date: Fri, 1 May 2020 22:29:22 +0300 Subject: [PATCH] signature.ex: Remove the use of ObjectID type It is not in stable yet --- lib/pleroma/signature.ex | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex index d01728361..7006eb2c0 100644 --- a/lib/pleroma/signature.ex +++ b/lib/pleroma/signature.ex @@ -8,7 +8,6 @@ defmodule Pleroma.Signature do alias Pleroma.Keys alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub - alias Pleroma.Web.ActivityPub.ObjectValidators.Types def key_id_to_actor_id(key_id) do uri = @@ -22,16 +21,14 @@ defmodule Pleroma.Signature do uri end - maybe_ap_id = URI.to_string(uri) - - case Types.ObjectID.cast(maybe_ap_id) do - {:ok, ap_id} -> - {:ok, ap_id} + case uri do + %URI{scheme: scheme} when scheme in ["https", "http"] -> + {:ok, URI.to_string(uri)} _ -> - case Pleroma.Web.WebFinger.finger(maybe_ap_id) do + case Pleroma.Web.WebFinger.finger(URI.to_string(uri)) do %{"ap_id" => ap_id} -> {:ok, ap_id} - _ -> {:error, maybe_ap_id} + _ -> {:error, URI.to_string(uri)} end end end -- 2.45.2