57
57
import org .opensearch .security .dlic .rest .api .SecurityRestApiActions ;
58
58
import org .opensearch .security .filter .SecurityRestFilter ;
59
59
import org .opensearch .security .http .SecurityHttpServerTransport ;
60
+ import org .opensearch .security .rest .SecurityConfigUpdateAction ;
61
+ import org .opensearch .security .rest .SecurityWhoAmIAction ;
60
62
import org .opensearch .security .ssl .OpenSearchSecuritySSLPlugin ;
61
63
import org .opensearch .security .ssl .rest .SecuritySSLReloadCertsAction ;
62
64
import org .opensearch .security .ssl .rest .SecuritySSLCertsInfoAction ;
108
110
import org .opensearch .index .IndexModule ;
109
111
import org .opensearch .index .cache .query .QueryCache ;
110
112
import org .opensearch .index .shard .SearchOperationListener ;
113
+ import org .opensearch .indices .IndicesService ;
111
114
import org .opensearch .indices .SystemIndexDescriptor ;
112
115
import org .opensearch .indices .breaker .CircuitBreakerService ;
113
116
import org .opensearch .plugins .ClusterPlugin ;
@@ -459,7 +462,8 @@ public List<RestHandler> getRestHandlers(Settings settings, RestController restC
459
462
handlers .add (new DashboardsInfoAction (settings , restController , Objects .requireNonNull (evaluator ), Objects .requireNonNull (threadPool )));
460
463
handlers .add (new TenantInfoAction (settings , restController , Objects .requireNonNull (evaluator ), Objects .requireNonNull (threadPool ),
461
464
Objects .requireNonNull (cs ), Objects .requireNonNull (adminDns ), Objects .requireNonNull (cr )));
462
-
465
+ handlers .add (new SecurityConfigUpdateAction (settings , restController ,Objects .requireNonNull (threadPool ), adminDns , configPath , principalExtractor ));
466
+ handlers .add (new SecurityWhoAmIAction (settings ,restController ,Objects .requireNonNull (threadPool ), adminDns , configPath , principalExtractor ));
463
467
if (sslCertReloadEnabled ) {
464
468
handlers .add (new SecuritySSLReloadCertsAction (settings , restController , sks , Objects .requireNonNull (threadPool ), Objects .requireNonNull (adminDns )));
465
469
}
@@ -776,7 +780,7 @@ public Collection<Object> createComponents(Client localClient, ClusterService cl
776
780
auditLog = new NullAuditLog ();
777
781
privilegesInterceptor = new PrivilegesInterceptor (resolver , clusterService , localClient , threadPool );
778
782
} else {
779
- dlsFlsValve = new DlsFlsValveImpl ();
783
+ dlsFlsValve = new DlsFlsValveImpl (settings , localClient , clusterService , resolver , xContentRegistry , threadPool . getThreadContext () );
780
784
auditLog = new AuditLogImpl (settings , configPath , localClient , threadPool , resolver , clusterService , environment );
781
785
privilegesInterceptor = new PrivilegesInterceptorImpl (resolver , clusterService , localClient , threadPool );
782
786
}
@@ -795,10 +799,10 @@ public Collection<Object> createComponents(Client localClient, ClusterService cl
795
799
// DLS-FLS is enabled if not client and not disabled and not SSL only.
796
800
final boolean dlsFlsEnabled = !SSLConfig .isSslOnlyMode ();
797
801
evaluator = new PrivilegesEvaluator (clusterService , threadPool , cr , resolver , auditLog ,
798
- settings , privilegesInterceptor , cih , irr , dlsFlsEnabled );
799
-
800
- sf = new SecurityFilter (localClient , settings , evaluator , adminDns , dlsFlsValve , auditLog , threadPool , cs , compatConfig , irr , backendRegistry );
802
+ settings , privilegesInterceptor , cih , irr , dlsFlsEnabled , namedXContentRegistry );
801
803
804
+ sf = new SecurityFilter (localClient , settings , evaluator , adminDns , dlsFlsValve , auditLog , threadPool , cs , compatConfig , irr , backendRegistry , namedXContentRegistry );
805
+
802
806
final String principalExtractorClass = settings .get (SSLConfigConstants .SECURITY_SSL_TRANSPORT_PRINCIPAL_EXTRACTOR_CLASS , null );
803
807
804
808
if (principalExtractorClass == null ) {
@@ -1122,12 +1126,14 @@ public static class GuiceHolder implements LifecycleComponent {
1122
1126
1123
1127
private static RepositoriesService repositoriesService ;
1124
1128
private static RemoteClusterService remoteClusterService ;
1129
+ private static IndicesService indicesService ;
1125
1130
1126
1131
@ Inject
1127
1132
public GuiceHolder (final RepositoriesService repositoriesService ,
1128
- final TransportService remoteClusterService ) {
1133
+ final TransportService remoteClusterService , IndicesService indicesService ) {
1129
1134
GuiceHolder .repositoriesService = repositoriesService ;
1130
1135
GuiceHolder .remoteClusterService = remoteClusterService .getRemoteClusterService ();
1136
+ GuiceHolder .indicesService = indicesService ;
1131
1137
}
1132
1138
1133
1139
public static RepositoriesService getRepositoriesService () {
@@ -1138,6 +1144,10 @@ public static RemoteClusterService getRemoteClusterService() {
1138
1144
return remoteClusterService ;
1139
1145
}
1140
1146
1147
+ public static IndicesService getIndicesService () {
1148
+ return indicesService ;
1149
+ }
1150
+
1141
1151
@ Override
1142
1152
public void close () {
1143
1153
}
0 commit comments