Skip to content

Commit

Permalink
Fixes CI errors
Browse files Browse the repository at this point in the history
Signed-off-by: Darshit Chanpura <[email protected]>
  • Loading branch information
DarshitChanpura committed Jan 10, 2025
1 parent 5e5c243 commit 289659f
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,7 @@ public Collection<Object> createComponents(
components.add(dcf);
components.add(userService);
components.add(passwordHasher);
components.add(resourceAccessHandler);

components.add(sslSettingsManager);
if (isSslCertReloadEnabled(settings) && sslCertificatesHotReloadEnabled(settings)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,12 @@
import org.opensearch.security.privileges.DocumentAllowList;
import org.opensearch.security.privileges.PrivilegesEvaluationContext;
import org.opensearch.security.privileges.PrivilegesEvaluationException;
import org.opensearch.security.privileges.dlsfls.*;
import org.opensearch.security.privileges.dlsfls.DlsFlsBaseContext;
import org.opensearch.security.privileges.dlsfls.DlsFlsLegacyHeaders;
import org.opensearch.security.privileges.dlsfls.DlsFlsProcessedConfig;
import org.opensearch.security.privileges.dlsfls.DlsRestriction;
import org.opensearch.security.privileges.dlsfls.FieldMasking;
import org.opensearch.security.privileges.dlsfls.IndexToRuleMap;
import org.opensearch.security.resolver.IndexResolverReplacer;
import org.opensearch.security.resources.ResourceAccessHandler;
import org.opensearch.security.securityconf.DynamicConfigFactory;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,11 @@
package org.opensearch.security.resources;

import java.io.IOException;
import java.util.*;
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map;
import java.util.Set;

import com.fasterxml.jackson.core.JsonProcessingException;
import org.apache.logging.log4j.LogManager;
Expand All @@ -21,7 +25,11 @@

import org.opensearch.common.util.concurrent.ThreadContext;
import org.opensearch.core.xcontent.NamedXContentRegistry;
import org.opensearch.index.query.*;
import org.opensearch.index.query.BoolQueryBuilder;
import org.opensearch.index.query.ConstantScoreQueryBuilder;
import org.opensearch.index.query.QueryBuilder;
import org.opensearch.index.query.QueryBuilders;
import org.opensearch.index.query.QueryShardContext;
import org.opensearch.security.DefaultObjectMapper;
import org.opensearch.security.OpenSearchSecurityPlugin;
import org.opensearch.security.configuration.AdminDNs;
Expand Down Expand Up @@ -51,7 +59,6 @@ public ResourceAccessHandler(
final ResourceSharingIndexHandler resourceSharingIndexHandler,
AdminDNs adminDns
) {
super();
this.threadContext = threadPool.getThreadContext();
this.resourceSharingIndexHandler = resourceSharingIndexHandler;
this.adminDNs = adminDns;
Expand Down Expand Up @@ -380,6 +387,14 @@ public Query createResourceDLSQuery(Set<String> resourceIds, QueryShardContext q
return builder.toQuery(queryShardContext);
}

/**
* Creates a DLS restriction for the given resource IDs.
* @param resourceIds The resource IDs to create the restriction for.
* @param xContentRegistry The named XContent registry.
* @return The DLS restriction.
* @throws JsonProcessingException If an error occurs while processing JSON.
* @throws PrivilegesConfigurationValidationException If the privileges configuration is invalid.
*/
public DlsRestriction createResourceDLSRestriction(Set<String> resourceIds, NamedXContentRegistry xContentRegistry)
throws JsonProcessingException, PrivilegesConfigurationValidationException {
String jsonQuery = String.format(
Expand Down

0 comments on commit 289659f

Please sign in to comment.