duct-tape fix for #438
Some checks are pending
ci/woodpecker/push/build-amd64 Pipeline is pending
ci/woodpecker/push/build-arm64 Pipeline is pending
ci/woodpecker/push/docs Pipeline is pending
ci/woodpecker/push/lint Pipeline is pending
ci/woodpecker/push/test Pipeline is pending

we really need to make this less manual
This commit is contained in:
Floatingghost 2024-05-11 05:30:18 +01:00
parent ee03149ba1
commit 4457928e32
2 changed files with 6 additions and 1 deletions

View file

@ -10,7 +10,7 @@ defmodule Pleroma.Signature do
alias Pleroma.User
alias Pleroma.Web.ActivityPub.ActivityPub
@known_suffixes ["/publickey", "/main-key"]
@known_suffixes ["/publickey", "/main-key", "#key"]
def key_id_to_actor_id(key_id) do
uri =

View file

@ -153,6 +153,11 @@ test "it deduces the actor ID for streams" do
{:ok, "https://example.com/users/1234"}
end
test "it deduces the actor ID for bridgy" do
assert Signature.key_id_to_actor_id("https://example.com/1234#key") ==
{:ok, "https://example.com/1234"}
end
test "it calls webfinger for 'acct:' accounts" do
with_mock(Pleroma.Web.WebFinger,
finger: fn _ -> {:ok, %{"ap_id" => "https://gensokyo.2hu/users/raymoo"}} end