@@ -143,9 +143,9 @@ public boolean hasFieldOrDocumentLevelSecurity() {
143143
144144 private IsResourceAuthorizedPredicate buildIndexMatcherPredicateForAction (String action ) {
145145 final Set <String > dataAccessOrdinaryIndices = new HashSet <>();
146- final Set <String > failureAccessOrdinaryIndices = new HashSet <>();
146+ final Set <String > failuresAccessOrdinaryIndices = new HashSet <>();
147147 final Set <String > dataAccessRestrictedIndices = new HashSet <>();
148- final Set <String > failureAccessRestrictedIndices = new HashSet <>();
148+ final Set <String > failuresAccessRestrictedIndices = new HashSet <>();
149149 final Set <String > grantMappingUpdatesOnIndices = new HashSet <>();
150150 final Set <String > grantMappingUpdatesOnRestrictedIndices = new HashSet <>();
151151 final boolean isMappingUpdateAction = isMappingUpdateAction (action );
@@ -157,15 +157,15 @@ private IsResourceAuthorizedPredicate buildIndexMatcherPredicateForAction(String
157157 dataAccessRestrictedIndices .addAll (indexList );
158158 }
159159 if (group .checkSelector (IndexComponentSelector .FAILURES )) {
160- failureAccessRestrictedIndices .addAll (indexList );
160+ failuresAccessRestrictedIndices .addAll (indexList );
161161 }
162162 } else {
163163 List <String > indexList = Arrays .asList (group .indices ());
164164 if (group .checkSelector (IndexComponentSelector .DATA )) {
165165 dataAccessOrdinaryIndices .addAll (indexList );
166166 }
167167 if (group .checkSelector (IndexComponentSelector .FAILURES )) {
168- failureAccessOrdinaryIndices .addAll (indexList );
168+ failuresAccessOrdinaryIndices .addAll (indexList );
169169 }
170170 }
171171 } else if (isMappingUpdateAction && containsPrivilegeThatGrantsMappingUpdatesForBwc (group )) {
@@ -179,9 +179,9 @@ private IsResourceAuthorizedPredicate buildIndexMatcherPredicateForAction(String
179179 }
180180 }
181181 final StringMatcher dataAccessNameMatcher = indexMatcher (dataAccessOrdinaryIndices , dataAccessRestrictedIndices );
182- final StringMatcher failureAccessNameMatcher = indexMatcher (failureAccessOrdinaryIndices , failureAccessRestrictedIndices );
182+ final StringMatcher failuresAccessNameMatcher = indexMatcher (failuresAccessOrdinaryIndices , failuresAccessRestrictedIndices );
183183 final StringMatcher bwcSpecialCaseMatcher = indexMatcher (grantMappingUpdatesOnIndices , grantMappingUpdatesOnRestrictedIndices );
184- return new IsResourceAuthorizedPredicate (dataAccessNameMatcher , failureAccessNameMatcher , bwcSpecialCaseMatcher );
184+ return new IsResourceAuthorizedPredicate (dataAccessNameMatcher , failuresAccessNameMatcher , bwcSpecialCaseMatcher );
185185 }
186186
187187 /**
@@ -190,32 +190,32 @@ private IsResourceAuthorizedPredicate buildIndexMatcherPredicateForAction(String
190190 */
191191 public static class IsResourceAuthorizedPredicate {
192192
193- private final BiPredicate <String , IndexAbstraction > isAuthorizedForData ;
194- private final BiPredicate <String , IndexAbstraction > isAuthorizedForFailureStore ;
193+ private final BiPredicate <String , IndexAbstraction > isAuthorizedForDataAccess ;
194+ private final BiPredicate <String , IndexAbstraction > isAuthorizedForFailuresAccess ;
195195
196196 // public for tests
197197 public IsResourceAuthorizedPredicate (
198- StringMatcher resourceNameMatcher ,
199- StringMatcher failureStoreNameMatcher ,
198+ StringMatcher dataResourceNameMatcher ,
199+ StringMatcher failuresResourceNameMatcher ,
200200 StringMatcher additionalNonDatastreamNameMatcher
201201 ) {
202202 this ((String name , @ Nullable IndexAbstraction indexAbstraction ) -> {
203203 assert indexAbstraction == null || name .equals (indexAbstraction .getName ());
204- return resourceNameMatcher .test (name )
204+ return dataResourceNameMatcher .test (name )
205205 || (isPartOfDatastream (indexAbstraction ) == false && additionalNonDatastreamNameMatcher .test (name ));
206206 }, (String name , @ Nullable IndexAbstraction indexAbstraction ) -> {
207207 assert indexAbstraction == null || name .equals (indexAbstraction .getName ());
208208 // we can't enforce that the abstraction is part of a data stream since we need to account for non-existent resources
209- return failureStoreNameMatcher .test (name );
209+ return failuresResourceNameMatcher .test (name );
210210 });
211211 }
212212
213213 private IsResourceAuthorizedPredicate (
214- BiPredicate <String , IndexAbstraction > isAuthorizedForData ,
215- BiPredicate <String , IndexAbstraction > isAuthorizedForFailureStore
214+ BiPredicate <String , IndexAbstraction > isAuthorizedForDataAccess ,
215+ BiPredicate <String , IndexAbstraction > isAuthorizedForFailuresAccess
216216 ) {
217- this .isAuthorizedForData = isAuthorizedForData ;
218- this .isAuthorizedForFailureStore = isAuthorizedForFailureStore ;
217+ this .isAuthorizedForDataAccess = isAuthorizedForDataAccess ;
218+ this .isAuthorizedForFailuresAccess = isAuthorizedForFailuresAccess ;
219219 }
220220
221221 /**
@@ -225,14 +225,14 @@ private IsResourceAuthorizedPredicate(
225225 */
226226 public final IsResourceAuthorizedPredicate and (IsResourceAuthorizedPredicate other ) {
227227 return new IsResourceAuthorizedPredicate (
228- this .isAuthorizedForData .and (other .isAuthorizedForData ),
229- this .isAuthorizedForFailureStore .and (other .isAuthorizedForFailureStore )
228+ this .isAuthorizedForDataAccess .and (other .isAuthorizedForDataAccess ),
229+ this .isAuthorizedForFailuresAccess .and (other .isAuthorizedForFailuresAccess )
230230 );
231231 }
232232
233233 // TODO remove me (this has >700 usages in tests which would make for a horrible diff; will remove this once the main PR is merged)
234234 public boolean test (IndexAbstraction indexAbstraction ) {
235- return test (indexAbstraction .getName (), indexAbstraction , null );
235+ return test (indexAbstraction .getName (), indexAbstraction , IndexComponentSelector . DATA );
236236 }
237237
238238 /**
@@ -252,8 +252,8 @@ public boolean test(IndexAbstraction indexAbstraction, @Nullable IndexComponentS
252252 */
253253 public boolean test (String name , @ Nullable IndexAbstraction indexAbstraction , @ Nullable IndexComponentSelector selector ) {
254254 return IndexComponentSelector .FAILURES .equals (selector )
255- ? isAuthorizedForFailureStore .test (name , indexAbstraction )
256- : isAuthorizedForData .test (name , indexAbstraction );
255+ ? isAuthorizedForFailuresAccess .test (name , indexAbstraction )
256+ : isAuthorizedForDataAccess .test (name , indexAbstraction );
257257 }
258258
259259 private static boolean isPartOfDatastream (IndexAbstraction indexAbstraction ) {
0 commit comments