Skip to content

Conversation

@cwperks
Copy link
Member

@cwperks cwperks commented Oct 29, 2025

Description

This PR introduces a few refactors:

  • ResourceProvider to an interface that can be added to in the future with defaults. This will break 2 plugins, but the adaptation is very straightforward and I will raise PRs to do so.
  • ResourceSharing is now constructed with the Builder pattern, again to be forward looking
  • indexResourceSharing now takes the ResourceSharing object as a parameter
  • pruning logic is changed to only modify the current ResourceSharing and index back

All these changes are also included in #5735, but I wanted to do a separate PR to minimize the changes for review so the other PR can be more focused on the functional changes included.

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

Refactoring

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.

nibix
nibix previously approved these changes Oct 31, 2025
Copy link
Member

@DarshitChanpura DarshitChanpura left a comment

Choose a reason for hiding this comment

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

Overall, changes look good. Left a few comments.

Signed-off-by: Craig Perkins <[email protected]>
@codecov
Copy link

codecov bot commented Oct 31, 2025

Codecov Report

❌ Patch coverage is 95.23810% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 73.30%. Comparing base (e145180) to head (954ec6e).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
...nsearch/security/resources/ResourcePluginInfo.java 81.81% 0 Missing and 2 partials ⚠️
...ecurity/resources/ResourceSharingIndexHandler.java 83.33% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5755      +/-   ##
==========================================
+ Coverage   73.26%   73.30%   +0.03%     
==========================================
  Files         435      434       -1     
  Lines       26509    26524      +15     
  Branches     3952     3948       -4     
==========================================
+ Hits        19422    19443      +21     
+ Misses       5201     5199       -2     
+ Partials     1886     1882       -4     
Files with missing lines Coverage Δ
...org/opensearch/sample/SampleResourceExtension.java 100.00% <100.00%> (ø)
...pensearch/sample/SampleResourceGroupExtension.java 100.00% <100.00%> (ø)
.../opensearch/security/OpenSearchSecurityPlugin.java 85.20% <100.00%> (ø)
...arch/security/resources/ResourceAccessHandler.java 74.30% <100.00%> (-0.87%) ⬇️
...security/resources/ResourceActionGroupsHelper.java 53.84% <100.00%> (-2.26%) ⬇️
...arch/security/resources/ResourceIndexListener.java 96.15% <100.00%> (+0.23%) ⬆️
...i/migrate/MigrateResourceSharingInfoApiAction.java 76.02% <100.00%> (+0.72%) ⬆️
...ch/security/resources/sharing/ResourceSharing.java 80.59% <100.00%> (-0.49%) ⬇️
...ensearch/security/resources/sharing/ShareWith.java 75.00% <100.00%> (-8.34%) ⬇️
...nsearch/security/resources/ResourcePluginInfo.java 84.15% <81.81%> (+1.63%) ⬆️
... and 1 more

... and 4 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.

4 participants