parent
ee03149ba1
commit
4457928e32
2 changed files with 6 additions and 1 deletions
|
@ -10,7 +10,7 @@ defmodule Pleroma.Signature do
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
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
|
def key_id_to_actor_id(key_id) do
|
||||||
uri =
|
uri =
|
||||||
|
|
|
@ -153,6 +153,11 @@ test "it deduces the actor ID for streams" do
|
||||||
{:ok, "https://example.com/users/1234"}
|
{:ok, "https://example.com/users/1234"}
|
||||||
end
|
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
|
test "it calls webfinger for 'acct:' accounts" do
|
||||||
with_mock(Pleroma.Web.WebFinger,
|
with_mock(Pleroma.Web.WebFinger,
|
||||||
finger: fn _ -> {:ok, %{"ap_id" => "https://gensokyo.2hu/users/raymoo"}} end
|
finger: fn _ -> {:ok, %{"ap_id" => "https://gensokyo.2hu/users/raymoo"}} end
|
||||||
|
|
Loading…
Reference in a new issue