File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed
x-pack/plugin/security/src/main/java/org/elasticsearch/xpack/security/authz Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -485,10 +485,11 @@ private void authorizeAction(
485485 // The most common case is when a child action is authorized based on its parent, in that case we never need
486486 // to lookup indices, so we never need the project metadata.
487487 // But we do want to optimize by only looking up the project once for each action, so we use a cached supplier.
488- final Supplier <ProjectMetadata > projectMetadataSupplier = CachedSupplier .wrap (
489- () -> projectResolver .getProjectMetadata (clusterService .state ())
490- );
491- assert projectMetadataSupplier != null ;
488+ final Supplier <ProjectMetadata > projectMetadataSupplier = CachedSupplier .wrap (() -> {
489+ final ProjectMetadata projectMetadata = projectResolver .getProjectMetadata (clusterService .state ());
490+ assert projectMetadata != null ;
491+ return projectMetadata ;
492+ });
492493 final AsyncSupplier <ResolvedIndices > resolvedIndicesAsyncSupplier = new CachingAsyncSupplier <>(resolvedIndicesListener -> {
493494 if (request instanceof SearchRequest searchRequest && searchRequest .pointInTimeBuilder () != null ) {
494495 var resolvedIndices = indicesAndAliasesResolver .resolvePITIndices (searchRequest );
You can’t perform that action at this time.
0 commit comments