From d81b8a9e144ed0f67ccf51b709ac678919869eb4 Mon Sep 17 00:00:00 2001 From: Oneric Date: Tue, 25 Nov 2025 00:00:00 +0000 Subject: [PATCH] http/middleware/httpsig: drop opt-in privkey scrubbing This was replaced by the always-on exclusion from the inspect protocol implemented in the previous commit which is far more robus. This partially reverts commit 2b4b68eba790b8f85955eb2c3c5eb81a5fc9a11d; the more detailed response for generic HTTP errors is retained. --- lib/pleroma/http/middleware/httpsignature.ex | 14 -------------- lib/pleroma/object/fetcher.ex | 2 +- lib/pleroma/web/activity_pub/publisher.ex | 2 +- 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/lib/pleroma/http/middleware/httpsignature.ex b/lib/pleroma/http/middleware/httpsignature.ex index 90d76b3fa..a26ac1855 100644 --- a/lib/pleroma/http/middleware/httpsignature.ex +++ b/lib/pleroma/http/middleware/httpsignature.ex @@ -16,20 +16,6 @@ defmodule Pleroma.HTTP.Middleware.HTTPSignature do (Note: the third argument holds static middleware options from client creation) """ - - @doc """ - If logging raw Tesla.Env use this if you wish to redact signing key details - """ - def redact_keys(env) do - case get_in(env, [:opts, :httpsig, :signing_key]) do - nil -> env - key -> put_in(env, [:opts, :httpsig, :signing_key], redact_key_details(key)) - end - end - - defp redact_key_details(%SigningKey{key_id: id}), do: id - defp redact_key_details(key), do: key - @impl true def call(env, next, _options) do env = maybe_sign(env) diff --git a/lib/pleroma/object/fetcher.ex b/lib/pleroma/object/fetcher.ex index 2609d3a08..8810135fb 100644 --- a/lib/pleroma/object/fetcher.ex +++ b/lib/pleroma/object/fetcher.ex @@ -422,7 +422,7 @@ def get_object(id) do # connection/protocol-related error {:ok, %Tesla.Env{} = env} -> - {:error, {:http_error, :connect, Pleroma.HTTP.Middleware.HTTPSignature.redact_keys(env)}} + {:error, {:http_error, :connect, env}} {:error, e} -> {:error, e} diff --git a/lib/pleroma/web/activity_pub/publisher.ex b/lib/pleroma/web/activity_pub/publisher.ex index 942eebea5..482c89b6c 100644 --- a/lib/pleroma/web/activity_pub/publisher.ex +++ b/lib/pleroma/web/activity_pub/publisher.ex @@ -86,7 +86,7 @@ defp format_error_response(%Tesla.Env{status: code, headers: headers}), do: {:http_error, code, headers} defp format_error_response(%Tesla.Env{} = env), - do: {:http_error, :connect, Pleroma.HTTP.Middleware.HTTPSignature.redact_keys(env)} + do: {:http_error, :connect, env} defp format_error_response(response), do: response