Skip to content

Commit 2931c85

Browse files
committed
Javadoc
1 parent fa467f4 commit 2931c85

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

plugins/examples/security-authorization-engine/src/main/java/org/elasticsearch/example/CustomAuthorizationEngine.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import org.elasticsearch.action.support.SubscribableListener;
1515
import org.elasticsearch.cluster.metadata.IndexAbstraction;
1616
import org.elasticsearch.cluster.metadata.ProjectMetadata;
17-
import org.elasticsearch.core.Nullable;
1817
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse;
1918
import org.elasticsearch.xpack.core.security.action.user.GetUserPrivilegesResponse.Indices;
2019
import org.elasticsearch.xpack.core.security.authc.Authentication;

server/src/main/java/org/elasticsearch/action/support/IndexComponentSelector.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,11 @@ public static IndexComponentSelector getByKey(String key) {
7272
return KEY_REGISTRY.get(key);
7373
}
7474

75+
/**
76+
* Like {@link #getByKey(String)} but throws an exception if the key is not recognised.
77+
* @return the selector if recognized. `null` input will return `DATA`.
78+
* @throws IllegalArgumentException if the key was not recognised.
79+
*/
7580
public static IndexComponentSelector getByKeyOrThrow(@Nullable String key) {
7681
if (key == null) {
7782
return DATA;

x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz/IndicesAndAliasesResolver.java

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -322,9 +322,8 @@ ResolvedIndices resolveIndicesAndAliases(
322322
);
323323
}
324324
if (indicesOptions.expandWildcardExpressions()) {
325-
for (String authorizedIndex : authorizedIndices.all(
326-
IndexComponentSelector.getByKeyOrThrow(allIndicesPatternSelector)
327-
)) {
325+
IndexComponentSelector selector = IndexComponentSelector.getByKeyOrThrow(allIndicesPatternSelector);
326+
for (String authorizedIndex : authorizedIndices.all(selector)) {
328327
if (IndexAbstractionResolver.isIndexVisible(
329328
"*",
330329
allIndicesPatternSelector,

0 commit comments

Comments
 (0)