From c7e3bcf0d2845c2c8182d9f1f7f1c03fbee0f7c4 Mon Sep 17 00:00:00 2001 From: Simon Cooper Date: Mon, 9 Dec 2024 17:07:13 +0000 Subject: [PATCH] Not you --- .../action/apikey/InvalidateApiKeyRequest.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java index 3346513ca42c8..bcd8ff0493f72 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/apikey/InvalidateApiKeyRequest.java @@ -49,7 +49,11 @@ public InvalidateApiKeyRequest(StreamInput in) throws IOException { } validateIds(ids); name = textOrNull(in.readOptionalString()); - ownedByAuthenticatedUser = in.readOptionalBoolean(); + if (in.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { + ownedByAuthenticatedUser = in.readOptionalBoolean(); + } else { + ownedByAuthenticatedUser = false; + } } public InvalidateApiKeyRequest( @@ -219,7 +223,9 @@ public void writeTo(StreamOutput out) throws IOException { } } out.writeOptionalString(name); - out.writeOptionalBoolean(ownedByAuthenticatedUser); + if (out.getTransportVersion().onOrAfter(TransportVersions.V_7_4_0)) { + out.writeOptionalBoolean(ownedByAuthenticatedUser); + } } @Override