From 04f0c9a9f5e3db5ffd2ff92f492500aeea0d4127 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Mon, 4 Jun 2018 20:29:58 -0700 Subject: [PATCH 1/2] move security plugins to a sub ingest directory It makes sense to introduce new Security ingest processors (example: #31087), and this change would give them a good place to be written. --- .../accesscontrol => ingest}/SetSecurityUserProcessor.java | 2 +- .../SetSecurityUserProcessorFactoryTests.java | 4 ++-- .../core/security/ingest}/SetSecurityUserProcessorTests.java | 5 ++--- .../main/java/org/elasticsearch/xpack/security/Security.java | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) rename x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/{authz/accesscontrol => ingest}/SetSecurityUserProcessor.java (98%) rename x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/{authz/accesscontrol => ingest}/SetSecurityUserProcessorFactoryTests.java (94%) rename x-pack/plugin/{security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol => core/src/test/java/org/elasticsearch/xpack/core/security/ingest}/SetSecurityUserProcessorTests.java (97%) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java similarity index 98% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java rename to x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java index 051a077646320..6b7c5c9a30989 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessor.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.authz.accesscontrol; +package org.elasticsearch.xpack.core.security.ingest; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.ingest.AbstractProcessor; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java similarity index 94% rename from x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java rename to x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java index 483d3de2beaa3..bae2ff37663e3 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/authz/accesscontrol/SetSecurityUserProcessorFactoryTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.authz.accesscontrol; +package org.elasticsearch.xpack.core.security.ingest; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor.Property; +import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor.Property; import java.util.Arrays; import java.util.EnumSet; diff --git a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java similarity index 97% rename from x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java rename to x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java index c9ef169a375a5..62ce6cc065b99 100644 --- a/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/authz/accesscontrol/SetSecurityUserProcessorTests.java +++ b/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.security.authz.accesscontrol; +package org.elasticsearch.xpack.core.security.ingest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; @@ -11,8 +11,7 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authc.AuthenticationField; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor.Property; +import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor.Property; import org.elasticsearch.xpack.core.security.user.User; import java.util.Collections; diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index d2e359990966b..086fe13d801cf 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -115,7 +115,7 @@ import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl; import org.elasticsearch.xpack.core.security.authz.accesscontrol.SecurityIndexSearcherWrapper; -import org.elasticsearch.xpack.core.security.authz.accesscontrol.SetSecurityUserProcessor; +import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissionsCache; import org.elasticsearch.xpack.security.authz.store.FileRolesStore; From 8c502c304074cd64766c872dc7771cf18c796268 Mon Sep 17 00:00:00 2001 From: Tal Levy Date: Wed, 13 Jun 2018 11:24:23 -0700 Subject: [PATCH 2/2] move them out of core --- .../main/java/org/elasticsearch/xpack/security/Security.java | 2 +- .../xpack}/security/ingest/SetSecurityUserProcessor.java | 2 +- .../security/ingest/SetSecurityUserProcessorFactoryTests.java | 4 ++-- .../xpack}/security/ingest/SetSecurityUserProcessorTests.java | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) rename x-pack/plugin/{core/src/main/java/org/elasticsearch/xpack/core => security/src/main/java/org/elasticsearch/xpack}/security/ingest/SetSecurityUserProcessor.java (99%) rename x-pack/plugin/{core/src/test/java/org/elasticsearch/xpack/core => security/src/test/java/org/elasticsearch/xpack}/security/ingest/SetSecurityUserProcessorFactoryTests.java (95%) rename x-pack/plugin/{core/src/test/java/org/elasticsearch/xpack/core => security/src/test/java/org/elasticsearch/xpack}/security/ingest/SetSecurityUserProcessorTests.java (98%) diff --git a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java index 086fe13d801cf..664745b19204b 100644 --- a/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/Security.java @@ -115,7 +115,6 @@ import org.elasticsearch.xpack.core.security.authz.RoleDescriptor; import org.elasticsearch.xpack.core.security.authz.accesscontrol.IndicesAccessControl; import org.elasticsearch.xpack.core.security.authz.accesscontrol.SecurityIndexSearcherWrapper; -import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissions; import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissionsCache; import org.elasticsearch.xpack.security.authz.store.FileRolesStore; @@ -174,6 +173,7 @@ import org.elasticsearch.xpack.security.authz.accesscontrol.OptOutQueryCache; import org.elasticsearch.xpack.security.authz.store.CompositeRolesStore; import org.elasticsearch.xpack.security.authz.store.NativeRolesStore; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor; import org.elasticsearch.xpack.security.rest.SecurityRestFilter; import org.elasticsearch.xpack.security.rest.action.RestAuthenticateAction; import org.elasticsearch.xpack.security.rest.action.oauth2.RestGetTokenAction; diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java similarity index 99% rename from x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java rename to x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java index 6b7c5c9a30989..15ac88b4d9462 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessor.java +++ b/x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessor.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.ingest; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.common.util.concurrent.ThreadContext; import org.elasticsearch.ingest.AbstractProcessor; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java similarity index 95% rename from x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java rename to x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java index bae2ff37663e3..19da9b18ea650 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorFactoryTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorFactoryTests.java @@ -3,11 +3,11 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.ingest; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.ElasticsearchParseException; import org.elasticsearch.test.ESTestCase; -import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor.Property; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor.Property; import java.util.Arrays; import java.util.EnumSet; diff --git a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java similarity index 98% rename from x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java rename to x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java index 62ce6cc065b99..26c59a1ef5470 100644 --- a/x-pack/plugin/core/src/test/java/org/elasticsearch/xpack/core/security/ingest/SetSecurityUserProcessorTests.java +++ b/x-pack/plugin/security/src/test/java/org/elasticsearch/xpack/security/ingest/SetSecurityUserProcessorTests.java @@ -3,7 +3,7 @@ * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ -package org.elasticsearch.xpack.core.security.ingest; +package org.elasticsearch.xpack.security.ingest; import org.elasticsearch.common.settings.Settings; import org.elasticsearch.common.util.concurrent.ThreadContext; @@ -11,8 +11,8 @@ import org.elasticsearch.test.ESTestCase; import org.elasticsearch.xpack.core.security.authc.Authentication; import org.elasticsearch.xpack.core.security.authc.AuthenticationField; -import org.elasticsearch.xpack.core.security.ingest.SetSecurityUserProcessor.Property; import org.elasticsearch.xpack.core.security.user.User; +import org.elasticsearch.xpack.security.ingest.SetSecurityUserProcessor.Property; import java.util.Collections; import java.util.EnumSet;