mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2024-12-23 00:26:30 +00:00
More logging for signature problems.
This commit is contained in:
parent
e5fcc51a06
commit
ac67453e8a
2 changed files with 5 additions and 1 deletions
|
@ -20,6 +20,7 @@ defmodule Pleroma.Web.Plugs.HTTPSignaturePlug do
|
||||||
|
|
||||||
assign(conn, :valid_signature, HTTPSignatures.validate_conn(conn))
|
assign(conn, :valid_signature, HTTPSignatures.validate_conn(conn))
|
||||||
else
|
else
|
||||||
|
Logger.debug("No signature header!")
|
||||||
conn
|
conn
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
defmodule Pleroma.Web.HTTPSignatures do
|
defmodule Pleroma.Web.HTTPSignatures do
|
||||||
alias Pleroma.User
|
alias Pleroma.User
|
||||||
alias Pleroma.Web.ActivityPub.ActivityPub
|
alias Pleroma.Web.ActivityPub.ActivityPub
|
||||||
|
require Logger
|
||||||
|
|
||||||
def split_signature(sig) do
|
def split_signature(sig) do
|
||||||
default = %{"headers" => "date"}
|
default = %{"headers" => "date"}
|
||||||
|
@ -32,6 +33,7 @@ defmodule Pleroma.Web.HTTPSignatures do
|
||||||
if validate_conn(conn, public_key) do
|
if validate_conn(conn, public_key) do
|
||||||
true
|
true
|
||||||
else
|
else
|
||||||
|
Logger.debug("Could not validate, re-fetching user and trying one more time.")
|
||||||
# Fetch user anew and try one more time
|
# Fetch user anew and try one more time
|
||||||
with actor_id <- conn.params["actor"],
|
with actor_id <- conn.params["actor"],
|
||||||
{:ok, _user} <- ActivityPub.make_user_from_ap_id(actor_id),
|
{:ok, _user} <- ActivityPub.make_user_from_ap_id(actor_id),
|
||||||
|
@ -40,7 +42,8 @@ defmodule Pleroma.Web.HTTPSignatures do
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
_ -> false
|
e ->
|
||||||
|
Logger.debug("Could not public key!")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue