|
71 | 71 | import org.elasticsearch.client.security.support.expressiondsl.expressions.AnyRoleMapperExpression;
|
72 | 72 | import org.elasticsearch.client.security.support.expressiondsl.fields.FieldRoleMapperExpression;
|
73 | 73 | import org.elasticsearch.client.security.user.User;
|
74 |
| -import org.elasticsearch.client.security.user.privileges.Role; |
75 | 74 | import org.elasticsearch.client.security.user.privileges.ApplicationPrivilege;
|
| 75 | +import org.elasticsearch.client.security.user.privileges.ApplicationResourcePrivileges; |
76 | 76 | import org.elasticsearch.client.security.user.privileges.IndicesPrivileges;
|
| 77 | +import org.elasticsearch.client.security.user.privileges.Role; |
| 78 | +import org.elasticsearch.client.security.user.privileges.UserIndicesPrivileges; |
77 | 79 | import org.elasticsearch.common.util.set.Sets;
|
78 | 80 | import org.hamcrest.Matchers;
|
79 | 81 |
|
80 | 82 | import javax.crypto.SecretKeyFactory;
|
81 | 83 | import javax.crypto.spec.PBEKeySpec;
|
| 84 | + |
82 | 85 | import java.io.IOException;
|
83 |
| -import java.security.SecureRandom; |
84 |
| -import java.util.Base64; |
85 | 86 | import java.util.ArrayList;
|
86 | 87 | import java.util.Arrays;
|
| 88 | +import java.util.Base64; |
87 | 89 | import java.util.Collections;
|
88 | 90 | import java.util.HashMap;
|
89 | 91 | import java.util.Iterator;
|
|
94 | 96 | import java.util.concurrent.TimeUnit;
|
95 | 97 |
|
96 | 98 | import static org.hamcrest.Matchers.contains;
|
97 |
| -import static org.hamcrest.Matchers.containsString; |
98 | 99 | import static org.hamcrest.Matchers.containsInAnyOrder;
|
| 100 | +import static org.hamcrest.Matchers.containsString; |
99 | 101 | import static org.hamcrest.Matchers.empty;
|
100 | 102 | import static org.hamcrest.Matchers.emptyIterable;
|
101 | 103 | import static org.hamcrest.Matchers.equalTo;
|
@@ -128,7 +130,8 @@ public void testPutUser() throws Exception {
|
128 | 130 | }
|
129 | 131 | {
|
130 | 132 | byte[] salt = new byte[32];
|
131 |
| - SecureRandom.getInstanceStrong().nextBytes(salt); |
| 133 | + // no need for secure random in a test; it could block and would not be reproducible anyway |
| 134 | + random().nextBytes(salt); |
132 | 135 | char[] password = new char[]{'p', 'a', 's', 's', 'w', 'o', 'r', 'd'};
|
133 | 136 | User user = new User("example2", Collections.singletonList("superuser"));
|
134 | 137 |
|
|
0 commit comments