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 #2715

Signed-off-by: Eusebiu Petu <petu.eusebiu@gmail.com>
  • Loading branch information
eusebiu-constantin-petu-dbk committed Nov 23, 2024
1 parent 5e30fec commit 5ae5b92
Show file tree
Hide file tree
Showing 16 changed files with 768 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
}

Check warning on line 28 in pkg/api/authz.go

View check run for this annotation

Codecov / codecov/patch

pkg/api/authz.go#L27-L28

Added lines #L27 - L28 were not covered by tests

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 5ae5b92

Please sign in to comment.