Skip to content

Commit

Permalink
Merge branch 'main' into feature/synthtic-source-recovery-default
Browse files Browse the repository at this point in the history
  • Loading branch information
salvatore-campagna authored Jan 14, 2025
2 parents e999fa9 + 2fe55db commit 4fb4a07
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
2 changes: 2 additions & 0 deletions muted-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,8 @@ tests:
issue: https://github.com/elastic/elasticsearch/issues/118406
- class: org.elasticsearch.xpack.ml.integration.DatafeedJobsIT
issue: https://github.com/elastic/elasticsearch/issues/120088
- class: org.elasticsearch.xpack.searchablesnapshots.minio.MinioSearchableSnapshotsIT
issue: https://github.com/elastic/elasticsearch/issues/120101

# Examples:
#
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import org.elasticsearch.common.io.stream.StreamOutput;
import org.elasticsearch.common.regex.Regex;
import org.elasticsearch.common.util.CollectionUtils;
import org.elasticsearch.lucene.util.automaton.MinimizationOperations;
import org.elasticsearch.plugins.FieldPredicate;
import org.elasticsearch.xpack.core.security.authz.accesscontrol.FieldSubsetReader;
import org.elasticsearch.xpack.core.security.authz.permission.FieldPermissionsDefinition.FieldGrantExcludeGroup;
Expand Down Expand Up @@ -172,12 +173,8 @@ public static Automaton buildPermittedFieldsAutomaton(final String[] grantedFiel
deniedFieldsAutomaton = Automatons.patterns(deniedFields);
}

grantedFieldsAutomaton = Operations.removeDeadStates(
Operations.determinize(grantedFieldsAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT)
);
deniedFieldsAutomaton = Operations.removeDeadStates(
Operations.determinize(deniedFieldsAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT)
);
grantedFieldsAutomaton = MinimizationOperations.minimize(grantedFieldsAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT);
deniedFieldsAutomaton = MinimizationOperations.minimize(deniedFieldsAutomaton, Operations.DEFAULT_DETERMINIZE_WORK_LIMIT);

if (Automatons.subsetOf(deniedFieldsAutomaton, grantedFieldsAutomaton) == false) {
throw new ElasticsearchSecurityException(
Expand Down

0 comments on commit 4fb4a07

Please sign in to comment.