From 64abf87fb0df10f3ef40cbf20dd2a5e7fbd34a97 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Fri, 27 Oct 2023 12:12:31 +0200 Subject: [PATCH] added some logs --- routers/api/v1/activitypub/repository.go | 2 ++ services/context/repository.go | 3 +++ 2 files changed, 5 insertions(+) diff --git a/routers/api/v1/activitypub/repository.go b/routers/api/v1/activitypub/repository.go index 1f2599f0de..b2f17a184e 100644 --- a/routers/api/v1/activitypub/repository.go +++ b/routers/api/v1/activitypub/repository.go @@ -7,6 +7,7 @@ import ( "net/http" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/log" ) // Repository function returns the Repository actor for a repo @@ -26,6 +27,7 @@ func Repository(ctx *context.APIContext) { // "200": // "$ref": "#/responses/ActivityPub" + log.Error("Repository") ctx.Status(http.StatusNoContent) } diff --git a/services/context/repository.go b/services/context/repository.go index b886e7e0df..0270689cab 100644 --- a/services/context/repository.go +++ b/services/context/repository.go @@ -8,6 +8,7 @@ import ( repo_model "code.gitea.io/gitea/models/repo" "code.gitea.io/gitea/modules/context" + "code.gitea.io/gitea/modules/log" ) // RepositoryIDAssignmentAPI returns a middleware to handle context-repo assignment for api routes @@ -16,6 +17,8 @@ func RepositoryIDAssignmentAPI() func(ctx *context.APIContext) { // TODO: enough validation for security? repositoryID := ctx.ParamsInt64(":repository-id") + log.Info("RepositoryIDAssignmentAPI: %v", repositoryID) + //TODO: check auth here ? if !ctx.Repo.HasAccess() && !ctx.IsUserSiteAdmin() { ctx.Error(http.StatusForbidden, "reqAnyRepoReader", "user should have any permission to read repository or permissions of site admin")