Skip to content

Commit

Permalink
Rename files + test
Browse files Browse the repository at this point in the history
Signed-off-by: Derek Ho <dxho@amazon.com>
  • Loading branch information
derek-ho committed Oct 3, 2024
1 parent c0efd45 commit a7458bd
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void adminShouldNotBeAbleToDeleteSecurityIndex() {
}

@Test
public void adminShouldNotBeAbleToReadSecurityIndex() {
public void adminShouldNotBeAbleToReadSystemIndex() {
// Create system index and index a dummy document as the super admin user, data returned to super admin
try (TestRestClient client = cluster.getRestClient(cluster.getAdminCertificate())) {
HttpResponse response1 = client.put(".system-index1");
Expand Down
2 changes: 1 addition & 1 deletion src/integrationTest/resources/log4j2-test.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ logger.httpjwtauthenticator.name = com.amazon.dlic.auth.http.jwt.HTTPJwtAuthenti
logger.httpjwtauthenticator.level = debug
logger.httpjwtauthenticator.appenderRef.capturing.ref = logCapturingAppender

logger.securityflsdlsindexsearcherwrapper.name = org.opensearch.security.configuration.SecurityFlsDlsIndexSearcherWrapper
logger.securityflsdlsindexsearcherwrapper.name = org.opensearch.security.configuration.SystemFlsDlsIndexSearcherWrapper
logger.securityflsdlsindexsearcherwrapper.level = debug
logger.securityflsdlsindexsearcherwrapper.appenderRef.capturing.ref = logCapturingAppender

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@
import org.opensearch.security.configuration.DlsFlsValveImpl;
import org.opensearch.security.configuration.PrivilegesInterceptorImpl;
import org.opensearch.security.configuration.Salt;
import org.opensearch.security.configuration.SecurityFlsDlsIndexSearcherWrapper;
import org.opensearch.security.configuration.SystemFlsDlsIndexSearcherWrapper;
import org.opensearch.security.dlic.rest.api.Endpoint;
import org.opensearch.security.dlic.rest.api.SecurityRestApiActions;
import org.opensearch.security.dlic.rest.api.ssl.CertificatesActionType;
Expand Down Expand Up @@ -696,16 +696,7 @@ public void onIndexModule(IndexModule indexModule) {
indexModule.addIndexOperationListener(ciol);

indexModule.setReaderWrapper(
indexService -> new SecurityFlsDlsIndexSearcherWrapper(
indexService,
settings,
adminDns,
cs,
auditLog,
ciol,
evaluator,
salt
)
indexService -> new SystemFlsDlsIndexSearcherWrapper(indexService, settings, adminDns, cs, auditLog, ciol, evaluator, salt)
);
indexModule.forceQueryCacheProvider((indexSettings, nodeCache) -> new QueryCache() {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
import org.opensearch.security.support.HeaderHelper;
import org.opensearch.security.support.SecurityUtils;

public class SecurityFlsDlsIndexSearcherWrapper extends SecurityIndexSearcherWrapper {
public class SystemFlsDlsIndexSearcherWrapper extends SystemIndexSearcherWrapper {

public final Logger log = LogManager.getLogger(this.getClass());

Expand All @@ -56,7 +56,7 @@ public class SecurityFlsDlsIndexSearcherWrapper extends SecurityIndexSearcherWra
private final DlsQueryParser dlsQueryParser;
private final Salt salt;

public SecurityFlsDlsIndexSearcherWrapper(
public SystemFlsDlsIndexSearcherWrapper(
final IndexService indexService,
final Settings settings,
final AdminDNs adminDNs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@

import org.greenrobot.eventbus.Subscribe;

public class SecurityIndexSearcherWrapper implements CheckedFunction<DirectoryReader, DirectoryReader, IOException> {
public class SystemIndexSearcherWrapper implements CheckedFunction<DirectoryReader, DirectoryReader, IOException> {

protected final Logger log = LogManager.getLogger(this.getClass());
protected final ThreadContext threadContext;
Expand All @@ -69,7 +69,7 @@ public class SecurityIndexSearcherWrapper implements CheckedFunction<DirectoryRe
private final Boolean systemIndexPermissionEnabled;

// constructor is called per index, so avoid costly operations here
public SecurityIndexSearcherWrapper(
public SystemIndexSearcherWrapper(
final IndexService indexService,
final Settings settings,
final AdminDNs adminDNs,
Expand Down

0 comments on commit a7458bd

Please sign in to comment.