diff --git a/libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java b/libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java index 00a704d82301c..bfaeb0988b5a6 100644 --- a/libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java +++ b/libs/core/src/main/java/org/elasticsearch/core/UpdateForV9.java @@ -29,8 +29,7 @@ enum Owner { ENTERPRISE_SEARCH, MACHINE_LEARNING, PROFILING, - SEARCH_ANALYTICS, - SECURITY, + SEARCH_ANALYTICS } /** diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java index d3347f3432a47..5dddd8169e27b 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/License.java @@ -15,7 +15,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.xcontent.LoggingDeprecationHandler; import org.elasticsearch.common.xcontent.XContentHelper; -import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; import org.elasticsearch.xcontent.XContentParser; @@ -137,13 +136,6 @@ static boolean isEnterprise(String typeName) { * to a specific license version */ public static final String LICENSE_VERSION_MODE = "license_version"; - /** - * Set for RestApiVersion#V_7 requests only - * XContent param name to map the "enterprise" license type to "platinum" - * for backwards compatibility with older clients - */ - @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // v7 REST API no longer exists: eliminate ref to RestApiVersion.V_7 - public static final String XCONTENT_HIDE_ENTERPRISE = "hide_enterprise"; public static final Comparator LATEST_ISSUE_DATE_FIRST = Comparator.comparing(License::issueDate).reversed(); @@ -497,8 +489,6 @@ public XContentBuilder toXContent(XContentBuilder builder, Params params) throws public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) throws IOException { boolean licenseSpecMode = params.paramAsBoolean(LICENSE_SPEC_VIEW_MODE, false); boolean restViewMode = params.paramAsBoolean(REST_VIEW_MODE, false); - boolean hideEnterprise = params.paramAsBoolean(XCONTENT_HIDE_ENTERPRISE, false); - boolean previouslyHumanReadable = builder.humanReadable(); if (licenseSpecMode && restViewMode) { throw new IllegalArgumentException("can have either " + REST_VIEW_MODE + " or " + LICENSE_SPEC_VIEW_MODE); @@ -517,8 +507,7 @@ public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) t builder.field(Fields.STATUS, LicenseUtils.status(this).label()); } builder.field(Fields.UID, uid); - final String bwcType = hideEnterprise && LicenseType.isEnterprise(type) ? LicenseType.PLATINUM.getTypeName() : type; - builder.field(Fields.TYPE, bwcType); + builder.field(Fields.TYPE, type); if (licenseVersion == VERSION_START) { builder.field(Fields.SUBSCRIPTION_TYPE, subscriptionType); } @@ -534,8 +523,6 @@ public XContentBuilder toInnerXContent(XContentBuilder builder, Params params) t if (licenseVersion >= VERSION_ENTERPRISE) { builder.field(Fields.MAX_NODES, maxNodes == -1 ? null : maxNodes); builder.field(Fields.MAX_RESOURCE_UNITS, maxResourceUnits == -1 ? null : maxResourceUnits); - } else if (hideEnterprise && maxNodes == -1) { - builder.field(Fields.MAX_NODES, maxResourceUnits); } else { builder.field(Fields.MAX_NODES, maxNodes); } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java index 92e46e3ea6564..91049a1a9339e 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/license/RestGetLicenseAction.java @@ -11,7 +11,7 @@ import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; import org.elasticsearch.common.util.Maps; -import org.elasticsearch.core.UpdateForV9; +import org.elasticsearch.core.UpdateForV10; import org.elasticsearch.protocol.xpack.license.GetLicenseRequest; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -55,14 +55,13 @@ public String getName() { * The licenses are sorted by latest issue_date */ @Override - @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // remove support for accept_enterprise param + @UpdateForV10(owner = UpdateForV10.Owner.SECURITY) // remove support for accept_enterprise param public RestChannelConsumer prepareRequest(final RestRequest request, final NodeClient client) throws IOException { final Map overrideParams = Maps.newMapWithExpectedSize(2); overrideParams.put(License.REST_VIEW_MODE, "true"); overrideParams.put(License.LICENSE_VERSION_MODE, String.valueOf(License.VERSION_CURRENT)); - // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true - // TODO Remove this from 9.0 + // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0+ the flag is deprecated and can only be true if (request.hasParam("accept_enterprise")) { deprecationLogger.warn( DeprecationCategory.API, @@ -70,7 +69,7 @@ public RestChannelConsumer prepareRequest(final RestRequest request, final NodeC "Including [accept_enterprise] in get license requests is deprecated." + " The parameter will be removed in the next major version" ); - if (request.paramAsBoolean("accept_enterprise", true) == false) { + if (request.paramAsBoolean("accept_enterprise", true) == false) { // consumes the parameter to avoid error throw new IllegalArgumentException("The [accept_enterprise] parameters may not be false"); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java index 4e558e2a394dc..ef1ac20998ed2 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/rest/action/RestXPackInfoAction.java @@ -9,7 +9,7 @@ import org.elasticsearch.client.internal.node.NodeClient; import org.elasticsearch.common.logging.DeprecationCategory; import org.elasticsearch.common.logging.DeprecationLogger; -import org.elasticsearch.core.UpdateForV9; +import org.elasticsearch.core.UpdateForV10; import org.elasticsearch.protocol.xpack.XPackInfoRequest; import org.elasticsearch.rest.BaseRestHandler; import org.elasticsearch.rest.RestRequest; @@ -41,14 +41,13 @@ public String getName() { } @Override - @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // accept_enterprise parameter no longer supported? + @UpdateForV10(owner = UpdateForV10.Owner.SECURITY) // remove once accept_enterprise parameter no longer supported public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client) throws IOException { // we piggyback verbosity on "human" output boolean verbose = request.paramAsBoolean("human", true); // In 7.x, there was an opt-in flag to show "enterprise" licenses. In 8.0 the flag is deprecated and can only be true - // TODO Remove this from 9.0 if (request.hasParam("accept_enterprise")) { deprecationLogger.warn( DeprecationCategory.API, @@ -56,7 +55,7 @@ public RestChannelConsumer prepareRequest(RestRequest request, NodeClient client "Including [accept_enterprise] in get license requests is deprecated." + " The parameter will be removed in the next major version" ); - if (request.paramAsBoolean("accept_enterprise", true) == false) { + if (request.paramAsBoolean("accept_enterprise", true) == false) { // consumes the parameter to avoid error throw new IllegalArgumentException("The [accept_enterprise] parameters may not be false"); } } diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java index 88bc8a46532b5..3bc932d23df06 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/GetSecuritySettingsAction.java @@ -16,7 +16,6 @@ import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.xcontent.ToXContentObject; import org.elasticsearch.xcontent.XContentBuilder; @@ -40,13 +39,8 @@ public Request(TimeValue masterNodeTimeout) { super(masterNodeTimeout); } - @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // no need for bwc any more, this can be inlined public static Request readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { - return new Request(in); - } else { - return new Request(TimeValue.THIRTY_SECONDS); - } + return new Request(in); } private Request(StreamInput in) throws IOException { diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java index c3bd1c51d113c..d438450a68328 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/settings/UpdateSecuritySettingsAction.java @@ -18,7 +18,6 @@ import org.elasticsearch.common.io.stream.StreamInput; import org.elasticsearch.common.io.stream.StreamOutput; import org.elasticsearch.core.TimeValue; -import org.elasticsearch.core.UpdateForV9; import org.elasticsearch.xcontent.ConstructingObjectParser; import org.elasticsearch.xcontent.ParseField; import org.elasticsearch.xcontent.XContentParser; @@ -116,13 +115,8 @@ public Request( this.profilesIndexSettings = Objects.requireNonNullElse(profilesIndexSettings, Collections.emptyMap()); } - @UpdateForV9(owner = UpdateForV9.Owner.SECURITY) // no need for bwc any more, this can be inlined public static Request readFrom(StreamInput in) throws IOException { - if (in.getTransportVersion().onOrAfter(TransportVersions.V_8_15_0)) { - return new Request(in); - } else { - return new Request(TimeValue.THIRTY_SECONDS, TimeValue.THIRTY_SECONDS, in); - } + return new Request(in); } private Request(StreamInput in) throws IOException {