Browse Source

minor fixes

iliax 1 year ago
parent
commit
4f27a39b68

+ 7 - 5
kafka-ui-api/src/main/java/com/provectus/kafka/ui/controller/GraphsController.java

@@ -64,12 +64,14 @@ public class GraphsController extends AbstractController implements GraphsApi {
   @Override
   public Mono<ResponseEntity<GraphDescriptionsDTO>> getGraphsList(String clusterName,
                                                                   ServerWebExchange exchange) {
+    var context = AccessContext.builder()
+        .cluster(clusterName)
+        .operationName("getGraphsList")
+        .build();
+
     var graphs = graphsService.getGraphs(getCluster(clusterName));
-    return Mono.just(
-        ResponseEntity.ok(
-            new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList())
-        )
-    );
+    return accessControlService.validateAccess(context).then(
+        Mono.just(ResponseEntity.ok(new GraphDescriptionsDTO().graphs(graphs.map(this::map).toList()))));
   }
 
   private GraphDescriptionDTO map(GraphDescription graph) {

+ 1 - 1
kafka-ui-api/src/main/java/com/provectus/kafka/ui/service/metrics/sink/MetricsSink.java

@@ -42,7 +42,7 @@ public interface MetricsSink {
     return compoundSink(sinks);
   }
 
-  static MetricsSink compoundSink(List<MetricsSink> sinks) {
+  private static MetricsSink compoundSink(List<MetricsSink> sinks) {
     return metricsStream -> {
       var materialized = metricsStream.toList();
       return Flux.fromIterable(sinks)