From 5261673349b4d16c0597071c0d3ef1c3e64e157b Mon Sep 17 00:00:00 2001 From: Yogesh Gaikwad <902768+bizybot@users.noreply.github.com> Date: Wed, 6 Feb 2019 16:03:49 +1100 Subject: [PATCH] Change the min supported version to 6.7.0 for API keys (#38481) This commit changes the minimum supported version to 6.7.0 for API keys, the change for the API keys has been backported to 6.7.0 version #38399 --- .../xpack/core/security/authc/Authentication.java | 4 ++-- .../org/elasticsearch/xpack/security/authc/ApiKeyService.java | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java index a93cc44aadb23..de75d90eca51f 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java @@ -60,7 +60,7 @@ public Authentication(StreamInput in) throws IOException { this.lookedUpBy = null; } this.version = in.getVersion(); - if (in.getVersion().onOrAfter(Version.V_7_0_0)) { // TODO change to V6_6 after backport + if (in.getVersion().onOrAfter(Version.V_6_7_0)) { type = AuthenticationType.values()[in.readVInt()]; metadata = in.readMap(); } else { @@ -165,7 +165,7 @@ public void writeTo(StreamOutput out) throws IOException { } else { out.writeBoolean(false); } - if (out.getVersion().onOrAfter(Version.V_7_0_0)) { // TODO change to V6_6 after backport + if (out.getVersion().onOrAfter(Version.V_6_7_0)) { out.writeVInt(type.ordinal()); out.writeMap(metadata); } diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java index d97913f17ff9e..3099412d2c21d 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authc/ApiKeyService.java @@ -194,11 +194,11 @@ public void createApiKey(Authentication authentication, CreateApiKeyRequest requ final Instant expiration = getApiKeyExpiration(created, request); final SecureString apiKey = UUIDs.randomBase64UUIDSecureString(); final Version version = clusterService.state().nodes().getMinNodeVersion(); - if (version.before(Version.V_7_0_0)) { // TODO(jaymode) change to V6_6_0 on backport! + if (version.before(Version.V_6_7_0)) { logger.warn( "nodes prior to the minimum supported version for api keys {} exist in the cluster;" + " these nodes will not be able to use api keys", - Version.V_7_0_0); + Version.V_6_7_0); } final char[] keyHash = hasher.hash(apiKey);