Problem/Motivation

If keys could not be generated so generateKeys in ActivityPubFormAlter.php returns false it should not allow to save the actor. As expected, if there's no key the other sites will return it when trying to interact:

 [error]  Error creating the signature: Unable to read key                                                                                                                                                                                                                    
 [error]  Outbox exception to https://mastodon.social/inbox for x  to https://mastodon.social/inbox: Client error: `POST https://mastodon.social/inbox` resulted in a `401 Unauthorized` response:                                                                             
Incompatible request signature. keyId and signature are required

Leading to a bad experience by the end user, as no signal of failure is presented to the user while no communication could be established from outside.

Steps to reproduce

Create the actor while private directory is forbidden to write in.

Proposed resolution

Do not allow actor save if keys could not be generated.

User interface changes

Do not save the actor and additionally show a message to the user reporting that keys could not be generated.

CommentFileSizeAuthor
#5 3319068-5.patch989 bytesaleix
#3 3319068-2.patch986 bytesaleix
Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Comments

aleix created an issue. See original summary.

swentel’s picture

Hmm, yeah, I added a warning already on the form when you want to try and enable an actor but the private wrapper does not exists, but I guess it should be much harder still :)

aleix’s picture

Status: Needs work » Needs review
StatusFileSize
new986 bytes

Something is failing in issue forking :/ attaching patch

swentel’s picture

Looks good, the only thing I would change is : 'Check the logs or ask administrator' to 'Check the logs or ask an administrator'

After that, I'll commit!

aleix’s picture

StatusFileSize
new989 bytes

changed

  • swentel committed 37fa824 on 1.0.x
    Issue #3319068 by aleix: Do not allow actor creation if it cannot...
swentel’s picture

Status: Needs review » Fixed

Committed and pushed, thanks!

swentel’s picture

Status: Fixed » Closed (fixed)