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 status filter to registry API, improve Swagger docs #610

Merged
merged 4 commits into from
Jan 9, 2024

Conversation

haoming29
Copy link
Contributor

Closes #606 and #591

  • Improve Swagger to include csrf token, query params, RBAC
  • Refactor namespace db function to allow generic filtering
  • Control ns visibility based on auth status

@haoming29 haoming29 marked this pull request as ready for review January 5, 2024 22:10
@haoming29 haoming29 added enhancement New feature or request documentation Improvements or additions to documentation labels Jan 5, 2024
@haoming29 haoming29 added this to the v7.4.0 milestone Jan 5, 2024
@haoming29 haoming29 changed the title Add status filter to registry API Add status filter to registry API, improve Swagger docs Jan 5, 2024
registry/registry_db.go Show resolved Hide resolved
registry/registry_db.go Outdated Show resolved Hide resolved
registry/registry_db.go Outdated Show resolved Hide resolved
}
if existingStatus == Approved {
log.Errorf("User '%s' is trying to modify approved namespace registration with id=%d", user, id)
ctx.JSON(http.StatusForbidden, gin.H{"error": "You don't have permission to modify an approved registration. Please contact your federation administrator"})
Copy link
Member

Choose a reason for hiding this comment

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

How do we handle key rotations if we don't allow namespace owners to modify their registrations?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think for now we'd better off now allowing them to modify, even the keys, as we aren't dealing with key rotation in the system. #383 . I imagine to do the rotation, we will have a separate endpoint for partial update like PATCH /registry_ui/namespace/:id/pubkey so that users know what they are doing. For the full-update like what you pointed out here, we should be strict.

web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
web_ui/frontend/app/api/docs/pelican-swagger.yaml Outdated Show resolved Hide resolved
haoming29 and others added 4 commits January 8, 2024 21:10
* Improve Swagger to include csrf token, query params, RBAC
* Refactor namespace db function to allow generic filtering
* Control ns visibility based on auth status
@haoming29 haoming29 linked an issue Jan 9, 2024 that may be closed by this pull request
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!

@jhiemstrawisc jhiemstrawisc merged commit 387f252 into PelicanPlatform:main Jan 9, 2024
9 checks passed
@haoming29 haoming29 deleted the registry-api-p3 branch March 8, 2024 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
2 participants