From 6de8fba14d85121fff249b080c2cca30d9db7289 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Wed, 13 Dec 2023 16:06:53 +0100 Subject: [PATCH] minor refactorings --- routers/api/v1/activitypub/repository.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 22a0935169..b8f6857845 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -95,7 +95,7 @@ func SearchUsersByLoginName(loginName string) ([]*user_model.User, error) { } // TODO: Move most of this fkt to http client -func getBody(remoteStargazer, starReceiver string, ctx *context.APIContext) ([]byte, error) { // ToDo: We could split this: move body reading to unmarshall +func getBody(remoteStargazer, signerId string, ctx *context.APIContext) ([]byte, error) { // ToDo: We could split this: move body reading to unmarshall // TODO: The star receiver signs the http get request will maybe not work. // The remote repo has probably diferent keys as the local one. @@ -103,12 +103,12 @@ func getBody(remoteStargazer, starReceiver string, ctx *context.APIContext) ([]b // Why should we use a signed request here at all? // > To provide an extra layer of security against in flight tampering: https://github.com/go-fed/httpsig/blob/55836744818e/httpsig.go#L116 - client, err := api.NewClient(ctx, actionsUser, starReceiver) // ToDo: Do we get a publicKeyId of owner or repo? + client, err := api.NewClient(ctx, actionsUser, signerId) // ToDo: Do we get a publicKeyId of owner or repo? if err != nil { return []byte{0}, err } // get_person_by_rest - response, err := client.Get([]byte{0}, remoteStargazer) + response, err := client.Get(remoteStargazer) if err != nil { return []byte{0}, err }