Add Signed Fetch Statistics #312

Merged
floatingghost merged 4 commits from luna/akkoma:http-signature-statistics into develop 2022-11-26 19:22:56 +00:00
Contributor

Close #304.

Notes:

  • This patch was made on top of Pleroma develop, so I created a separate cachex worker for request signature actions, instead of Akkoma's instance cache. If that is a merge blocker, I can attempt to move logic around for that.
  • Regarding the has_request_signatures: true -> false state transition: I think that is a higher level thing (resetting instance state on new instance actor key) which is separate from the changes relevant to this one.
Close #304. Notes: - This patch was made on top of Pleroma develop, so I created a separate cachex worker for request signature actions, instead of Akkoma's instance cache. If that is a merge blocker, I can attempt to move logic around for that. - Regarding the `has_request_signatures: true -> false` state transition: I think that is a higher level thing (resetting instance state on new instance actor key) which is separate from the changes relevant to this one.
luna added 1 commit 2022-11-25 15:20:39 +00:00
ci/woodpecker/pr/woodpecker Pipeline failed Details
dd92d0af61
Add Signed Fetch Statistics
floatingghost reviewed 2022-11-26 18:31:46 +00:00
floatingghost left a comment
Owner

in the main this looks good!

a few little bits to touch up, but otherwise seems ok to me - the error message is the main thing i'm concerned with

in the main this looks good! a few little bits to touch up, but otherwise seems ok to me - the error message is the main thing i'm concerned with
@ -44,2 +44,4 @@
end
end
def set_request_signatures(url_or_host), do: Instance.set_request_signatures(url_or_host)

you could probably use a defdelegate set_request_signatures(url_or_host), to: Instance here

you could probably use a `defdelegate set_request_signatures(url_or_host), to: Instance` here
luna marked this conversation as resolved
@ -81,0 +104,4 @@
:noop
any ->
Logger.warn("expected request signature cache to run, got #{any}")

this is a nitpick, but this error message is a bit hard to parse

perhaps you want something like expected request signature cache to return a boolean, instead got ...?

this is a nitpick, but this error message is a bit hard to parse perhaps you want something like `expected request signature cache to return a boolean, instead got ...`?
luna marked this conversation as resolved
@ -124,0 +127,4 @@
host = "domain.com"
{:ok, instance} = Instances.set_request_signatures(host)
assert instance.has_request_signatures

maybe you want to check that the expected value is cached here as well

maybe you want to check that the expected value is cached here as well
luna marked this conversation as resolved
luna added 3 commits 2022-11-26 18:51:44 +00:00

works for me, thanks a lot!

works for me, thanks a lot!
floatingghost merged commit a90c45b7e9 into develop 2022-11-26 19:22:56 +00:00
floatingghost deleted branch http-signature-statistics 2022-11-26 19:22:56 +00:00
Sign in to join this conversation.
No description provided.