Skip to content

Deprecate opendistro API paths#5102

Merged
cwperks merged 8 commits into
opensearch-project:mainfrom
shikharj05:depr-opendistro-api
Feb 18, 2025
Merged

Deprecate opendistro API paths#5102
cwperks merged 8 commits into
opensearch-project:mainfrom
shikharj05:depr-opendistro-api

Conversation

@shikharj05
Copy link
Copy Markdown
Collaborator

@shikharj05 shikharj05 commented Feb 10, 2025

Description

[Describe what this change achieves]

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

  • Why these changes are required?
    The security repo has lingering usages of the legacy terms like _opendistro is API paths, these are replaced with _plugins prefix, however legacy paths are not explicitly marked as deprecated.

  • What is the old behavior before changes and new behavior after changes?

If an API uses _opendistro as path, log a deprecation message.

e.g.

 curl -k -u <user>:<password> 'https://localhost:9200/_opendistro/_security/api/rolesmapping?pretty'

logs-

[2025-02-17T18:25:35,149][DEPRECATION][o.o.d.r.RestController   ] [smoketestnode] [_opendistro/_security] is a deprecated endpoint path. Please use _plugins/_security instead.

Issues Resolved

#5097

Is this a backport? If so, please add backport PR # and/or commits #, and remove backport-failed label from the original PR.

Do these changes introduce new permission(s) to be displayed in the static dropdown on the front-end? If so, please open a draft PR in the security dashboards plugin and link the draft PR here

Testing

TODO

Check List

  • [TODO] New functionality includes testing
  • [TODO] New functionality has been documented
  • [NA] New Roles/Permissions have a corresponding security dashboards plugin PR
  • [NA] 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.

Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
Signed-off-by: shikharj05 <8859327+shikharj05@users.noreply.github.com>
@codecov
Copy link
Copy Markdown

codecov Bot commented Feb 10, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 71.65%. Comparing base (59a53ca) to head (69a2fb8).
Report is 1 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #5102      +/-   ##
==========================================
+ Coverage   71.60%   71.65%   +0.05%     
==========================================
  Files         335      335              
  Lines       22665    22731      +66     
  Branches     3598     3598              
==========================================
+ Hits        16229    16288      +59     
- Misses       4634     4641       +7     
  Partials     1802     1802              
Files with missing lines Coverage Δ
.../opensearch/security/OpenSearchSecurityPlugin.java 83.79% <ø> (ø)
...earch/security/dlic/rest/api/AccountApiAction.java 98.64% <100.00%> (+0.05%) ⬆️
.../security/dlic/rest/api/ActionGroupsApiAction.java 98.27% <100.00%> (+0.09%) ⬆️
...nsearch/security/dlic/rest/api/AuditApiAction.java 94.11% <100.00%> (+3.34%) ⬆️
...curity/dlic/rest/api/AuthTokenProcessorAction.java 92.85% <100.00%> (+1.94%) ⬆️
...security/dlic/rest/api/ConfigUpgradeApiAction.java 87.41% <100.00%> (+0.25%) ⬆️
...ch/security/dlic/rest/api/FlushCacheApiAction.java 67.85% <100.00%> (+3.85%) ⬆️
...security/dlic/rest/api/InternalUsersApiAction.java 93.54% <100.00%> (+0.15%) ⬆️
...ity/dlic/rest/api/MultiTenancyConfigApiAction.java 90.90% <100.00%> (+0.36%) ⬆️
...earch/security/dlic/rest/api/NodesDnApiAction.java 90.90% <100.00%> (+1.16%) ⬆️
... and 13 more

... and 8 files with indirect coverage changes

@cwperks
Copy link
Copy Markdown
Member

cwperks commented Feb 11, 2025

@shikharj05 The changes look good to me in this PR. What is remaining before taking it out of draft?

@shikharj05
Copy link
Copy Markdown
Collaborator Author

@shikharj05 The changes look good to me in this PR. What is remaining before taking it out of draft?

I was blocked on #5053 for testing, will re-base, test couple of APIs and remove this out of draft.

@shikharj05 shikharj05 marked this pull request as ready for review February 17, 2025 13:05
@shikharj05
Copy link
Copy Markdown
Collaborator Author

shikharj05 commented Feb 17, 2025

@shikharj05 The changes look good to me in this PR. What is remaining before taking it out of draft?

Moved to review state

@cwperks cwperks merged commit c31b7fd into opensearch-project:main Feb 18, 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.

3 participants