Relax alsoKnownAs requirements to just being a URI
This commit is contained in:
parent
f38e9228ef
commit
a361b84fc9
4 changed files with 12 additions and 2 deletions
1
changelog.d/relax-also-known-as.change
Normal file
1
changelog.d/relax-also-known-as.change
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
Relax alsoKnownAs requirements to just URI, not necessarily HTTP(S)
|
||||||
|
|
@ -150,7 +150,7 @@ defmodule Pleroma.User do
|
||||||
field(:allow_following_move, :boolean, default: true)
|
field(:allow_following_move, :boolean, default: true)
|
||||||
field(:skip_thread_containment, :boolean, default: false)
|
field(:skip_thread_containment, :boolean, default: false)
|
||||||
field(:actor_type, :string, default: "Person")
|
field(:actor_type, :string, default: "Person")
|
||||||
field(:also_known_as, {:array, ObjectValidators.ObjectID}, default: [])
|
field(:also_known_as, {:array, ObjectValidators.BareUri}, default: [])
|
||||||
field(:inbox, :string)
|
field(:inbox, :string)
|
||||||
field(:shared_inbox, :string)
|
field(:shared_inbox, :string)
|
||||||
field(:accepts_chat_messages, :boolean, default: nil)
|
field(:accepts_chat_messages, :boolean, default: nil)
|
||||||
|
|
|
||||||
|
|
@ -190,7 +190,7 @@ defmodule Pleroma.Web.MastodonAPI.SearchController do
|
||||||
f.()
|
f.()
|
||||||
rescue
|
rescue
|
||||||
error ->
|
error ->
|
||||||
Logger.error("#{__MODULE__} search error: #{inspect(error)}")
|
Logger.error(Exception.format(:error, error, __STACKTRACE__))
|
||||||
fallback
|
fallback
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -2792,6 +2792,15 @@ defmodule Pleroma.UserTest do
|
||||||
assert user_updated.also_known_as |> length() == 1
|
assert user_updated.also_known_as |> length() == 1
|
||||||
assert user2.ap_id in user_updated.also_known_as
|
assert user2.ap_id in user_updated.also_known_as
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test "should tolerate non-http(s) aliases" do
|
||||||
|
user =
|
||||||
|
insert(:user, %{
|
||||||
|
also_known_as: ["at://did:plc:xgvzy7ni6ig6ievcbls5jaxe"]
|
||||||
|
})
|
||||||
|
|
||||||
|
assert "at://did:plc:xgvzy7ni6ig6ievcbls5jaxe" in user.also_known_as
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
describe "alias_users/1" do
|
describe "alias_users/1" do
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue