Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Backport 2.x] Create NamedRoute to map extension routes to a shortened name #7631

Merged
merged 1 commit into from
May 18, 2023

Conversation

opensearch-trigger-bot[bot]
Copy link
Contributor

Backport 8470df6 from #6870.

* WIP on rest layer authz

Signed-off-by: Craig Perkins <[email protected]>

* Create PermissibleRoute

Signed-off-by: Craig Perkins <[email protected]>

* Update extension handshake

Signed-off-by: Craig Perkins <[email protected]>

* Add connectToNodeAsExtension in TransportService

Signed-off-by: Craig Perkins <[email protected]>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

* Update RouteHandler

Signed-off-by: Craig Perkins <[email protected]>

* Update java docstrings

Signed-off-by: Craig Perkins <[email protected]>

* Run spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Fix merge conflicts

Signed-off-by: Craig Perkins <[email protected]>

* Rename to ProtectedRoute

Signed-off-by: Craig Perkins <[email protected]>

* Create method to get extension settings from extensions.yml

Signed-off-by: Craig Perkins <[email protected]>

* Add ExtensionsManager.lookupExtensionSettings

Signed-off-by: Craig Perkins <[email protected]>

* Small change to name

Signed-off-by: Craig Perkins <[email protected]>

* Add to CHANGELOG

Signed-off-by: Craig Perkins <[email protected]>

* Move extensionSettingsMap.put

Signed-off-by: Craig Perkins <[email protected]>

* Re-run CI

Signed-off-by: Craig Perkins <[email protected]>

* Address review feedback

Signed-off-by: Craig Perkins <[email protected]>

* Add test for ProtectedRoute

Signed-off-by: Craig Perkins <[email protected]>

* spotlessApply

Signed-off-by: Craig Perkins <[email protected]>

* Add RouteHandlerTests

Signed-off-by: Craig Perkins <[email protected]>

* Switch to NamedRoute and add validation for action naming

Signed-off-by: Craig Perkins <[email protected]>

* Avoid magic numbers

Signed-off-by: Craig Perkins <[email protected]>

* Remove @test annotation

Signed-off-by: Craig Perkins <[email protected]>

* Address code review feedback

Signed-off-by: Craig Perkins <[email protected]>

* Update error message

Signed-off-by: Craig Perkins <[email protected]>

* Check for REST Action name uniqueness across all registered actions

Signed-off-by: Craig Perkins <[email protected]>

* minimize code in the test

Signed-off-by: Craig Perkins <[email protected]>

* Update changelog

Signed-off-by: Craig Perkins <[email protected]>

* Add DynamicRouteRegistry

Signed-off-by: Craig Perkins <[email protected]>

* Address code review feedback

Signed-off-by: Craig Perkins <[email protected]>

* Add mock DynamicRouteRegistry.class

Signed-off-by: Craig Perkins <[email protected]>

* Add RouteRegistry to DynamicActionModule

Signed-off-by: Craig Perkins <[email protected]>

* Pass around dynamicActionRegistry instead of ActionModule

Signed-off-by: Craig Perkins <[email protected]>

* Only pass dynamic action registry

Signed-off-by: Craig Perkins <[email protected]>

* Add DynamicActionRegistryTests for tests of dynamic registry

Signed-off-by: Craig Perkins <[email protected]>

* Move CHANGELOG entry

Signed-off-by: Craig Perkins <[email protected]>

---------

Signed-off-by: Craig Perkins <[email protected]>
(cherry picked from commit 8470df6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented May 18, 2023

Codecov Report

Merging #7631 (2b23bae) into 2.x (74e97e1) will increase coverage by 0.04%.
The diff coverage is 82.27%.

@@             Coverage Diff              @@
##                2.x    #7631      +/-   ##
============================================
+ Coverage     70.29%   70.34%   +0.04%     
+ Complexity    59951    59941      -10     
============================================
  Files          4882     4884       +2     
  Lines        288357   288428      +71     
  Branches      41935    41949      +14     
============================================
+ Hits         202697   202884     +187     
+ Misses        68619    68513     -106     
+ Partials      17041    17031      -10     
Impacted Files Coverage Δ
...a/org/opensearch/extensions/ExtensionsManager.java 45.81% <33.33%> (-0.19%) ⬇️
...src/main/java/org/opensearch/rest/RestHandler.java 62.26% <45.45%> (-4.41%) ⬇️
.../main/java/org/opensearch/action/ActionModule.java 94.97% <82.14%> (-0.99%) ⬇️
...a/org/opensearch/extensions/rest/RouteHandler.java 90.00% <90.00%> (ø)
...rch/extensions/rest/RestActionsRequestHandler.java 100.00% <100.00%> (ø)
.../src/main/java/org/opensearch/rest/NamedRoute.java 100.00% <100.00%> (ø)
...rch/rest/extensions/RestSendToExtensionAction.java 47.45% <100.00%> (ø)

... and 508 files with indirect coverage changes

@reta reta merged commit 151af91 into 2.x May 18, 2023
@github-actions github-actions bot deleted the backport/backport-6870-to-2.x branch May 18, 2023 21:00
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