-
Notifications
You must be signed in to change notification settings - Fork 952
Prevent cluster groups from being deleted when referenced by a projects' configuration #15119
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, except the SQL injection flaw ;)
Whoopsie 😆 Thank you CodeQL 🙏 Not sure how I convinced myself that this was ok... |
bac19b8
to
2e939e5
Compare
2e939e5
to
c78bd05
Compare
Static analysis failure |
Signed-off-by: Mark Laing <[email protected]> # Conflicts: # doc/api-extensions.md # shared/version/api.go
Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
This duplicates `(*cluster.ClusterGroup).ToAPI`. Signed-off-by: Mark Laing <[email protected]>
This function queries for projects that have the group name present in the value for the config key `restricted.cluster.groups`. Then it parses the config value properly to check for an exact match. Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
When calling `make` we should have the form: make([]<type>, 0,<expected_length>) and then append to it. Otherwise we risk having uninitialised elements (e.g. by accidentally appending instead). Signed-off-by: Mark Laing <[email protected]>
This includes a small refactor of `GET /1.0/cluster/groups` where the handler was unnecessarily iterating over the list of groups twice. Signed-off-by: Mark Laing <[email protected]>
Signed-off-by: Mark Laing <[email protected]>
…ced by a project. Signed-off-by: Mark Laing <[email protected]>
c78bd05
to
9c38fc5
Compare
Fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Follow up to #15119 Cluster group used-by URLs we're not being filtered by what the caller is able to view. This allowed restricted users to see the URLs of projects that they do not have access to.
Adds an API extension
clustering_groups_used_by
and adds aUsedBy
field toapi.ClusterGroup
. On GET requests, theUsedBy
URLs are projects that contain the cluster group inrestricted.cluster.groups
. DELETE requests will fail if the cluster group is used by a project.Closes #15118