Skip to content

Declare workflow_state as child resource of workflow - #1455

Draft
DarshitChanpura wants to merge 1 commit into
opensearch-project:mainfrom
DarshitChanpura:fix/workflow-state-parent-sharing
Draft

Declare workflow_state as child resource of workflow#1455
DarshitChanpura wants to merge 1 commit into
opensearch-project:mainfrom
DarshitChanpura:fix/workflow-state-parent-sharing

Conversation

@DarshitChanpura

Copy link
Copy Markdown
Member

Description

workflow_state documents track the provisioning/execution state of a workflow template and have no independent access semantics, yet they are registered with the resource-sharing framework as a standalone type. Consequences:

  • access to state documents does not follow the parent workflow's shares
  • state documents written without an authenticated user in the thread context receive no sharing records at all (the security plugin's ResourceIndexListener cannot attribute them)

This declares parentType/parentIdField on the workflow_state provider so state documents inherit access from their workflow, via the workflow_id field already present in the state index mapping. Access evaluation in the security plugin delegates child→parent natively.

Related PRs

Category

Bug fix

Testing

  • compileJava + spotless pass; parent id field verified against mappings/workflow-state.json
  • Child→parent inheritance semantics covered by security#6373 integration tests

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Workflow state documents track the provisioning/execution state of a
workflow template and have no independent access semantics, yet they were
registered as a standalone resource type: access to them did not follow
the parent workflow's shares, and state documents written without an
authenticated user in the thread context (provisioning steps executed
under system context) receive no sharing records at all.

Declaring parentType/parentIdField on the workflow_state provider makes
state documents inherit access from their workflow via the already-mapped
workflow_id field.

Requires opensearch-project/security#6373 for state documents written
under system context to receive parent-linked sharing entries.

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@github-actions

github-actions Bot commented Aug 7, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

Here are some key observations to aid the review process:

🧪 No relevant tests
🔒 No security concerns identified
✅ No TODO sections
🔀 No multiple PR themes
⚡ No major issues detected

@codecov

codecov Bot commented Aug 7, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 78.50%. Comparing base (5ff55cd) to head (cab7562).

Files with missing lines Patch % Lines
...amework/FlowFrameworkResourceSharingExtension.java 0.00% 2 Missing ⚠️

❌ Your patch check has failed because the patch coverage (0.00%) is below the target coverage (70.00%). You can increase the patch coverage or adjust the target coverage.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #1455      +/-   ##
============================================
- Coverage     78.57%   78.50%   -0.08%     
  Complexity     1315     1315              
============================================
  Files           106      106              
  Lines          6045     6047       +2     
  Branches        647      647              
============================================
- Hits           4750     4747       -3     
- Misses         1004     1010       +6     
+ Partials        291      290       -1     

☔ View full report in Codecov by Harness.
📢 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.

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.

1 participant