Skip to content

Conversation

@DarshitChanpura
Copy link
Member

Description

Describe what this change achieves.

Issues Resolved

#827 (comment)

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: Darshit Chanpura <dchanp@amazon.com>
owaiskazi19
owaiskazi19 previously approved these changes Jul 10, 2023
joshpalis
joshpalis previously approved these changes Jul 10, 2023
Copy link
Member

@dbwiddis dbwiddis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While renaming will "fix" the sample, it doesn't solve the underlying problem:

  1. There is no documentation to users on what is a valid name (and the OpenSearch error message isn't helpful enough to debug the problem without referencing the source code)
  2. It disallows the existing names for every plugin, many of which we would migrate, e.g., opensearch-alerting, opensearch-anomaly-detection, opensearch-knn, opensearch-ml, etc.

The name here isn't actually used for anything programmatic. It's purely decorative and is only used as the response to the initialization command where it is displayed in a log message, and as the "node name". Node names in OpenSearch use hyphens.

Our test cases still use sample-extension as well, and don't fail on an illegal name there. If we're really set on disallowing a hyphen those need to validate the names.

I strongly prefer one of the following two options:

  1. Simply remove the routePrefix() method and replace it with a constant in each REST handler, or a local method in a REST handler that uses an allowed prefix
  2. If you keep the route prefix method, add a setRoutePrefix() method that validates it's a legal prefix.

@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Jul 10, 2023

While renaming will "fix" the sample, it doesn't solve the underlying problem:

  1. There is no documentation to users on what is a valid name (and the OpenSearch error message isn't helpful enough to debug the problem without referencing the source code)
  2. It disallows the existing names for every plugin, many of which we would migrate, e.g., opensearch-alerting, opensearch-anomaly-detection, opensearch-knn, opensearch-ml, etc.

The name here isn't actually used for anything programmatic. It's purely decorative and is only used as the response to the initialization command where it is displayed in a log message, and as the "node name". Node names in OpenSearch use hyphens.

Our test cases still use sample-extension as well, and don't fail on an illegal name there. If we're really set on disallowing a hyphen those need to validate the names.

I strongly prefer one of the following two options:

  1. Simply remove the routePrefix() method and replace it with a constant in each REST handler, or a local method in a REST handler that uses an allowed prefix
  2. If you keep the route prefix method, add a setRoutePrefix() method that validates it's a legal prefix.

I agree. However routePrefix only comes into play if an extension developer decides to use it while registering a route.

i.e. HelloWorld extension can also be registered without calling routePrefix method.

new NamedRoute.Builder().method(GET)
                .path("/hello")
                .handler(handleGetRequest)
                .uniqueName(routePrefix("greet"))   -----> can be written as `.uniqueName("greet")` OR `.uniqueName("helloWorld:greet")`
                .legacyActionNames(Set.of("cluster:admin/opensearch/hw/greet"))
                .build()

This would still work. routePrefix is completely optional. I would update the javaDoc for routePrefix to state that valid extension name patterns are "this" and then add a check to validate this. Would that work? If not I can remove all references to routePrefix.

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura dismissed stale reviews from joshpalis and owaiskazi19 via 8ee2f54 July 10, 2023 21:25
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura
Copy link
Member Author

Added a validation check when extensionName is set to be later used by routePrefix

joshpalis
joshpalis previously approved these changes Jul 10, 2023
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…ePrefix`

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura changed the title Renames demo extension to helloWorld Makes route prefix setting routeNamePrefix optional Jul 10, 2023
@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Jul 10, 2023

@dbwiddis I've update the routePrefix setting to be completely optional in extension-settings.yml

cc: @joshpalis @owaiskazi19

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
…te name prefix

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
@DarshitChanpura DarshitChanpura force-pushed the rename-demo-extension branch from 0edce76 to 29c3999 Compare July 11, 2023 15:36
@owaiskazi19
Copy link
Member

@DarshitChanpura I'm still confused, isn't this PR purpose is to add hyphen to the extension name?
Since we want to support other plugins like: opensearch-alerting, opensearch-anomaly-detection, opensearch-knn, opensearch-ml.

@cwperks
Copy link
Member

cwperks commented Jul 11, 2023

If this is about adding support for hyphen then why not update the pattern here?

@DarshitChanpura
Copy link
Member Author

@DarshitChanpura I'm still confused, isn't this PR purpose is to add hyphen to the extension name? Since we want to support other plugins like: opensearch-alerting, opensearch-anomaly-detection, opensearch-knn, opensearch-ml.

We are not meddling with extension name any more. This PR talks about a new optional setting routeNamePrefix which has to be alphanumeric and can contain _ only. This lifts the restriction from the extension name setting.

@DarshitChanpura
Copy link
Member Author

DarshitChanpura commented Jul 11, 2023

If this is about adding support for hyphen then why not update the pattern here?

This can be addressed in future PRs. As of now there are no restrictions on the way extension is named. The restrictions only apply to routeNamePrefix setting here and when the route name is set while creating NamedRoute object

@joshpalis joshpalis merged commit 9e31418 into opensearch-project:main Jul 11, 2023
@opensearch-trigger-bot
Copy link

The backport to 1.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/opensearch-sdk-java/backport-1.x 1.x
# Navigate to the new working tree
pushd ../.worktrees/opensearch-sdk-java/backport-1.x
# Create a new branch
git switch --create backport/backport-868-to-1.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 9e31418e5642cd4772db8641d8baed2392480a16
# Push it to GitHub
git push --set-upstream origin backport/backport-868-to-1.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/opensearch-sdk-java/backport-1.x

Then, create a pull request where the base branch is 1.x and the compare/head branch is backport/backport-868-to-1.x.

@DarshitChanpura
Copy link
Member Author

Cherry-picking this manually into #866

DarshitChanpura added a commit to DarshitChanpura/opensearch-sdk-java that referenced this pull request Jul 11, 2023
…ject#868)

* Renames demo extension to `helloWorld`

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

* Updates uniqueId to not reflect the change

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

* Adds a validation check for setting extension name

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

* Fixes checkstyle errors

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

* Adds routePrefix as an optional setting in .yml

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

* Updates dev guide to add documentation for the optional setting `routePrefix`

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

* Renames `routePrefix` to `routeNamePrefix`

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

* Renames erroneous instance of `hello-world`

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

* Addresses PR feedback

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 0103ada30250693c7b986a9667fd0060b414a66e)

* Changes allowed route name prefixes

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

* Fixes error message and removes hyphen from allowed characters in route name prefix

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

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 9e31418)
dbwiddis pushed a commit that referenced this pull request Jul 11, 2023
… Makes route prefix setting routeNamePrefix optional #868 (#866)

* Register new routes via SDK as named routes (#827)

* WIP on Handler naming and SSL

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add concept of extension shortname via settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on extension ssl

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Get registry from runner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Read settings from extension config file

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update license headers

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update cert generation documents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Re-add authz changes for sample Hello world extension

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add ssl.transport.enabled in ExtensionsRunner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Name all HelloWorld extension routes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge main into branch

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add instructions for running in SSL only mode

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add all SSL settings to extension settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update TestExtensionsRunner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Set default enforce_hostname_verification

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Respond to code review feedback

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* fix merge conflicts

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix typos in debug messages

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add docstrings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Address code review feedback

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove duplicate

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove duplicate

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create ExtensionRouteHandlerFactory

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extension: from action naming

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test compilation errors

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Consolidate registerHandler

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix missed registerHandler usage

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to check if class is initialized

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix failing tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update helloworld-settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add shortExtensionName to BaseExtensionRouteHandler

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Adds support for legacy action names while registering extension routes on extension start up

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

* Modifies sample hello extension to conform to the new registration scheme

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

* Renames route handlers

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

* Adds certificate generation script

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

* Fixes spotless errors

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

* Fixes Javadoc

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

* Cleans up route handlers to be more readable and adds an interface

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

* Updates test to reflect changes in route handler signatures

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

* Fixes slf4j gradle build issue

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

* Fixes replaced named route tests

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

* Changes the way named routes are serialized to conform to core and fixes tests

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

* Removes mention of shortNames and uses extensionName as permission prefix

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

* Used builder for named routes

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

* Fixes broken changes

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

* Updates dev guide to state to use credentials when registering extension while security is enabled

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

* Replaces NamedRouteHandler and update logic to map route handlers for Rest request

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

* Fixes typos

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

* Removes references to ReplaceNamedRouteHandlers and DeprecatedNamedRouteHandlers

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

* Addresses PR feedback

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

* Refactors ReplacedRoute and deprecated route handlers to use RestResponse

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

* Forces httpcore5 to 5.2.2

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

* Updates documentation

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

* Addresses PR feedback

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

* Fixes broken reference due to changes in core 52a5e3f6e0ca599e3193807134ea42660ecdd195

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

* Removes extra resolutionStrategy

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

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Co-authored-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 09c22b0)

* Makes route prefix setting `routeNamePrefix` optional (#868)

* Renames demo extension to `helloWorld`

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

* Updates uniqueId to not reflect the change

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

* Adds a validation check for setting extension name

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

* Fixes checkstyle errors

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

* Adds routePrefix as an optional setting in .yml

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

* Updates dev guide to add documentation for the optional setting `routePrefix`

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

* Renames `routePrefix` to `routeNamePrefix`

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

* Renames erroneous instance of `hello-world`

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

* Addresses PR feedback

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 0103ada30250693c7b986a9667fd0060b414a66e)

* Changes allowed route name prefixes

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

* Fixes error message and removes hyphen from allowed characters in route name prefix

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

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 9e31418)
owaiskazi19 added a commit that referenced this pull request Jul 11, 2023
DarshitChanpura added a commit to DarshitChanpura/opensearch-sdk-java that referenced this pull request Jul 11, 2023
DarshitChanpura added a commit to DarshitChanpura/opensearch-sdk-java that referenced this pull request Jul 12, 2023
…pensearch-project#827) and Makes route prefix setting routeNamePrefix optional opensearch-project#868 (opensearch-project#866)"

This reverts commit 32d6567.

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
owaiskazi19 pushed a commit that referenced this pull request Jul 12, 2023
) and Makes route prefix setting routeNamePrefix optional #868" (#877)

* Revert "[Backport 1.x] Register new routes via SDK as named routes (#827) and Makes route prefix setting routeNamePrefix optional #868 (#866)"

This reverts commit 32d6567.

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

* Updates extension() method call in build.gradle

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

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
caokyhieu pushed a commit to caokyhieu/opensearch-sdk-java that referenced this pull request Aug 15, 2025
…h-project#827) and Makes route prefix setting routeNamePrefix optional opensearch-project#868 (opensearch-project#866)

* Register new routes via SDK as named routes (opensearch-project#827)

* WIP on Handler naming and SSL

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add concept of extension shortname via settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* WIP on extension ssl

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Get registry from runner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Read settings from extension config file

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update license headers

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove authz changes and only keep TLS

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update cert generation documents

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Re-add authz changes for sample Hello world extension

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add ssl.transport.enabled in ExtensionsRunner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Name all HelloWorld extension routes

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Merge main into branch

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add instructions for running in SSL only mode

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add all SSL settings to extension settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update TestExtensionsRunner

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Set default enforce_hostname_verification

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Respond to code review feedback

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* fix merge conflicts

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix typos in debug messages

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add docstrings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Address code review feedback

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove duplicate

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove duplicate

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Create ExtensionRouteHandlerFactory

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Remove extension: from action naming

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix test compilation errors

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Consolidate registerHandler

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix missed registerHandler usage

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix javadoc

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add method to check if class is initialized

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Fix failing tests

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Update helloworld-settings

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Run spotlessApply

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Add shortExtensionName to BaseExtensionRouteHandler

Signed-off-by: Craig Perkins <cwperx@amazon.com>

* Adds support for legacy action names while registering extension routes on extension start up

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

* Modifies sample hello extension to conform to the new registration scheme

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

* Renames route handlers

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

* Adds certificate generation script

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

* Fixes spotless errors

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

* Fixes Javadoc

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

* Cleans up route handlers to be more readable and adds an interface

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

* Updates test to reflect changes in route handler signatures

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

* Fixes slf4j gradle build issue

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

* Fixes replaced named route tests

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

* Changes the way named routes are serialized to conform to core and fixes tests

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

* Removes mention of shortNames and uses extensionName as permission prefix

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

* Used builder for named routes

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

* Fixes broken changes

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

* Updates dev guide to state to use credentials when registering extension while security is enabled

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

* Replaces NamedRouteHandler and update logic to map route handlers for Rest request

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

* Fixes typos

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

* Removes references to ReplaceNamedRouteHandlers and DeprecatedNamedRouteHandlers

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

* Addresses PR feedback

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

* Refactors ReplacedRoute and deprecated route handlers to use RestResponse

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

* Forces httpcore5 to 5.2.2

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

* Updates documentation

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

* Addresses PR feedback

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

* Fixes broken reference due to changes in core 52a5e3f6e0ca599e3193807134ea42660ecdd195

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

* Removes extra resolutionStrategy

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

---------

Signed-off-by: Craig Perkins <cwperx@amazon.com>
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Co-authored-by: Craig Perkins <cwperx@amazon.com>
(cherry picked from commit 09c22b0)

* Makes route prefix setting `routeNamePrefix` optional (opensearch-project#868)

* Renames demo extension to `helloWorld`

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

* Updates uniqueId to not reflect the change

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

* Adds a validation check for setting extension name

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

* Fixes checkstyle errors

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

* Adds routePrefix as an optional setting in .yml

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

* Updates dev guide to add documentation for the optional setting `routePrefix`

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

* Renames `routePrefix` to `routeNamePrefix`

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

* Renames erroneous instance of `hello-world`

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

* Addresses PR feedback

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 0103ada30250693c7b986a9667fd0060b414a66e)

* Changes allowed route name prefixes

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

* Fixes error message and removes hyphen from allowed characters in route name prefix

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

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
(cherry picked from commit 9e31418)
caokyhieu pushed a commit to caokyhieu/opensearch-sdk-java that referenced this pull request Aug 15, 2025
…pensearch-project#827) and Makes route prefix setting routeNamePrefix optional opensearch-project#868" (opensearch-project#877)

* Revert "[Backport 1.x] Register new routes via SDK as named routes (opensearch-project#827) and Makes route prefix setting routeNamePrefix optional opensearch-project#868 (opensearch-project#866)"

This reverts commit 32d6567.

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

* Updates extension() method call in build.gradle

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

---------

Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants