Skip to content

Conversation

@cwperks
Copy link
Member

@cwperks cwperks commented May 12, 2025

Description

Currently, ActionRequest has 233 inheritors in the OpenSearch core alone. This number gets much larger taking into account the ecosystem of plugins.

There is not a lot of hierarchy to ActionRequests, with one notable exception DocWriteRequest which is an umbrella for IndexRequest, UpdateRequest and DeleteRequest all of which are types of requests that can be individual items in a _bulk request.

I am raising this PR to create a generic DocRequest which is a superset of DocWriteRequest and updates GetRequest to be a subclass.

While this PR is not very interesting within the confines of the OpenSearch core repo, I would like to start using this to categorize requests within OpenSearch plugins...particularly if the request is around an individual document stored in a system index.

The security plugin is working on a new sharing model where resource owners can determine with whom and how their own resources are shared...think google docs model where I give read access to UserA, but read+comment access to UserB - something that is not currently possible in OpenSearch.

In order for the security plugin to provide this new fine-grained access control model for plugin resources, there needs to be some way of distinguishing types of requests pertinent to resources. A resource is assumed to be a single document in a system index. By categorizing requests into this new category of DocRequest, the security plugin will be able to use this when computing authz for the resource being acted upon.

Related Issues

Related to opensearch-project/security#4500

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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 cwperks requested a review from a team as a code owner May 12, 2025 18:16
Signed-off-by: Craig Perkins <[email protected]>
@github-actions
Copy link
Contributor

✅ Gradle check result for 2aa50f4: SUCCESS

@codecov
Copy link

codecov bot commented May 12, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.55%. Comparing base (998ae73) to head (84a40fd).
Report is 11 commits behind head on main.

Additional details and impacted files
@@             Coverage Diff              @@
##               main   #18269      +/-   ##
============================================
+ Coverage     72.48%   72.55%   +0.06%     
- Complexity    67357    67393      +36     
============================================
  Files          5488     5488              
  Lines        311023   311024       +1     
  Branches      45217    45217              
============================================
+ Hits         225444   225662     +218     
+ Misses        67282    66965     -317     
- Partials      18297    18397     +100     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@github-actions
Copy link
Contributor

✅ Gradle check result for 9f6446d: SUCCESS

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

❌ Gradle check result for 84a40fd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@github-actions
Copy link
Contributor

✅ Gradle check result for 84a40fd: SUCCESS

@andrross andrross merged commit 557ea3a into opensearch-project:main May 15, 2025
30 checks passed
tanik98 pushed a commit to tanik98/OpenSearch that referenced this pull request May 27, 2025
tandonks pushed a commit to tandonks/OpenSearch that referenced this pull request Jun 1, 2025
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
neuenfeldttj pushed a commit to neuenfeldttj/OpenSearch that referenced this pull request Jun 26, 2025
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