From 4457928e325cf370a0d2e028232dbd0a542547e0 Mon Sep 17 00:00:00 2001 From: Floatingghost Date: Sat, 11 May 2024 05:30:18 +0100 Subject: [PATCH] duct-tape fix for #438 we really need to make this less manual --- lib/pleroma/signature.ex | 2 +- test/pleroma/signature_test.exs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex index 3d33fcd62..c4ac2c87e 100644 --- a/lib/pleroma/signature.ex +++ b/lib/pleroma/signature.ex @@ -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 = diff --git a/test/pleroma/signature_test.exs b/test/pleroma/signature_test.exs index e2d02fe4c..c946da9ef 100644 --- a/test/pleroma/signature_test.exs +++ b/test/pleroma/signature_test.exs @@ -153,6 +153,11 @@ defmodule Pleroma.SignatureTest 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