Extract keys to their own table, match keyID #816

Merged
floatingghost merged 19 commits from keys-extraction into develop 2024-10-30 15:08:12 +00:00
4 changed files with 2 additions and 5 deletions
Showing only changes of commit 13215f5f06 - Show all commits

View file

@ -343,6 +343,7 @@ defp get_final_id(final_url, _intial_url) do
final_url
end
@doc "Do NOT use; only public for use in tests"
def get_object(id) do
date = Pleroma.Signature.signed_date()

View file

@ -11,7 +11,6 @@ defmodule Pleroma.Signature do
require Logger
def key_id_to_actor_id(key_id) do
# Given the key ID, first attempt to look it up in the signing keys table.
case SigningKey.key_id_to_ap_id(key_id) do
floatingghost marked this conversation as resolved Outdated

comment doesn't match the visible code beneath it

Comment implies the current function will fall back to something else if db lookup fails, but only attempts one function call

comment doesn't match the visible code beneath it Comment implies the current function will fall back to something else if db lookup fails, but only attempts one function call
nil ->
# hm, we SHOULD have gotten this in the pipeline before we hit here!

View file

@ -101,7 +101,6 @@ defmodule Pleroma.User do
field(:password, :string, virtual: true)
field(:password_confirmation, :string, virtual: true)
field(:keys, :string)
field(:public_key, :string)
field(:ap_id, :string)
field(:avatar, :map, default: %{})
field(:local, :boolean, default: true)
@ -471,7 +470,6 @@ def remote_user_changeset(struct \\ %User{local: false}, params) do
:inbox,
:shared_inbox,
:nickname,
:public_key,
:avatar,
:ap_enabled,
:banner,
@ -532,7 +530,6 @@ def update_changeset(struct, params \\ %{}) do
:name,
:emoji,
:avatar,
:public_key,
:inbox,
:shared_inbox,
:is_locked,

View file

@ -187,7 +187,7 @@ def get_or_fetch_by_key_id(key_id) do
def fetch_remote_key(key_id) do
Logger.debug("Fetching remote key: #{key_id}")
# we should probably sign this, just in case
resp = Pleroma.Object.Fetcher.get_object(key_id)
resp = Pleroma.Object.Fetcher.fetch_and_contain_remote_object_from_id(key_id)
case resp do
{:ok, _original_url, body} ->