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.
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
CSS-9389 Implement the
EntitlementsService
interface #1277CSS-9389 Implement the
EntitlementsService
interface #1277Changes from 1 commit
c297be2
a85d537
3d89f93
b89244b
d7a23f3
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
This should be removed.
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.
This should be removed.
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.
This should be removed. Generally, let's remove all entitlements that has a receiver other than
user
,user:*
, orgroup#member
.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.
I don't think we should be adding this test in here, otherwise we might start to test all our HTTP endpoints in here which is probably not what we want.
@ale8k @babakks @alesstimec What do you guys think about this?
In other packages like
internal/jimmjwx/
we create a JIMM service by callingjimm.NewService
. Should service layer tests exist here (in service_test.go) or in the packageinternal/rebac_admin
?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.
@SimoneDutto Yeah, please remove this test.
@kian99 I agree. We already have a test for ReBAC Admin API in
service_test.go
but that's just for the sake of composition and to make sure we're correctly enabling the API.Other endpoints should be tested inside the
rebac_admin
package. Also, I think we shouldn't test against the HTTP endpoints (i.e., calling/entitlements
directly) because that's the responsibility of therebac-admin-ui-handlers
library (and we should know as little as possible about the HTTP API endpoints in JIMM). So, we can safely assume the library works as expected.Generally, in the
rebac_admin
package tests we should just call the methods (likeEntitlementsService.RawEntitlements
) directly and assert the returned value against an expected value. However, in our static implementation ofEntitlementsService
interface, I don't see a point of having tests only to assert against a the same static values.