Skip to content

Commit

Permalink
fix(sync): use pagination when querying remote catalog
Browse files Browse the repository at this point in the history
feat(api): added /v2/_catalog pagination, fixes project-zot#2715

Signed-off-by: Eusebiu Petu <[email protected]>
  • Loading branch information
eusebiu-constantin-petu-dbk committed Nov 23, 2024
1 parent 5e30fec commit 7afee3d
Show file tree
Hide file tree
Showing 16 changed files with 767 additions and 67 deletions.
15 changes: 15 additions & 0 deletions pkg/api/authz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"zotregistry.dev/zot/pkg/common"
"zotregistry.dev/zot/pkg/log"
reqCtx "zotregistry.dev/zot/pkg/requestcontext"
storageTypes "zotregistry.dev/zot/pkg/storage/types"
)

const (
Expand All @@ -20,6 +21,20 @@ const (
OPENID = "OpenID"
)

func AuthzFilterFunc(userAc *reqCtx.UserAccessControl) storageTypes.FilterRepoFunc {
return func(repo string) (bool, error) {
if userAc == nil {
return true, nil
}

if userAc.Can(constants.ReadPermission, repo) {
return true, nil
}

return false, nil
}
}

// AccessController authorizes users to act on resources.
type AccessController struct {
Config *config.AccessControlConfig
Expand Down
Loading

0 comments on commit 7afee3d

Please sign in to comment.