forked from AkkomaGang/akkoma
signature.ex: Remove the use of ObjectID type
It is not in stable yet
This commit is contained in:
parent
b6ca8cc539
commit
2646fdea22
1 changed files with 5 additions and 8 deletions
|
@ -8,7 +8,6 @@ defmodule Pleroma.Signature do
|
||||||
alias Pleroma.Keys
|
alias Pleroma.Keys
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
alias Pleroma.Web.ActivityPub.ObjectValidators.Types
|
|
||||||
|
|
||||||
def key_id_to_actor_id(key_id) do
|
def key_id_to_actor_id(key_id) do
|
||||||
uri =
|
uri =
|
||||||
|
@ -22,16 +21,14 @@ def key_id_to_actor_id(key_id) do
|
||||||
uri
|
uri
|
||||||
end
|
end
|
||||||
|
|
||||||
maybe_ap_id = URI.to_string(uri)
|
case uri do
|
||||||
|
%URI{scheme: scheme} when scheme in ["https", "http"] ->
|
||||||
case Types.ObjectID.cast(maybe_ap_id) do
|
{:ok, URI.to_string(uri)}
|
||||||
{:ok, ap_id} ->
|
|
||||||
{:ok, ap_id}
|
|
||||||
|
|
||||||
_ ->
|
_ ->
|
||||||
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}
|
%{"ap_id" => ap_id} -> {:ok, ap_id}
|
||||||
_ -> {:error, maybe_ap_id}
|
_ -> {:error, URI.to_string(uri)}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue