0
0
Fork 0
mirror of https://codeberg.org/forgejo/docs.git synced 2024-12-22 22:17:10 -05:00
forgejo-docs/docs/_mermaid/developer/threat-analysis/threat-analysis-like-activity.md
Michael Jerger 98dac9cb1f Documentation for federated-star (#639)
Preview:

* https://forgejo.codeberg.page/@docs_pull_639/docs/next/developer/federation-architecture/
* https://forgejo.codeberg.page/@docs_pull_639/docs/next/developer/threat-analysis/
* https://forgejo.codeberg.page/@docs_pull_639/docs/next/developer/adr/

Co-authored-by: patdyn <erik.seiert@meissa-gmbh.de>
Co-authored-by: Clemens <clemens.geibel@meissa-gmbh.de.de>
Reviewed-on: https://codeberg.org/forgejo/docs/pulls/639
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>
Reviewed-by: Panagiotis "Ivory" Vasilopoulos <git@n0toose.net>
Co-authored-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
Co-committed-by: Michael Jerger <michael.jerger@meissa-gmbh.de>
2024-06-29 16:47:25 +00:00

46 lines
1.4 KiB
Markdown

```mermaid
sequenceDiagram
participant fs as foreign_repository_server
participant os as our_repository_server
fs ->> os: post /api/activitypub/repository-id/1/inbox {Like-Activity}
activate os
os ->> repository: load "1"
os ->> os: validate actor id inputs
activate os
os ->> FederationInfo: get by Host
os ->> os: if FederatonInfo not found
activate os
os ->> fs: get .well-known/nodeinfo
os ->> NodeInfoWellKnown: create & validate
os ->> fs: get api/v1/nodeinfo
os ->> NodeInfo: create & validate
os ->> FederationInfo: create
deactivate os
os ->> ForgeLike: validate
deactivate os
os ->> user: search for user with actor-id
os ->> os: create user if not found
activate os
os ->> fs: get /api/activitypub/user-id/{id from actor}
os ->> ForgePerson: validate
os ->> user: create user from ForgePerson
deactivate os
os ->> repository: execute star
os ->> FederationInfo: update latest activity
os -->> fs: 200 ok
deactivate os
```
```mermaid
flowchart TD
A(User) --> |stars a federated repository| B(foreign repository server)
B --> |Like Activity| C(our repository server)
C --> |get NodeInfoWellKnown| B
C --> |get NodeInfo| B
C --> |get Person Actor| B
C --> |cache/create federated user locally| D(our database)
C --> |cache/create NodeInfo locally| D(our database)
C --> |add star to repo locally| D
```