diff --git a/modules/forgefed/federation_service.go b/modules/forgefed/federation_service.go index dd3b94777a..68c8212882 100644 --- a/modules/forgefed/federation_service.go +++ b/modules/forgefed/federation_service.go @@ -22,6 +22,13 @@ import ( "github.com/google/uuid" ) +// LikeActivity receives a ForgeLike activity and does the following: +// Validation of the activity +// Creation of a (remote) federationHost if not existing +// Creation of a forgefed Person if not existing +// Validation of incoming RepositoryID against Local RepositoryID +// Star the repo if it wasn't already stared +// Do some mitigation against out of order attacks func LikeActivity(ctx *context.APIContext, form any, repositoryID int64) (int, string, error) { activity := form.(*forgefed.ForgeLike) if res, err := validation.IsValid(activity); !res {