Skip to content

Conversation

cwperks
Copy link
Member

@cwperks cwperks commented Jul 3, 2025

Description

Companion JS PR: opensearch-project/job-scheduler#670

This PR shows how SAP can be refactored to use the instance of the LockService that is initialized in Job Scheduler's createComponents.

This PR is part of an effort to remove usages of ThreadContext.stashContext across the plugins: opensearch-project/opensearch-plugins#238

Currently, security analytics instantiates its own instance of the LockService by passing in the Client given to analytics through createComponents.

As part of the effort to Strengthen System Indices in the Plugin Ecosystem, plugins will be restricted to only perform transport actions to their own system indices. This PR is to ensure that SAP uses the LockService instantiated by JS (which has permission to JS system indices) vs creating its own LockService.

Related Issues

Related to opensearch-project/security#4439

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

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

cwperks commented Jul 3, 2025

Test failures appear related to opensearch-project/common-utils#829. I'll take a deeper dive to see what's required to fix the tests.

cwperks added 4 commits July 2, 2025 23:11
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 Jul 15, 2025

Can a maintainer please help take a look at this PR?

I had to mute 2 tests that were failing due to opensearch-project/common-utils#829 in common-utils.

@cwperks cwperks merged commit e01340e into opensearch-project:main Jul 21, 2025
15 checks passed
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.

3 participants