Problem/Motivation
As explained in #3272173 . But focusing on first scenario:
>> ... Create a Group (as in multiple users who are members of a Group defined by the Group module) controlled activitypub group type actor.
Proposed resolution
Be more generic when picking entity for an actor.
Replace user by generic entity (but preserving all the existing and working code for user -> person case)
Let other modules to implement their own kind of actors.
New route proposal.
In the issue branch there's a Draft implementation in "self" routes:
As now the route /user/{user_id}/activitypub/{actor} is used, It will be great to use
/{entity_type}/{entity_id}/activitypub/{actor} for routes, to use an agnostic method to generate the output, but this is not possible as the first item in path cannot be an argument as said in
https://www.drupal.org/docs/drupal-apis/routing-system/structure-of-routes →
:
the first item of the path cannot be an argument, and must be a string.
So a broader /actor/{entity_type}/{entity_id}/activitypub/{actor} could be used. The same for selfjson controller method.
It needs to be decided where to map the drupal entities to actor types, if it could be in activitypub module or in dedicated module.
If accepted it can be extended to other routes that are user dependent (inbox, outbox, followers, following and delete routes), but these are not as critical as canonical user route, so these actor routes could be replaced to be more compatible with different kind of entities.