-
Notifications
You must be signed in to change notification settings - Fork 280
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
Adds a sample resource plugin to demonstrate resource access control in action #4893
base: feature/resource-permissions
Are you sure you want to change the base?
Adds a sample resource plugin to demonstrate resource access control in action #4893
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## feature/resource-permissions #4893 +/- ##
================================================================
+ Coverage 71.42% 71.43% +0.01%
================================================================
Files 334 334
Lines 22517 22552 +35
Branches 3586 3590 +4
================================================================
+ Hits 16082 16110 +28
- Misses 4641 4646 +5
- Partials 1794 1796 +2 |
@@ -0,0 +1 @@ | |||
org.opensearch.sample.SampleResourcePlugin |
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.
Is there a SPI that this file is associated with?
protected void doExecute(Task task, ListAccessibleResourcesRequest request, ActionListener<ListAccessibleResourcesResponse> listener) { | ||
try { | ||
ResourceService rs = SampleResourcePlugin.GuiceHolder.getResourceService(); | ||
List<String> resourceIds = rs.getResourceAccessControlPlugin().listAccessibleResourcesInPlugin(RESOURCE_INDEX_NAME); |
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.
Should we consider giving back resource objects here?
Is there any way we can add tests and run them as a CI check for the sample plugin? (preferably w/o relying on core-side changes bc its not clear when core-side changes can be merged) |
…in action Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
543efbd
to
561e294
Compare
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
f43dc66
to
bfc39ad
Compare
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Description
This PR introduces a sample plugin aimed at demonstrating the usage of resource access control in action. Resource access control is introduced in #4746
Issues Resolved
[TBD]
Testing
Automated + Manual
Check List
- [ ] New functionality has been documented- [ ] New Roles/Permissions have a corresponding security dashboards plugin PR- [ ] API changes companion pull request createdBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.