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.
This commit is contained in:
Oneric 2025-11-25 00:00:00 +00:00
parent 5d8cdd6416
commit d81b8a9e14
3 changed files with 2 additions and 16 deletions

View file

@ -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)

View file

@ -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}

View file

@ -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