architecture proposal: actor mapping: give mappers more duties

This commit is contained in:
André Menrath 2023-10-13 17:58:34 +02:00
parent fb56d094f0
commit ee751a04ee

View file

@ -26,12 +26,11 @@ The following terms are used:
## Actor related
- **actors:** ActivityPub [Actor Objects](https://www.w3.org/TR/activitypub/#actor-objects)
- **actor types:** ActivityPub [Actor Types](https://www.w3.org/TR/activitystreams-vocabulary/#actor-types)
- **WordPress actor types:** Things on WordPress that can be mapped to actors:
- **WordPress actor types:** Things on WordPress that can be mapped to actors, e.g.:
- WordPress users →`Person`
- Whole Blog →`Application` or `Group`
- post types → e.g., `Organization`
- custom definitions → custom actor types
- **mapping:** Which WordPress actor types are mapped to any ActivityPub actors at all and to which ones.
- Post types → e.g., `Organization`
- **Actor mapper:** Describes the mapping of WordPress actor types to any ActivityPub actors.
## General
- **publish/dispatch:** Sending a `Create`, `Update` or `Announce` [Activity](https://www.w3.org/TR/activitypub/#create-activity-outbox).
@ -117,7 +116,7 @@ All publicly accessible WordPress post types can become active for ActivityPub f
| **page** | O | O | - | - |
| **tribe_events** | O | - | X | O |
| **custom_event** | O | - | - | O |
| **…** | O | - | - | - |
| **…** | O | - | - | - |
**columns:** Available transformers
**rows:** Public and non-password protected WordPress post types
@ -194,28 +193,25 @@ Other WordPress actor types might have valid use cases, like actors for categori
- Who is the `actor`, who is the `attributedTo`, who is just sending an `Announce` of a post?
## Proposed starting point for evaluating use cases
We keep in mind that every post type shall only ever send as a `Create` Activity once by one single actor.
We keep in mind that every post shall only ever be sent as a `Create` Activity once, by one single actor.
Therefore when the ActivityPub plugin makes use of a certain WordPress actor type, the WordPress actor type must exactly return one actor, which may depend on the current post being published and on the user doing the action (latter information should also be available within the WP_Post object).
**User Interface:**
| | users | tribe_organizers | custom | blog | category |
| -----------------|:-----:|:----------------:|:------:|:-----:|:--------:|
| **post** | C | O | O | A | A |
| **page** | C | O | O | A | O |
| **tribe_events** | O | C | - | A | 0 |
| **product** | O | - | C | 0 | 0 |
| | User | Event organizers | Product Relay | Relay(Blog) | Categories |
| -----------------|:-----:|:----------------:|:-------------:|:------------:|:----------:|
| **post** | C | - | - | A | A |
| **page** | C | - | - | A | O |
| **tribe_events** | O | C | - | A | 0 |
| **product** | O | - | C | 0 | 0 |
**x:** WordPress actor-types
**x:** Actor mapper
**y:** WordPress post types
**C:** `Create` — can only be assigned once per row
**A:** `Announce` — can be assigned multiple times per row, but only if a `Create` has been assigned before
**user:** the WordPress user publishing or updating something
**all:** blog-wide actor, everything that is published (like a relay)
**custom:** e.g. only a certain post type that gets announced with this actor
**tribe_organizers:** only posts by one organizer
**A:** `Announce` — can be assigned multiple times per row, but only if a `Create` has been assigned before
- Only allow setting something to `Announce`, when a `Create` is already set.
- Maybe forbid, that a user can automatically announce a post, because it's the "lowest level".
- Maybe forbid, that a user can automatically announce a post, because it's the "lowest level".
## Actor collisions
Each ActivityPub actor must have a [unique ID](https://www.w3.org/TR/activitypub/#obj-id). In our case this is an HTTPS URI.