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

Map extension routes to permission-able action names #622

Closed
wants to merge 69 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
daf3b2c
WIP on Handler naming and SSL
cwperks Mar 27, 2023
9c49d95
Add concept of extension shortname via settings
cwperks Mar 28, 2023
97d2a22
WIP on extension ssl
cwperks Mar 28, 2023
b5703ae
Merge branch 'main' into ssl-and-handler-naming
cwperks Mar 28, 2023
36b67cc
Get registry from runner
cwperks Mar 28, 2023
9238527
Read settings from extension config file
cwperks Mar 29, 2023
a9325d2
Update license headers
cwperks Mar 29, 2023
0a1425b
Run spotlessApply
cwperks Mar 29, 2023
0b634be
Remove authz changes and only keep TLS
cwperks Mar 29, 2023
38baa81
Remove authz changes and only keep TLS
cwperks Mar 29, 2023
d504ed8
Remove authz changes and only keep TLS
cwperks Mar 29, 2023
6826fef
Remove authz changes and only keep TLS
cwperks Mar 29, 2023
0825b74
Remove authz changes and only keep TLS
cwperks Mar 29, 2023
5afe8c8
Update cert generation documents
cwperks Mar 29, 2023
ef085ce
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Mar 29, 2023
4966514
Re-add authz changes for sample Hello world extension
cwperks Mar 29, 2023
b287fe5
Add ssl.transport.enabled in ExtensionsRunner
cwperks Mar 29, 2023
ff158f6
Name all HelloWorld extension routes
cwperks Mar 29, 2023
a80cae7
Run spotlessApply
cwperks Mar 29, 2023
636bcdc
Merge branch 'main' into setup-extension-tls
cwperks Mar 31, 2023
b08d018
Merge main into branch
cwperks Mar 31, 2023
1c23d9c
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Mar 31, 2023
e45ea0e
Add instructions for running in SSL only mode
cwperks Apr 2, 2023
10127c4
Merge branch 'main' into setup-extension-tls
cwperks Apr 3, 2023
1eeafe6
Add all SSL settings to extension settings
cwperks Apr 3, 2023
f4ab756
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 3, 2023
66654ba
Update TestExtensionsRunner
cwperks Apr 3, 2023
df30efd
Set default enforce_hostname_verification
cwperks Apr 3, 2023
03025e4
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 3, 2023
09a84a3
Merge branch 'main' into setup-extension-tls
cwperks Apr 10, 2023
9830335
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 10, 2023
f7697b1
Merge branch 'main' into setup-extension-tls
cwperks Apr 22, 2023
6d7ec26
Run spotlessApply
cwperks Apr 22, 2023
8576654
Respond to code review feedback
cwperks Apr 22, 2023
8a93770
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 22, 2023
bdea4ea
fix merge conflicts
cwperks Apr 22, 2023
ee09450
Fix typos in debug messages
cwperks Apr 26, 2023
a989151
Add docstrings
cwperks Apr 27, 2023
af084b4
Merge branch 'main' into setup-extension-tls
cwperks Apr 27, 2023
0b37c06
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 27, 2023
c04bda1
Merge branch 'main' into setup-extension-tls
cwperks Apr 28, 2023
fb4f0bc
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks Apr 28, 2023
15c82db
Merge branch 'main' into setup-extension-tls
cwperks May 1, 2023
54d057c
Address code review feedback
cwperks May 1, 2023
5fb6497
Merge branch 'setup-extension-tls' into ssl-and-handler-naming
cwperks May 1, 2023
81c25ce
Merge branch 'main' into ssl-and-handler-naming
cwperks May 2, 2023
0c5ce25
Remove duplicate
cwperks May 2, 2023
b880d93
Remove duplicate
cwperks May 2, 2023
ecf51e4
Merge branch 'main' into ssl-and-handler-naming
cwperks May 4, 2023
59f316c
Create ExtensionRouteHandlerFactory
cwperks May 5, 2023
93b6daf
Merge branch 'main' into ssl-and-handler-naming
cwperks May 5, 2023
326422c
Merge branch 'main' into ssl-and-handler-naming
cwperks May 8, 2023
a926392
Remove extension: from action naming
cwperks May 8, 2023
f42db71
Merge branch 'main' into ssl-and-handler-naming
cwperks May 8, 2023
06f8e98
Merge branch 'main' into ssl-and-handler-naming
cwperks May 19, 2023
024aace
Add javadoc
cwperks May 19, 2023
9658efe
Fix test compilation errors
cwperks May 19, 2023
7aeef67
Consolidate registerHandler
cwperks May 19, 2023
786f01b
Fix missed registerHandler usage
cwperks May 19, 2023
70d9088
Fix javadoc
cwperks May 19, 2023
80ba90c
Add method to check if class is initialized
cwperks May 19, 2023
1e06d01
Fix failing tests
cwperks May 19, 2023
e0df300
Update helloworld-settings
cwperks May 19, 2023
058f12a
Merge branch 'main' into ssl-and-handler-naming
cwperks Jun 7, 2023
433a42a
Run spotlessApply
cwperks Jun 7, 2023
20885c0
Merge branch 'main' into ssl-and-handler-naming
cwperks Jun 13, 2023
ba60cb7
Run spotlessApply
cwperks Jun 13, 2023
f460699
Add shortExtensionName to BaseExtensionRouteHandler
cwperks Jun 13, 2023
6d2ee04
Merge branch 'main' into ssl-and-handler-naming
cwperks Jun 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 22 additions & 4 deletions src/main/java/org/opensearch/sdk/ExtensionSettings.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,12 @@
public class ExtensionSettings {

private String extensionName;
private String shortExtensionName;
Copy link
Member

Choose a reason for hiding this comment

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

Given that this is used for singleton security setup later, should it be final?

private String hostAddress;
private String hostPort;
private String opensearchAddress;
private String opensearchPort;
private Map<String, String> securitySettings;
Copy link
Member

Choose a reason for hiding this comment

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

Should this also be final?


/**
* A set of keys for security settings related to SSL transport, keystore and truststore files, and hostname verification.
Expand Down Expand Up @@ -83,8 +85,6 @@ public class ExtensionSettings {
SSL_TRANSPORT_TRUSTSTORE_TYPE
);

private Map<String, String> securitySettings;

/**
* Jackson requires a no-arg constructor.
*/
Expand All @@ -97,14 +97,23 @@ private ExtensionSettings() {
* Instantiate this class using the specified parameters.
*
* @param extensionName The extension name. Provided to OpenSearch as a response to initialization query. Must match the defined extension name in OpenSearch.
* @param shortExtensionName The shortened name for the extension
Copy link
Member

Choose a reason for hiding this comment

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

Probably need more documentation here on what purpose a shortened name has.

How is this distinct from the unique ID? What happens if two different extensions both choose the same shortened name? Would Anomaly Detection (ad) permissions apply to the Action Dispatcher (ad) extension or Auto Deletion (ad) extension (I really want one that does auto rolling index deletion on a capacity trigger) or Awesome Dan (ad) extension that bolds my name everywhere?

* @param hostAddress The IP Address to bind this extension to.
* @param hostPort The port to bind this extension to.
* @param opensearchAddress The IP Address on which OpenSearch is running.
* @param opensearchPort The port on which OpenSearch is running.
*/
public ExtensionSettings(String extensionName, String hostAddress, String hostPort, String opensearchAddress, String opensearchPort) {
public ExtensionSettings(
String extensionName,
String shortExtensionName,
String hostAddress,
String hostPort,
String opensearchAddress,
String opensearchPort
) {
super();
this.extensionName = extensionName;
this.shortExtensionName = shortExtensionName;
this.hostAddress = hostAddress;
this.hostPort = hostPort;
this.opensearchAddress = opensearchAddress;
Expand All @@ -116,6 +125,7 @@ public ExtensionSettings(String extensionName, String hostAddress, String hostPo
* Instantiate this class using the specified parameters.
*
* @param extensionName The extension name. Provided to OpenSearch as a response to initialization query. Must match the defined extension name in OpenSearch.
* @param shortExtensionName The shortened name for the extension
* @param hostAddress The IP Address to bind this extension to.
* @param hostPort The port to bind this extension to.
* @param opensearchAddress The IP Address on which OpenSearch is running.
Expand All @@ -124,13 +134,14 @@ public ExtensionSettings(String extensionName, String hostAddress, String hostPo
*/
public ExtensionSettings(
String extensionName,
String shortExtensionName,
String hostAddress,
String hostPort,
String opensearchAddress,
String opensearchPort,
Map<String, String> securitySettings
) {
this(extensionName, hostAddress, hostPort, opensearchAddress, opensearchPort);
this(extensionName, shortExtensionName, hostAddress, hostPort, opensearchAddress, opensearchPort);
this.securitySettings = securitySettings;
Copy link
Member

Choose a reason for hiding this comment

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

This constructor overloading seems off somehow. Setting something and also calling another constructor seems unusual. Is there a way we can make this the primary constructor (that sets All The Things) and have all the other constructors delegate to it with defaults for the missing parameters?

}

Expand All @@ -142,6 +153,10 @@ public String getExtensionName() {
return extensionName;
}

public String getShortExtensionName() {
return shortExtensionName;
}
Copy link
Member

Choose a reason for hiding this comment

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

This getter should have a test in TestExtensionSettings.java

Copy link
Member Author

Choose a reason for hiding this comment

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

This has been added to a few different tests to verify its behavior


/**
* Returns the host address associated with this object.
* @return The host address as a string.
Expand Down Expand Up @@ -203,6 +218,8 @@ public Map<String, String> getSecuritySettings() {
public String toString() {
return "ExtensionSettings{extensionName="
+ extensionName
+ ", shortName="
+ shortExtensionName
+ ", hostAddress="
+ hostAddress
+ ", hostPort="
Expand Down Expand Up @@ -242,6 +259,7 @@ public static ExtensionSettings readSettingsFromYaml(String extensionSettingsPat
}
return new ExtensionSettings(
extensionMap.get("extensionName").toString(),
extensionMap.get("shortExtensionName").toString(),
extensionMap.get("hostAddress").toString(),
extensionMap.get("hostPort").toString(),
extensionMap.get("opensearchAddress").toString(),
Expand Down
15 changes: 14 additions & 1 deletion src/main/java/org/opensearch/sdk/ExtensionsRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
import org.opensearch.cluster.metadata.IndexNameExpressionResolver;
import org.opensearch.common.io.stream.NamedWriteableRegistry;
import org.opensearch.extensions.rest.ExtensionRestRequest;
import org.opensearch.extensions.rest.RouteHandler;
import org.opensearch.common.settings.Setting;
import org.opensearch.common.settings.Settings;
import org.opensearch.core.xcontent.NamedXContentRegistry;
Expand All @@ -28,6 +29,7 @@
import org.opensearch.extensions.ExtensionsManager;
import org.opensearch.extensions.UpdateSettingsRequest;
import org.opensearch.extensions.action.ExtensionActionRequest;
import org.opensearch.rest.RestHandler;
import org.opensearch.sdk.action.SDKActionModule;
import org.opensearch.sdk.api.ActionExtension;
import org.opensearch.sdk.handlers.ExtensionActionRequestHandler;
Expand All @@ -36,6 +38,7 @@
import org.opensearch.sdk.handlers.ExtensionsInitRequestHandler;
import org.opensearch.sdk.handlers.ExtensionsRestRequestHandler;
import org.opensearch.sdk.handlers.UpdateSettingsRequestHandler;
import org.opensearch.sdk.rest.BaseExtensionRestHandler;
import org.opensearch.sdk.rest.ExtensionRestHandler;
import org.opensearch.sdk.rest.ExtensionRestPathRegistry;
import org.opensearch.tasks.TaskManager;
Expand All @@ -52,6 +55,7 @@
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Optional;
import java.util.Set;
import java.util.concurrent.atomic.AtomicReference;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -232,7 +236,16 @@ protected ExtensionsRunner(Extension extension) throws IOException {
if (extension instanceof ActionExtension) {
// store REST handlers in the registry
for (ExtensionRestHandler extensionRestHandler : ((ActionExtension) extension).getExtensionRestHandlers()) {
extensionRestPathRegistry.registerHandler(extensionRestHandler);
if (extensionRestHandler instanceof BaseExtensionRestHandler) {
((BaseExtensionRestHandler) extensionRestHandler).setExtensionShortName(extensionSettings.getShortExtensionName());
}
for (RestHandler.Route route : extensionRestHandler.routes()) {
Optional<String> routeActionName = Optional.empty();
if (route instanceof RouteHandler && ((RouteHandler) route).name() != null) {
routeActionName = Optional.of(((RouteHandler) route).name());
}
extensionRestPathRegistry.registerHandler(route.getMethod(), route.getPath(), routeActionName, extensionRestHandler);
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;

import org.opensearch.extensions.rest.RouteHandler;
import org.opensearch.rest.BaseRestHandler;
import static org.opensearch.rest.RestStatus.INTERNAL_SERVER_ERROR;
import static org.opensearch.rest.RestStatus.NOT_FOUND;
Expand All @@ -38,6 +40,9 @@
* Provides convenience methods to reduce boilerplate code in an {@link ExtensionRestHandler} implementation.
*/
public abstract class BaseExtensionRestHandler implements ExtensionRestHandler {

private String extensionShortName;

/**
* Constant for JSON content type
*/
Expand Down Expand Up @@ -80,6 +85,19 @@ protected List<ReplacedRouteHandler> replacedRouteHandlers() {
return Collections.emptyList();
}

public void setExtensionShortName(String extensionShortName) {
this.extensionShortName = extensionShortName;
}

/**
* Generates a name for the handler prepended with the extension's shortName
* @param name The human-readable name for a route registered by this extension
* @return Returns a name prepended with the extension's shortName
*/
protected String routePrefix(String name) {
return extensionShortName + ":" + name;
}

@Override
public List<ReplacedRoute> replacedRoutes() {
return List.copyOf(replacedRouteHandlers());
Expand Down Expand Up @@ -223,36 +241,6 @@ protected ExtensionRestResponse createEmptyJsonResponse(RestRequest request, Res
return new ExtensionRestResponse(request, status, JSON_CONTENT_TYPE, "{}");
}

/**
* A subclass of {@link Route} that includes a handler method for that route.
*/
public static class RouteHandler extends Route {

private final Function<RestRequest, ExtensionRestResponse> responseHandler;

/**
* Handle the method and path with the specified handler.
*
* @param method The {@link Method} to handle.
* @param path The path to handle.
* @param handler The method which handles the method and path.
*/
public RouteHandler(Method method, String path, Function<RestRequest, ExtensionRestResponse> handler) {
super(method, path);
this.responseHandler = handler;
}

/**
* Executes the handler for this route.
*
* @param request The request to handle
* @return the {@link ExtensionRestResponse} result from the handler for this route.
*/
public ExtensionRestResponse handleRequest(RestRequest request) {
return responseHandler.apply(request);
}
}

/**
* A subclass of {@link DeprecatedRoute} that includes a handler method for that route.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,12 @@

import java.util.ArrayList;
import java.util.List;
import java.util.Optional;

import org.opensearch.common.Nullable;
import org.opensearch.common.logging.DeprecationLogger;
import org.opensearch.common.path.PathTrie;
import org.opensearch.extensions.rest.RouteHandler;
import org.opensearch.rest.RestRequest.Method;
import org.opensearch.rest.RestUtils;
import org.opensearch.sdk.rest.BaseExtensionRestHandler.ExtensionDeprecationRestHandler;
Expand All @@ -38,7 +40,13 @@ public class ExtensionRestPathRegistry {
* @param restHandler The RestHandler to register routes.
*/
public void registerHandler(ExtensionRestHandler restHandler) {
restHandler.routes().forEach(route -> registerHandler(route.getMethod(), route.getPath(), restHandler));
restHandler.routes().forEach(route -> {
Optional<String> routeActionName = Optional.empty();
if (route instanceof RouteHandler && ((RouteHandler) route).name() != null) {
routeActionName = Optional.of(((RouteHandler) route).name());
}
registerHandler(route.getMethod(), route.getPath(), routeActionName, restHandler);
});
restHandler.deprecatedRoutes()
.forEach(route -> registerAsDeprecatedHandler(route.getMethod(), route.getPath(), restHandler, route.getDeprecationMessage()));
restHandler.replacedRoutes()
Expand All @@ -57,20 +65,21 @@ public void registerHandler(ExtensionRestHandler restHandler) {
* Registers a REST handler to be executed when one of the provided methods and path match the request.
*
* @param path Path to handle (e.g., "/{index}/{type}/_bulk")
* @param handler The handler to actually execute
* @param extensionRestHandler The handler to actually execute
* @param name The name corresponding to this handler
* @param method GET, POST, etc.
*/
private void registerHandler(Method method, String path, ExtensionRestHandler extensionRestHandler) {
public void registerHandler(Method method, String path, Optional<String> name, ExtensionRestHandler extensionRestHandler) {
pathTrie.insertOrUpdate(
path,
new SDKMethodHandlers(path, extensionRestHandler, method),
(mHandlers, newMHandler) -> mHandlers.addMethods(extensionRestHandler, method)
);
if (extensionRestHandler instanceof ExtensionDeprecationRestHandler) {
registeredDeprecatedPaths.add(restPathToString(method, path));
registeredDeprecatedPaths.add(restPathToString(method, path, name));
registeredDeprecatedPaths.add(((ExtensionDeprecationRestHandler) extensionRestHandler).getDeprecationMessage());
} else {
registeredPaths.add(restPathToString(method, path));
registeredPaths.add(restPathToString(method, path, name));
}
}

Expand All @@ -85,7 +94,12 @@ private void registerHandler(Method method, String path, ExtensionRestHandler ex
private void registerAsDeprecatedHandler(Method method, String path, ExtensionRestHandler handler, String deprecationMessage) {
assert (handler instanceof ExtensionDeprecationRestHandler) == false;

registerHandler(method, path, new ExtensionDeprecationRestHandler(handler, deprecationMessage, deprecationLogger));
registerHandler(
method,
path,
Optional.empty(),
new ExtensionDeprecationRestHandler(handler, deprecationMessage, deprecationLogger)
);
}

/**
Expand Down Expand Up @@ -129,7 +143,7 @@ private void registerWithDeprecatedHandler(
+ path
+ "] instead.";

registerHandler(method, path, handler);
registerHandler(method, path, Optional.empty(), handler);
registerAsDeprecatedHandler(deprecatedMethod, deprecatedPath, handler, deprecationMessage);
}

Expand Down Expand Up @@ -171,9 +185,13 @@ public List<String> getRegisteredDeprecatedPaths() {
*
* @param method the method.
* @param path the path.
* @param name the name corresponding to this route.
* @return A string appending the method and path.
*/
public static String restPathToString(Method method, String path) {
public static String restPathToString(Method method, String path, Optional<String> name) {
Copy link
Member

Choose a reason for hiding this comment

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

Originally this was a more important method but I think it's been reduced to a cosmetic/logging/exception-message method as the rest paths are stored in the pathTrie. So I think the plain space-delimited text may not be useful or may be more confusing than using some other custom output here.

if (name.isPresent()) {
return method.name() + " " + path + " " + name.get();
}
return method.name() + " " + path;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
import org.opensearch.common.xcontent.XContentType;
import org.opensearch.common.xcontent.json.JsonXContent;
import org.opensearch.extensions.rest.ExtensionRestResponse;
import org.opensearch.extensions.rest.RouteHandler;
import org.opensearch.rest.RestRequest;
import org.opensearch.sdk.rest.BaseExtensionRestHandler;
import org.opensearch.sdk.rest.ExtensionRestHandler;
Expand Down Expand Up @@ -50,13 +51,18 @@ public class RestHelloAction extends BaseExtensionRestHandler {
private List<String> worldAdjectives = new ArrayList<>();
private Random rand = new Random();

/**
* Instantiate this action
*/
public RestHelloAction() {}

@Override
public List<RouteHandler> routeHandlers() {
return List.of(
new RouteHandler(GET, "/hello", handleGetRequest),
new RouteHandler(POST, "/hello", handlePostRequest),
new RouteHandler(PUT, "/hello/{name}", handlePutRequest),
new RouteHandler(DELETE, "/goodbye", handleDeleteRequest)
new RouteHandler(routePrefix("greet"), GET, "/hello", handleGetRequest),
new RouteHandler(routePrefix("greet_with_adjective"), POST, "/hello", handlePostRequest),
new RouteHandler(routePrefix("greet_with_name"), PUT, "/hello/{name}", handlePutRequest),
new RouteHandler(routePrefix("goodbye"), DELETE, "/goodbye", handleDeleteRequest)
);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
import org.opensearch.extensions.ExtensionsManager;
import org.opensearch.extensions.action.RemoteExtensionActionResponse;
import org.opensearch.extensions.rest.ExtensionRestResponse;
import org.opensearch.extensions.rest.RouteHandler;
import org.opensearch.rest.RestRequest;
import org.opensearch.sdk.ExtensionsRunner;
import org.opensearch.sdk.SDKClient;
Expand Down
1 change: 1 addition & 0 deletions src/main/resources/sample/helloworld-settings.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
extensionName: hello-world
shortExtensionName: hw
hostAddress: 127.0.0.1
hostPort: 4500
opensearchAddress: 127.0.0.1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
public class ExtensionsRunnerForTest extends ExtensionsRunner {

public static final String NODE_NAME = "sample-extension";
public static final String NODE_SHORT_NAME = "abbr";
public static final String NODE_HOST = "127.0.0.1";
public static final String NODE_PORT = "4532";

Expand All @@ -26,7 +27,7 @@ public class ExtensionsRunnerForTest extends ExtensionsRunner {
* @throws IOException if the runner failed to read settings or API.
*/
public ExtensionsRunnerForTest() throws IOException {
super(new BaseExtension(new ExtensionSettings(NODE_NAME, NODE_HOST, NODE_PORT, "127.0.0.1", "9200")) {
super(new BaseExtension(new ExtensionSettings(NODE_NAME, NODE_SHORT_NAME, NODE_HOST, NODE_PORT, "127.0.0.1", "9200")) {
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ public void setUp() throws Exception {
@Test
public void testSettingsStrings() {
assertEquals("sample-extension", extensionSettings.getExtensionName());
assertEquals("se", extensionSettings.getShortExtensionName());
assertEquals("127.0.0.1", extensionSettings.getHostAddress());
assertEquals("4532", extensionSettings.getHostPort());
assertEquals("127.0.0.1", extensionSettings.getOpensearchAddress());
Expand All @@ -42,8 +43,9 @@ public void testSettingsStrings() {

@Test
public void testConstructorWithArgs() {
ExtensionSettings settings = new ExtensionSettings("foo", "bar", "baz", "os", "port");
ExtensionSettings settings = new ExtensionSettings("foo", "abbr", "bar", "baz", "os", "port");
assertEquals("foo", settings.getExtensionName());
assertEquals("abbr", settings.getShortExtensionName());
assertEquals("bar", settings.getHostAddress());
assertEquals("baz", settings.getHostPort());
assertEquals("os", settings.getOpensearchAddress());
Expand Down
Loading