Resolve issues listing catalog by non-admin users#22843
Closed
ErwinsExpertise wants to merge 1 commit intogoharbor:mainfrom
Closed
Resolve issues listing catalog by non-admin users#22843ErwinsExpertise wants to merge 1 commit intogoharbor:mainfrom
ErwinsExpertise wants to merge 1 commit intogoharbor:mainfrom
Conversation
c232414 to
2e7a24f
Compare
Signed-off-by: Erwin Evans <zew732@my.utsa.edu>
2e7a24f to
0f871ac
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request updates the
/v2/_catalogendpoint to improve repository listing security and access control. Now, only authenticated users can see repositories, and the list is filtered based on the user's permissions: system admins see all repositories, while other users only see repositories they have pull access to. The changes also include comprehensive tests for these behaviors.Access control and filtering improvements:
/v2/_catalogendpoint now returns an empty list for unauthenticated users, and only lists repositories the user is authorized to pull for authenticated non-admin users. System admins see all repositories. (src/server/registry/catalog.go, [1] [2]src/server/middleware/v2auth/auth.go, [1] [2]Testing enhancements:
src/server/registry/catalog_test.go, src/server/registry/catalog_test.goR139-R260)src/server/middleware/v2auth/auth_test.go, src/server/middleware/v2auth/auth_test.goL197-R197)Dependency and import updates:
src/server/registry/catalog.go, [1];src/server/registry/catalog_test.go, [2]Issue being fixed
Fixes #22194
Please indicate you've done the following: