-
Notifications
You must be signed in to change notification settings - Fork 19
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
feat: RBAC support (Sync/Async) #349
base: main
Are you sure you want to change the base?
Conversation
…locally Pass lombok version to lombok-maven-plugin explicitly, as the default version is not up-to-date. See: awhitford/lombok.maven#179 (comment)
@EqualsAndHashCode makes comparing Role and Permission objects easy
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.
Orca Security Scan Summary
Status | Check | Issues by priority | |
---|---|---|---|
Passed | Infrastructure as Code | 0 0 0 0 | View in Orca |
Passed | SAST | 0 0 0 0 | View in Orca |
Passed | Secrets | 0 0 0 0 | View in Orca |
Passed | Vulnerabilities | 0 0 0 0 | View in Orca |
Makes creating several permissions for the same resource easier. For example, instead of 'Permission.data('Pizza', CREATE), Permission.data('Pizza', DELETE)' users can write 'Permission.data('Pizza', CREATE, DELETE)'. To avoid having ~4 different withPermission() builder methods in the client classes all factory methods on Permission class will return Permission[] (even if known to be length 1).
Moved to a separate file and documented.
* Then {@code MyAction.FOO} can be retrieved from "do_foo" using | ||
* {@link #fromString}. | ||
*/ | ||
interface RbacAction { |
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.
shouldn't RbacAction interface be public?
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.
It doesn't need to, because we only ever use it internally for deserializing responses from the server.
What the user passes/receives is one of the "concrete" public enums that implement RbacAction
.
Ideally, we want to shield the user from the methods of this interface, because passing an invalid string might throw an IllegalArgumentException
.
Related to #343.
This PR is the first iteration of that story, adding RBAC support to the sync client.
Initially it drew a lot on the Python's client, but I ended up re-organizing things to be consistent with the current client.
client.async().roles()
Files to pay attention to (have denser logic):
Permission.java
WeaviatePermission.java
Role.java
WeaviateRole.java
ClientRbacTestSuite.java