mirror of
https://github.com/go-gitea/gitea.git
synced 2026-05-25 03:45:02 +02:00
LOGS
This commit is contained in:
parent
4ccb766bf2
commit
c7d20802af
@ -4,6 +4,7 @@
|
|||||||
package packages
|
package packages
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
actions_model "code.gitea.io/gitea/models/actions"
|
actions_model "code.gitea.io/gitea/models/actions"
|
||||||
@ -108,11 +109,13 @@ func reqPackageAccess(accessMode perm.AccessMode) func(ctx *context.Context) {
|
|||||||
// If package is not linked to any repo (org-level package), deny access from Actions
|
// If package is not linked to any repo (org-level package), deny access from Actions
|
||||||
// Actions tokens should only access packages linked to repos
|
// Actions tokens should only access packages linked to repos
|
||||||
if packageRepoID == 0 {
|
if packageRepoID == 0 {
|
||||||
|
fmt.Printf("DEBUG: packageRepoID is 0 for pkgID %d. Denying access.\n", ctx.Package.Descriptor.Package.ID)
|
||||||
ctx.HTTPError(http.StatusForbidden, "reqPackageAccess", "Actions tokens cannot access packages not linked to a repository")
|
ctx.HTTPError(http.StatusForbidden, "reqPackageAccess", "Actions tokens cannot access packages not linked to a repository")
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if task.RepoID != packageRepoID {
|
if task.RepoID != packageRepoID {
|
||||||
|
fmt.Printf("DEBUG: taskRepoID %d != packageRepoID %d. Checking cross-repo.\n", task.RepoID, packageRepoID)
|
||||||
// Cross-repository access - check org policy
|
// Cross-repository access - check org policy
|
||||||
cfg, err := actions_model.GetOrgActionsConfig(ctx, ctx.Package.Owner.ID)
|
cfg, err := actions_model.GetOrgActionsConfig(ctx, ctx.Package.Owner.ID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user