Skip to content

Commit 7f85017

Browse files
committed
Remove deprecated route and endpoint
Removed: - `/_opendistro` route - `/_opendistro/kibanainfo` endpoint Signed-off-by: Andrey Pleskach <[email protected]>
1 parent cac7743 commit 7f85017

File tree

59 files changed

+198
-436
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+198
-436
lines changed

config/opensearch.yml.example

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ plugins.security.nodes_dn:
1818

1919
# The nodes_dn_dynamic_config_enabled settings is geared towards cross_cluster usecases where there is a need to
2020
# manage the whitelisted nodes_dn without having to restart the nodes everytime a new cross_cluster remote is configured
21-
# Setting nodes_dn_dynamic_config_enabled to true enables **super-admin callable** /_opendistro/_security/api/nodesdn APIs
21+
# Setting nodes_dn_dynamic_config_enabled to true enables **super-admin callable** /_security/api/nodesdn APIs
2222
# which provide means to update/retrieve nodesdn dynamically.
2323
#
2424
# NOTE: The overall whitelisted nodes_dn evaluated comes from both the plugins.security.nodes_dn and the ones stored

src/integrationTest/java/org/opensearch/security/TlsTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public class TlsTests {
5353

5454
public static final String SUPPORTED_CIPHER_SUIT = "TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256";
5555
public static final String NOT_SUPPORTED_CIPHER_SUITE = "TLS_RSA_WITH_AES_128_CBC_SHA";
56-
public static final String AUTH_INFO_ENDPOINT = "/_opendistro/_security/authinfo?pretty";
56+
public static final String AUTH_INFO_ENDPOINT = "/_plugins/_security/authinfo?pretty";
5757

5858
@ClassRule
5959
public static final LocalCluster cluster = new LocalCluster.Builder().clusterManager(ClusterManager.THREE_CLUSTER_MANAGERS)

src/integrationTest/java/org/opensearch/security/api/AbstractApiIntegrationTest.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@
5555
import static org.hamcrest.Matchers.equalToIgnoringCase;
5656
import static org.hamcrest.Matchers.notNullValue;
5757
import static org.opensearch.security.CrossClusterSearchTests.PLUGINS_SECURITY_RESTAPI_ROLES_ENABLED;
58-
import static org.opensearch.security.OpenSearchSecurityPlugin.LEGACY_OPENDISTRO_PREFIX;
5958
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
6059
import static org.opensearch.security.dlic.rest.api.RestApiAdminPrivilegesEvaluator.CERTS_INFO_ACTION;
6160
import static org.opensearch.security.dlic.rest.api.RestApiAdminPrivilegesEvaluator.ENDPOINTS_WITH_PERMISSIONS;
@@ -270,7 +269,7 @@ protected void withUser(
270269
}
271270

272271
protected String apiPathPrefix() {
273-
return randomFrom(List.of(LEGACY_OPENDISTRO_PREFIX, PLUGINS_PREFIX));
272+
return PLUGINS_PREFIX;
274273
}
275274

276275
protected String securityPath(String... path) {

src/integrationTest/java/org/opensearch/security/api/DashboardsInfoTest.java

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,13 @@
1111

1212
package org.opensearch.security.api;
1313

14-
import java.util.List;
15-
1614
import org.junit.Test;
1715

1816
import org.opensearch.test.framework.TestSecurityConfig;
1917
import org.opensearch.test.framework.TestSecurityConfig.Role;
2018

2119
import static org.hamcrest.MatcherAssert.assertThat;
2220
import static org.hamcrest.Matchers.equalTo;
23-
import static org.opensearch.security.OpenSearchSecurityPlugin.LEGACY_OPENDISTRO_PREFIX;
2421
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
2522
import static org.opensearch.security.rest.DashboardsInfoAction.DEFAULT_PASSWORD_MESSAGE;
2623
import static org.opensearch.security.rest.DashboardsInfoAction.DEFAULT_PASSWORD_REGEX;
@@ -36,7 +33,7 @@ public class DashboardsInfoTest extends AbstractApiIntegrationTest {
3633
}
3734

3835
private String apiPath() {
39-
return randomFrom(List.of(PLUGINS_PREFIX + "/dashboardsinfo", LEGACY_OPENDISTRO_PREFIX + "/kibanainfo"));
36+
return PLUGINS_PREFIX + "/dashboardsinfo";
4037
}
4138

4239
@Test

src/integrationTest/java/org/opensearch/security/api/DashboardsInfoWithSettingsTest.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
package org.opensearch.security.api;
1313

14-
import java.util.List;
1514
import java.util.Map;
1615

1716
import org.junit.Test;
@@ -22,7 +21,6 @@
2221

2322
import static org.hamcrest.MatcherAssert.assertThat;
2423
import static org.hamcrest.Matchers.equalTo;
25-
import static org.opensearch.security.OpenSearchSecurityPlugin.LEGACY_OPENDISTRO_PREFIX;
2624
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
2725

2826
public class DashboardsInfoWithSettingsTest extends AbstractApiIntegrationTest {
@@ -49,7 +47,7 @@ protected Map<String, Object> getClusterSettings() {
4947
}
5048

5149
private String apiPath() {
52-
return randomFrom(List.of(PLUGINS_PREFIX + "/dashboardsinfo", LEGACY_OPENDISTRO_PREFIX + "/kibanainfo"));
50+
return PLUGINS_PREFIX + "/dashboardsinfo";
5351
}
5452

5553
@Test

src/integrationTest/java/org/opensearch/security/http/CommonProxyAuthenticationTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
*/
3131
abstract class CommonProxyAuthenticationTests {
3232

33-
protected static final String RESOURCE_AUTH_INFO = "_opendistro/_security/authinfo";
33+
protected static final String RESOURCE_AUTH_INFO = "_plugins/_security/authinfo";
3434
protected static final TestSecurityConfig.User USER_ADMIN = new TestSecurityConfig.User("admin").roles(ALL_ACCESS);
3535

3636
protected static final String ATTRIBUTE_DEPARTMENT = "department";

src/integrationTest/java/org/opensearch/security/http/JwtAuthenticationWithUrlParamTests.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ public void shouldAuthenticateWithJwtTokenInUrl_positive() {
112112
Map<String, String> expectedParams = Map.of("token", "REDACTED", "verbose", "true");
113113

114114
auditLogsRule.assertExactlyOne(
115-
userAuthenticated(ADMIN_USER).withRestRequest(GET, "/_opendistro/_security/authinfo").withRestParams(expectedParams)
115+
userAuthenticated(ADMIN_USER).withRestRequest(GET, "/_plugins/_security/authinfo").withRestParams(expectedParams)
116116
);
117117
}
118118
}

src/integrationTest/java/org/opensearch/test/framework/cluster/TestRestClient.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ public HttpResponse getWithoutLeadingSlash(String path, Header... headers) {
117117
}
118118

119119
public HttpResponse getAuthInfo(Header... headers) {
120-
return executeRequest(new HttpGet(getHttpServerUri() + "/_opendistro/_security/authinfo?pretty"), headers);
120+
return executeRequest(new HttpGet(getHttpServerUri() + "/_plugins/_security/authinfo?pretty"), headers);
121121
}
122122

123123
public HttpResponse securityHealth(Header... headers) {
@@ -127,7 +127,7 @@ public HttpResponse securityHealth(Header... headers) {
127127
public HttpResponse getAuthInfo(Map<String, String> urlParams, Header... headers) {
128128
String urlParamsString = "?"
129129
+ urlParams.entrySet().stream().map(e -> e.getKey() + "=" + e.getValue()).collect(Collectors.joining("&"));
130-
return executeRequest(new HttpGet(getHttpServerUri() + "/_opendistro/_security/authinfo" + urlParamsString), headers);
130+
return executeRequest(new HttpGet(getHttpServerUri() + "/_plugins/_security/authinfo" + urlParamsString), headers);
131131
}
132132

133133
public void confirmCorrectCredentials(String expectedUserName) {

src/main/java/com/amazon/dlic/auth/http/saml/AuthTokenProcessorHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ private AuthTokenProcessorAction.Response handleImpl(
139139
String acsEndpoint,
140140
Saml2Settings saml2Settings,
141141
String requestPath // the parameter will be removed in the future as soon as we will read of legacy paths aka
142-
// /_opendistro/_security/...
142+
// /_security/...
143143
) {
144144
if (token_log.isDebugEnabled()) {
145145
try {

src/main/java/com/amazon/dlic/auth/http/saml/HTTPSamlAuthenticator.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@
7373
import org.w3c.dom.Element;
7474
import org.xml.sax.SAXException;
7575

76-
import static org.opensearch.security.OpenSearchSecurityPlugin.LEGACY_OPENDISTRO_PREFIX;
7776
import static org.opensearch.security.OpenSearchSecurityPlugin.PLUGINS_PREFIX;
7877

7978
public class HTTPSamlAuthenticator implements HTTPAuthenticator, Destroyable {
@@ -85,7 +84,7 @@ public class HTTPSamlAuthenticator implements HTTPAuthenticator, Destroyable {
8584

8685
public static final String API_AUTHTOKEN_SUFFIX = "api/authtoken";
8786
private static final String AUTHINFO_SUFFIX = "authinfo";
88-
private static final String REGEX_PATH_PREFIX = "/(" + LEGACY_OPENDISTRO_PREFIX + "|" + PLUGINS_PREFIX + ")/" + "(.*)";
87+
private static final String REGEX_PATH_PREFIX = "/(" + PLUGINS_PREFIX + ")/" + "(.*)";
8988
private static final Pattern PATTERN_PATH_PREFIX = Pattern.compile(REGEX_PATH_PREFIX);
9089

9190
private static boolean openSamlInitialized = false;

0 commit comments

Comments
 (0)