Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "login required" endpoints behind "admin" check and fix bug in admin auth handler #1013

Merged
merged 1 commit into from
Apr 4, 2024

Conversation

haoming29
Copy link
Contributor

@haoming29 haoming29 commented Mar 29, 2024

Fixes #1004

This PR also fix a bug in admin auth handler where if the user is not a admin, the handler didn't abort the request, causing the response to pass.

This is a critical bug with security concern and we should consider backport to 7.6 and 7.5.

Improved testing to cover both cases.

* Also fixed a bug where admin auth handler didn't abort at check failure
@haoming29 haoming29 added this to the v7.7.0 milestone Mar 29, 2024
@haoming29 haoming29 added bug Something isn't working critical High priority for next release labels Mar 29, 2024
@haoming29 haoming29 requested a review from jhiemstrawisc March 29, 2024 21:28
@jhiemstrawisc
Copy link
Member

Is there any hand test I should run for this to make sure things are working as expected?

@haoming29
Copy link
Contributor Author

Is there any hand test I should run for this to make sure things are working as expected?

Try /api/v1.0/config without logging in, logging as a non-admin user (I recommend run the test against registry), both of which should give you 401/403 error (instead of 200 for now).

Another endpoint to check is the /api/v1.0/registry_ui/namespace/100 with a DELETE verb at the registry, and you should get the same result as above

Copy link
Member

@jhiemstrawisc jhiemstrawisc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM and we ran through the hand tests together. Thanks!

@jhiemstrawisc jhiemstrawisc merged commit 89258ab into PelicanPlatform:main Apr 4, 2024
19 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working critical High priority for next release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Users with role "user" can view config
2 participants