Skip to content

Commit eb3accb

Browse files
jaymodealbertzaharovits
authored andcommitted
Security: move User to protocol project (elastic#32367)
The User class has been moved to the protocol project for upcoming work to add more security APIs to the high level rest client. As part of this change, the toString method no longer uses a custom output method from MetadataUtils and instead just relies on Java's toString implementation.
1 parent 080b9f5 commit eb3accb

File tree

103 files changed

+164
-160
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

103 files changed

+164
-160
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/SecurityContext.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
import org.elasticsearch.common.util.concurrent.ThreadContext.StoredContext;
1414
import org.elasticsearch.node.Node;
1515
import org.elasticsearch.xpack.core.security.authc.Authentication;
16-
import org.elasticsearch.xpack.core.security.user.User;
16+
import org.elasticsearch.protocol.xpack.security.User;
1717

1818
import java.io.IOException;
1919
import java.util.Objects;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/UserSettings.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.elasticsearch.common.settings.Settings;
1111
import org.elasticsearch.common.util.concurrent.ThreadContext;
1212
import org.elasticsearch.xpack.core.security.authc.Authentication;
13-
import org.elasticsearch.xpack.core.security.user.User;
13+
import org.elasticsearch.protocol.xpack.security.User;
1414

1515
import java.io.IOException;
1616

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/AuthenticateResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.elasticsearch.action.ActionResponse;
99
import org.elasticsearch.common.io.stream.StreamInput;
1010
import org.elasticsearch.common.io.stream.StreamOutput;
11-
import org.elasticsearch.xpack.core.security.user.User;
11+
import org.elasticsearch.protocol.xpack.security.User;
1212

1313
import java.io.IOException;
1414

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/ChangePasswordRequestBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
import org.elasticsearch.common.xcontent.XContentType;
1919
import org.elasticsearch.xpack.core.security.authc.support.Hasher;
2020
import org.elasticsearch.xpack.core.security.support.Validation;
21-
import org.elasticsearch.xpack.core.security.user.User;
21+
import org.elasticsearch.protocol.xpack.security.User;
2222
import org.elasticsearch.xpack.core.security.xcontent.XContentUtils;
2323

2424
import java.io.IOException;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/GetUsersResponse.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
import org.elasticsearch.action.ActionResponse;
99
import org.elasticsearch.common.io.stream.StreamInput;
1010
import org.elasticsearch.common.io.stream.StreamOutput;
11-
import org.elasticsearch.xpack.core.security.user.User;
11+
import org.elasticsearch.protocol.xpack.security.User;
1212

1313
import java.io.IOException;
1414
import java.util.Collection;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/action/user/PutUserRequestBuilder.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
import org.elasticsearch.common.xcontent.XContentType;
2121
import org.elasticsearch.xpack.core.security.authc.support.Hasher;
2222
import org.elasticsearch.xpack.core.security.support.Validation;
23-
import org.elasticsearch.xpack.core.security.user.User;
23+
import org.elasticsearch.protocol.xpack.security.User;
2424
import org.elasticsearch.xpack.core.security.xcontent.XContentUtils;
2525

2626
import java.io.IOException;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Authentication.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import org.elasticsearch.common.io.stream.StreamOutput;
1313
import org.elasticsearch.common.util.concurrent.ThreadContext;
1414
import org.elasticsearch.xpack.core.security.user.InternalUserSerializationHelper;
15-
import org.elasticsearch.xpack.core.security.user.User;
15+
import org.elasticsearch.protocol.xpack.security.User;
1616

1717
import java.io.IOException;
1818
import java.util.Base64;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/AuthenticationResult.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
package org.elasticsearch.xpack.core.security.authc;
77

88
import org.elasticsearch.common.Nullable;
9-
import org.elasticsearch.xpack.core.security.user.User;
9+
import org.elasticsearch.protocol.xpack.security.User;
1010

1111
import java.util.Objects;
1212

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authc/Realm.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import org.elasticsearch.action.ActionListener;
1010
import org.elasticsearch.common.util.concurrent.ThreadContext;
1111
import org.elasticsearch.xpack.core.XPackField;
12-
import org.elasticsearch.xpack.core.security.user.User;
12+
import org.elasticsearch.protocol.xpack.security.User;
1313

1414
import java.util.Collections;
1515
import java.util.HashMap;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/security/authz/RoleDescriptor.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
import org.elasticsearch.common.xcontent.json.JsonXContent;
2727
import org.elasticsearch.xpack.core.security.authz.privilege.ConditionalClusterPrivilege;
2828
import org.elasticsearch.xpack.core.security.authz.privilege.ConditionalClusterPrivileges;
29-
import org.elasticsearch.xpack.core.security.support.MetadataUtils;
3029
import org.elasticsearch.xpack.core.security.support.Validation;
3130
import org.elasticsearch.xpack.core.security.xcontent.XContentUtils;
3231

@@ -163,7 +162,7 @@ public String toString() {
163162
}
164163
sb.append("], runAs=[").append(Strings.arrayToCommaDelimitedString(runAs));
165164
sb.append("], metadata=[");
166-
MetadataUtils.writeValue(sb, metadata);
165+
sb.append(metadata);
167166
sb.append("]]");
168167
return sb.toString();
169168
}

0 commit comments

Comments
 (0)