Skip to content

Commit 25ea921

Browse files
Removes .keyword from search all_shared_principals as plugins should handle mapping update
Signed-off-by: Darshit Chanpura <dchanp@amazon.com>
1 parent 2f67462 commit 25ea921

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/main/java/org/opensearch/security/resources/ResourceSharingIndexHandler.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -375,12 +375,12 @@ public void fetchAccessibleResourceIds(String resourceIndex, Set<String> entitie
375375

376376
// We match any doc whose "principals" contains at least one of the entities
377377
// e.g., "user:alice", "role:admin", "backend:ops"
378-
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery()
379-
.filter(QueryBuilders.termsQuery("all_shared_principals.keyword", entities));
378+
BoolQueryBuilder boolQuery = QueryBuilders.boolQuery().filter(QueryBuilders.termsQuery("all_shared_principals", entities));
379+
LOGGER.debug("Fetching accessible resource ids query {}", boolQuery);
380380

381381
executeIdCollectingSearchRequest(scroll, searchRequest, boolQuery, ActionListener.wrap(resourceIds -> {
382382
ctx.restore();
383-
LOGGER.debug("Found {} accessible resources in {}", resourceIds.size(), resourceIndex);
383+
LOGGER.debug("Found {} accessible resources in {} for entities {}", resourceIds.size(), resourceIndex, entities);
384384
listener.onResponse(resourceIds);
385385
}, exception -> {
386386
if (exception instanceof IndexNotFoundException) {

0 commit comments

Comments
 (0)