added some logs

forgejo-federated-star
Michael Jerger 7 months ago
parent e10994712b
commit 2296de7cfa

@ -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)
}

@ -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")

Loading…
Cancel
Save