diff options
author | William Pitcock <nenolod@dereferenced.org> | 2019-05-22 03:58:15 +0000 |
---|---|---|
committer | William Pitcock <nenolod@dereferenced.org> | 2019-05-22 03:58:15 +0000 |
commit | 045803346d70c1f9c6ea770485904fd7cc52969a (patch) | |
tree | 271e169e2fe978e43631f84bce0058618160f602 /lib/pleroma/signature.ex | |
parent | be6b57193a99a32134546efb667391eda4d4acdf (diff) | |
download | pleroma-045803346d70c1f9c6ea770485904fd7cc52969a.tar.gz |
move key generation functions into Pleroma.Keys module
Diffstat (limited to 'lib/pleroma/signature.ex')
-rw-r--r-- | lib/pleroma/signature.ex | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/pleroma/signature.ex b/lib/pleroma/signature.ex index b7ecf00a0..1a4d54c62 100644 --- a/lib/pleroma/signature.ex +++ b/lib/pleroma/signature.ex @@ -5,11 +5,10 @@ defmodule Pleroma.Signature do @behaviour HTTPSignatures.Adapter + alias Pleroma.Keys alias Pleroma.User alias Pleroma.Web.ActivityPub.ActivityPub alias Pleroma.Web.ActivityPub.Utils - alias Pleroma.Web.Salmon - alias Pleroma.Web.WebFinger def fetch_public_key(conn) do with actor_id <- Utils.get_ap_id(conn.params["actor"]), @@ -33,8 +32,8 @@ defmodule Pleroma.Signature do end def sign(%User{} = user, headers) do - with {:ok, %{info: %{keys: keys}}} <- WebFinger.ensure_keys_present(user), - {:ok, private_key, _} <- Salmon.keys_from_pem(keys) do + with {:ok, %{info: %{keys: keys}}} <- User.ensure_keys_present(user), + {:ok, private_key, _} <- Keys.keys_from_pem(keys) do HTTPSignatures.sign(private_key, user.ap_id <> "#main-key", headers) end end |