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

Namespace schema does not correctly show permitted collectionMethods #146

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

votdev
Copy link
Member

@votdev votdev commented Jan 22, 2024

The implementation is not using the Go slices package because this requires two calls (Sort and Compact) which is too expensive.

Fixes: rancher/rancher#36799

@votdev votdev force-pushed the issue_36799_uniq_collectionmethods_dup branch 3 times, most recently from ae4558a to 96dbb7c Compare January 22, 2024 18:28
@@ -162,6 +180,8 @@ func (c *Collection) schemasForSubject(access *accesscontrol.AccessSet) (*types.
continue
}

s.CollectionMethods = uniq(s.CollectionMethods)
Copy link
Member Author

Choose a reason for hiding this comment

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

Maybe this call can be moved to https://github.com/votdev/steve/blob/7a749b127d4fa57af225a7c209ee0d0bb7beed73/pkg/schema/factory.go#L166, but i'm not sure how it is possible to get 3 GET entries (see here) in the slice in that case (i assume only 2).

@moio moio requested a review from a team as a code owner July 5, 2024 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Namespace schema shows repeated methods in collectionMethods
1 participant