HTTP sig fixes.

This commit is contained in:
lain 2018-11-27 17:42:45 +01:00
parent f983c1d0c6
commit ec464ef20a
2 changed files with 11 additions and 1 deletions

View File

@ -98,6 +98,16 @@ def remote_user_creation(info, params) do
]) ])
end end
def user_upgrade(info, params) do
info
|> cast(params, [
:ap_enabled,
:source_data,
:banner,
:locked
])
end
def set_source_data(info, source_data) do def set_source_data(info, source_data) do
params = %{source_data: source_data} params = %{source_data: source_data}

View File

@ -65,7 +65,7 @@ def build_signing_string(headers, used_headers) do
end end
def sign(user, headers) do def sign(user, headers) do
with {:ok, %{info: %{"keys" => keys}}} <- Pleroma.Web.WebFinger.ensure_keys_present(user), with {:ok, %{info: %{keys: keys}}} <- Pleroma.Web.WebFinger.ensure_keys_present(user),
{:ok, private_key, _} = Pleroma.Web.Salmon.keys_from_pem(keys) do {:ok, private_key, _} = Pleroma.Web.Salmon.keys_from_pem(keys) do
sigstring = build_signing_string(headers, Map.keys(headers)) sigstring = build_signing_string(headers, Map.keys(headers))