Skip to content

Fix HTTP sig tweak on KeyId

Thomas Sileo requested to merge t/pleroma:develop into develop

Hi,

Since recent update, Pleroma rejects all messages from microblog.pub instances because the KeyId does not contains a path (https://microblog.pub#main-key). Federation used to work before.

Here is the error:

pleroma_web | 09:44:11.129 request_id=FbWI-ZRgry7EJxMAAAvB [error] Internal server error: %FunctionClauseError{args: nil, arity: 2, clauses: nil, function: :ends_with?, kind: nil, module: String}
pleroma_web | 09:44:11.157 [error] #PID<0.989.0> running Pleroma.Web.Endpoint (connection #PID<0.988.0>, stream id 1) terminated
pleroma_web | Server: [redacted]:80 (http)                                                                                                                                                   
pleroma_web | Request: POST /users/toto/inbox                                                                                                                                                                      
pleroma_web | ** (exit) an exception was raised:                                                                                                                                                                   
pleroma_web |     ** (FunctionClauseError) no function clause matching in String.ends_with?/2                                                                                                                      
pleroma_web |         (elixir) lib/string.ex:2039: String.ends_with?(nil, "/publickey")                                                                                                                            
pleroma_web |         (pleroma) lib/pleroma/signature.ex:18: Pleroma.Signature.key_id_to_actor_id/1                                 
pleroma_web |         (pleroma) lib/pleroma/signature.ex:29: Pleroma.Signature.fetch_public_key/1                                 
pleroma_web |         (http_signatures) lib/http_signatures/http_signatures.ex:40: HTTPSignatures.validate_conn/1                                                                                   
pleroma_web |         (pleroma) lib/pleroma/plugs/http_signature.ex:38: Pleroma.Web.Plugs.HTTPSignaturePlug.call/2                                                                                  
pleroma_web |         (pleroma) Pleroma.Web.Router.activitypub/2                                                                                                                                                   
pleroma_web |         (pleroma) lib/pleroma/web/router.ex:5: Pleroma.Web.Router.__pipe_through19__/1                                                                                                               
pleroma_web |         (phoenix) lib/phoenix/router.ex:283: Phoenix.Router.__call__/2                                                                                                                
pleroma_web | 09:44:12.878 request_id=FbWI-f5vkNDBaNsAAAai [error] Internal server error: %FunctionClauseError{args: nil, arity: 2, clauses: nil, function: :ends_with?, kind: nil, module: String}                
pleroma_web | 09:44:12.880 [error] #PID<0.993.0> running Pleroma.Web.Endpoint (connection #PID<0.992.0>, stream id 1) terminated

Thanks!

Merge request reports