|
@@ -28,6 +28,7 @@ import org.elasticsearch.license.License.OperationMode;
|
|
import org.elasticsearch.license.TestUtils.UpdatableLicenseState;
|
|
import org.elasticsearch.license.TestUtils.UpdatableLicenseState;
|
|
import org.elasticsearch.license.XPackLicenseState;
|
|
import org.elasticsearch.license.XPackLicenseState;
|
|
import org.elasticsearch.test.ESTestCase;
|
|
import org.elasticsearch.test.ESTestCase;
|
|
|
|
+import org.elasticsearch.threadpool.ThreadPool;
|
|
import org.elasticsearch.transport.TransportRequest;
|
|
import org.elasticsearch.transport.TransportRequest;
|
|
import org.elasticsearch.transport.TransportRequest.Empty;
|
|
import org.elasticsearch.transport.TransportRequest.Empty;
|
|
import org.elasticsearch.xpack.core.XPackSettings;
|
|
import org.elasticsearch.xpack.core.XPackSettings;
|
|
@@ -152,7 +153,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("fls_dls"))).thenReturn(Collections.singleton(flsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("fls_dls"))).thenReturn(Collections.singleton(flsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("no_fls_dls"))).thenReturn(Collections.singleton(noFlsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("no_fls_dls"))).thenReturn(Collections.singleton(noFlsDlsRole));
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(Settings.EMPTY, fileRolesStore, nativeRolesStore,
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(Settings.EMPTY, fileRolesStore, nativeRolesStore,
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(),
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(),
|
|
new ThreadContext(Settings.EMPTY), licenseState, cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
new ThreadContext(Settings.EMPTY), licenseState, cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
@@ -228,7 +229,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("fls_dls"))).thenReturn(Collections.singleton(flsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("fls_dls"))).thenReturn(Collections.singleton(flsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("no_fls_dls"))).thenReturn(Collections.singleton(noFlsDlsRole));
|
|
when(fileRolesStore.roleDescriptors(Collections.singleton("no_fls_dls"))).thenReturn(Collections.singleton(noFlsDlsRole));
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(Settings.EMPTY, fileRolesStore, nativeRolesStore,
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(Settings.EMPTY, fileRolesStore, nativeRolesStore,
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(),
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(),
|
|
new ThreadContext(Settings.EMPTY), licenseState, cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
new ThreadContext(Settings.EMPTY), licenseState, cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
@@ -280,7 +281,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativePrivilegeStore).getPrivileges(isA(Set.class), isA(Set.class), any(ActionListener.class));
|
|
}).when(nativePrivilegeStore).getPrivileges(isA(Set.class), isA(Set.class), any(ActionListener.class));
|
|
|
|
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
nativePrivilegeStore, Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
nativePrivilegeStore, Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
@@ -343,7 +344,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
.put("xpack.security.authz.store.roles.negative_lookup_cache.max_size", 0)
|
|
.put("xpack.security.authz.store.roles.negative_lookup_cache.max_size", 0)
|
|
.build();
|
|
.build();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore = new CompositeRolesStore(settings, fileRolesStore, nativeRolesStore,
|
|
final CompositeRolesStore compositeRolesStore = new CompositeRolesStore(settings, fileRolesStore, nativeRolesStore,
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(settings),
|
|
reservedRolesStore, mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(settings),
|
|
new XPackLicenseState(settings), cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
new XPackLicenseState(settings), cache, mock(ApiKeyService.class), documentSubsetBitsetCache,
|
|
@@ -381,7 +382,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
@@ -421,6 +422,10 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
verifyNoMoreInteractions(fileRolesStore, reservedRolesStore, nativeRolesStore);
|
|
verifyNoMoreInteractions(fileRolesStore, reservedRolesStore, nativeRolesStore);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ private DocumentSubsetBitsetCache buildBitsetCache() {
|
|
|
|
+ return new DocumentSubsetBitsetCache(Settings.EMPTY, mock(ThreadPool.class));
|
|
|
|
+ }
|
|
|
|
+
|
|
public void testCustomRolesProviders() {
|
|
public void testCustomRolesProviders() {
|
|
final FileRolesStore fileRolesStore = mock(FileRolesStore.class);
|
|
final FileRolesStore fileRolesStore = mock(FileRolesStore.class);
|
|
doCallRealMethod().when(fileRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
doCallRealMethod().when(fileRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
@@ -467,7 +472,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}));
|
|
}));
|
|
|
|
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Arrays.asList(inMemoryProvider1, inMemoryProvider2),
|
|
mock(NativePrivilegeStore.class), Arrays.asList(inMemoryProvider1, inMemoryProvider2),
|
|
@@ -696,7 +701,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
(roles, listener) -> listener.onFailure(new Exception("fake failure"));
|
|
(roles, listener) -> listener.onFailure(new Exception("fake failure"));
|
|
|
|
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Arrays.asList(inMemoryProvider1, failingProvider),
|
|
mock(NativePrivilegeStore.class), Arrays.asList(inMemoryProvider1, failingProvider),
|
|
@@ -744,7 +749,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
// these licenses don't allow custom role providers
|
|
// these licenses don't allow custom role providers
|
|
xPackLicenseState.update(randomFrom(OperationMode.BASIC, OperationMode.GOLD, OperationMode.STANDARD), true, null);
|
|
xPackLicenseState.update(randomFrom(OperationMode.BASIC, OperationMode.GOLD, OperationMode.STANDARD), true, null);
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(
|
|
Settings.EMPTY, fileRolesStore, nativeRolesStore, reservedRolesStore, mock(NativePrivilegeStore.class),
|
|
Settings.EMPTY, fileRolesStore, nativeRolesStore, reservedRolesStore, mock(NativePrivilegeStore.class),
|
|
Arrays.asList(inMemoryProvider), new ThreadContext(Settings.EMPTY), xPackLicenseState, cache,
|
|
Arrays.asList(inMemoryProvider), new ThreadContext(Settings.EMPTY), xPackLicenseState, cache,
|
|
@@ -808,7 +813,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
doCallRealMethod().when(reservedRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
doCallRealMethod().when(reservedRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
NativeRolesStore nativeRolesStore = mock(NativeRolesStore.class);
|
|
NativeRolesStore nativeRolesStore = mock(NativeRolesStore.class);
|
|
doCallRealMethod().when(nativeRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
doCallRealMethod().when(nativeRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(
|
|
Settings.EMPTY, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
Settings.EMPTY, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(Settings.EMPTY),
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(Settings.EMPTY),
|
|
@@ -862,7 +867,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
doCallRealMethod().when(reservedRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
doCallRealMethod().when(reservedRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
NativeRolesStore nativeRolesStore = mock(NativeRolesStore.class);
|
|
NativeRolesStore nativeRolesStore = mock(NativeRolesStore.class);
|
|
doCallRealMethod().when(nativeRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
doCallRealMethod().when(nativeRolesStore).accept(any(Set.class), any(ActionListener.class));
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(SECURITY_ENABLED_SETTINGS,
|
|
CompositeRolesStore compositeRolesStore = new CompositeRolesStore(SECURITY_ENABLED_SETTINGS,
|
|
fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
@@ -894,7 +899,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(SECURITY_ENABLED_SETTINGS),
|
|
@@ -935,7 +940,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(settings, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(settings, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(settings),
|
|
mock(NativePrivilegeStore.class), Collections.emptyList(), new ThreadContext(settings),
|
|
@@ -963,7 +968,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
@@ -994,7 +999,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
}).when(nativeRolesStore).getRoleDescriptors(isA(Set.class), any(ActionListener.class));
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
@@ -1030,7 +1035,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
return Void.TYPE;
|
|
return Void.TYPE;
|
|
}).when(nativePrivStore).getPrivileges(any(Collection.class), any(Collection.class), any(ActionListener.class));
|
|
}).when(nativePrivStore).getPrivileges(any(Collection.class), any(Collection.class), any(ActionListener.class));
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
@@ -1076,7 +1081,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
return Void.TYPE;
|
|
return Void.TYPE;
|
|
}).when(nativePrivStore).getPrivileges(any(Collection.class), any(Collection.class), any(ActionListener.class));
|
|
}).when(nativePrivStore).getPrivileges(any(Collection.class), any(Collection.class), any(ActionListener.class));
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final AtomicReference<Collection<RoleDescriptor>> effectiveRoleDescriptors = new AtomicReference<Collection<RoleDescriptor>>();
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
@@ -1117,7 +1122,7 @@ public class CompositeRolesStoreTests extends ESTestCase {
|
|
}).when(nativeRolesStore).usageStats(any(ActionListener.class));
|
|
}).when(nativeRolesStore).usageStats(any(ActionListener.class));
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
final ReservedRolesStore reservedRolesStore = spy(new ReservedRolesStore());
|
|
|
|
|
|
- final DocumentSubsetBitsetCache documentSubsetBitsetCache = new DocumentSubsetBitsetCache(Settings.EMPTY);
|
|
|
|
|
|
+ final DocumentSubsetBitsetCache documentSubsetBitsetCache = buildBitsetCache();
|
|
|
|
|
|
final CompositeRolesStore compositeRolesStore =
|
|
final CompositeRolesStore compositeRolesStore =
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|
|
new CompositeRolesStore(SECURITY_ENABLED_SETTINGS, fileRolesStore, nativeRolesStore, reservedRolesStore,
|