Skip to content

Commit 7358bb8

Browse files
authored
Use plugin canonical name instead of rest wrapper canonical name (#73245) (#73249)
* Use plugin canonical name for the 3rd party Security plugin detection instead of rest wrapper canonical name Resolve: #73227
1 parent 3856d5a commit 7358bb8

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

server/src/main/java/org/elasticsearch/action/ActionModule.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,10 +460,9 @@ public ActionModule(boolean transportClient, Settings settings, IndexNameExpress
460460
throw new IllegalArgumentException("Cannot have more than one plugin implementing a REST wrapper");
461461
}
462462
restWrapper = newRestWrapper;
463-
if (restWrapper.getClass().getCanonicalName() == null ||
464-
restWrapper.getClass().getCanonicalName().startsWith("org.elasticsearch") == false) {
463+
if ("org.elasticsearch.xpack.security.Security".equals(plugin.getClass().getCanonicalName()) == false) {
465464
deprecationLogger.deprecate(DeprecationCategory.PLUGINS, "3rd_party_rest_deprecation", "The " +
466-
plugin.getClass().getName() + "plugin installs a custom REST wrapper. This functionality is deprecated and will " +
465+
plugin.getClass().getName() + " plugin installs a custom REST wrapper. This functionality is deprecated and will " +
467466
"not be possible in Elasticsearch 8.0. If this plugin is intended to provide security features for Elasticsearch " +
468467
"then you should switch to using the built-in Elasticsearch features instead.");
469468
}

0 commit comments

Comments
 (0)