mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-03-25 09:28:27 +00:00
Cleanup construction of interceptors (#38294)
It would be beneficial to apply some of the request interceptors even when features are disabled. This change reworks the way we build that list so that the interceptors we always want to use are constructed outside of the settings check.
This commit is contained in:
parent
75f0750ff7
commit
0164acb0a7
@ -449,17 +449,17 @@ public class Security extends Plugin implements ActionPlugin, IngestPlugin, Netw
|
||||
securityInterceptor.set(new SecurityServerTransportInterceptor(settings, threadPool, authcService.get(),
|
||||
authzService, getLicenseState(), getSslService(), securityContext.get(), destructiveOperations, clusterService));
|
||||
|
||||
final Set<RequestInterceptor> requestInterceptors;
|
||||
Set<RequestInterceptor> requestInterceptors = Sets.newHashSet(
|
||||
new ResizeRequestInterceptor(threadPool, getLicenseState(), auditTrailService),
|
||||
new IndicesAliasesRequestInterceptor(threadPool.getThreadContext(), getLicenseState(), auditTrailService));
|
||||
if (XPackSettings.DLS_FLS_ENABLED.get(settings)) {
|
||||
requestInterceptors = Collections.unmodifiableSet(Sets.newHashSet(
|
||||
new SearchRequestInterceptor(threadPool, getLicenseState()),
|
||||
new UpdateRequestInterceptor(threadPool, getLicenseState()),
|
||||
new BulkShardRequestInterceptor(threadPool, getLicenseState()),
|
||||
new ResizeRequestInterceptor(threadPool, getLicenseState(), auditTrailService),
|
||||
new IndicesAliasesRequestInterceptor(threadPool.getThreadContext(), getLicenseState(), auditTrailService)));
|
||||
} else {
|
||||
requestInterceptors = Collections.emptySet();
|
||||
requestInterceptors.addAll(Arrays.asList(
|
||||
new SearchRequestInterceptor(threadPool, getLicenseState()),
|
||||
new UpdateRequestInterceptor(threadPool, getLicenseState()),
|
||||
new BulkShardRequestInterceptor(threadPool, getLicenseState())
|
||||
));
|
||||
}
|
||||
requestInterceptors = Collections.unmodifiableSet(requestInterceptors);
|
||||
|
||||
securityActionFilter.set(new SecurityActionFilter(authcService.get(), authzService, getLicenseState(),
|
||||
requestInterceptors, threadPool, securityContext.get(), destructiveOperations));
|
||||
|
Loading…
x
Reference in New Issue
Block a user