Skip to content

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Oct 14, 2025

Description

This PR contains changes to the ResourceAccessControlClient to start to refer to resourceType everywhere instead of resourceIndex. Currently, the repo assumes a 1-to-1 relationship between resource type and index, but this should be relaxed to allow multiple resource types in a single index (think dashboards saved objects).

  • Category (Enhancement, New feature, Bug fix, Test fix, Refactoring, Maintenance, Documentation)

Enhancement

Check List

  • New functionality includes testing
  • New functionality has been documented
  • New Roles/Permissions have a corresponding security dashboards plugin PR
  • API changes companion pull request created
  • Commits are signed per the DCO using --signoff

By 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.

cwperks and others added 30 commits September 25, 2025 22:16
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
… as protected and fixes share api action to throw 400 on resources not marked as protected

Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
…ad-safe in resource-plugin-info class

Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Darshit Chanpura <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
Signed-off-by: Craig Perkins <[email protected]>
@cwperks
Copy link
Member Author

cwperks commented Oct 14, 2025

I plan to add new integration tests...either in this PR or another that add a second resource type (sample-resource-group) and keep records in the same index as sample-resource and then run through different scenarios for sharing.

Copy link

codecov bot commented Oct 16, 2025

Codecov Report

❌ Patch coverage is 63.70192% with 151 lines in your changes missing coverage. Please review.
✅ Project coverage is 72.97%. Comparing base (f276779) to head (d487a01).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...ava/org/opensearch/sample/SampleResourceGroup.java 0.00% 28 Missing ⚠️
...ons/transport/GetResourceGroupTransportAction.java 48.38% 14 Missing and 2 partials ⚠️
.../transport/CreateResourceGroupTransportAction.java 75.00% 11 Missing and 3 partials ⚠️
...arch/security/resources/ResourceAccessHandler.java 56.00% 8 Missing and 3 partials ⚠️
.../transport/DeleteResourceGroupTransportAction.java 63.63% 6 Missing and 2 partials ⚠️
...ctions/rest/create/CreateResourceGroupRequest.java 46.15% 7 Missing ⚠️
...ctions/rest/create/UpdateResourceGroupRequest.java 58.82% 7 Missing ⚠️
...ons/rest/search/SearchResourceGroupRestAction.java 30.00% 7 Missing ⚠️
.../transport/UpdateResourceGroupTransportAction.java 77.77% 5 Missing and 1 partial ⚠️
...tions/rest/create/CreateResourceGroupResponse.java 58.33% 5 Missing ⚠️
... and 12 more
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5713      +/-   ##
==========================================
+ Coverage   72.91%   72.97%   +0.06%     
==========================================
  Files         412      435      +23     
  Lines       26215    26531     +316     
  Branches     3964     3975      +11     
==========================================
+ Hits        19114    19362     +248     
- Misses       5193     5253      +60     
- Partials     1908     1916       +8     
Files with missing lines Coverage Δ
...pensearch/sample/SampleResourceGroupExtension.java 100.00% <100.00%> (ø)
...va/org/opensearch/sample/SampleResourcePlugin.java 96.87% <100.00%> (+1.22%) ⬆️
...actions/rest/create/CreateResourceGroupAction.java 100.00% <100.00%> (ø)
...actions/rest/create/UpdateResourceGroupAction.java 100.00% <100.00%> (ø)
...actions/rest/delete/DeleteResourceGroupAction.java 100.00% <100.00%> (ø)
...group/actions/rest/get/GetResourceGroupAction.java 100.00% <100.00%> (ø)
...p/actions/rest/get/GetResourceGroupRestAction.java 100.00% <100.00%> (ø)
...actions/rest/search/SearchResourceGroupAction.java 100.00% <100.00%> (ø)
...in/java/org/opensearch/sample/utils/Constants.java 0.00% <ø> (ø)
.../opensearch/security/OpenSearchSecurityPlugin.java 85.39% <100.00%> (ø)
... and 28 more

... and 12 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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.

2 participants