diff --git a/api/pom.xml b/api/pom.xml
index 45ac363de..a5ecc6316 100644
--- a/api/pom.xml
+++ b/api/pom.xml
@@ -320,7 +320,7 @@
com/github/streamshub/console/api/support/TrustAllCertificateManager.class
- *QuarkusClassLoader
+
${project.build.directory}/jacoco-quarkus.exec
true
@@ -334,7 +334,7 @@
com/github/streamshub/console/api/support/TrustAllCertificateManager.class
- *QuarkusClassLoader
+
${project.build.directory}/jacoco-quarkus.exec
true
diff --git a/api/src/main/java/com/github/streamshub/console/api/security/ConsoleAuthenticationMechanism.java b/api/src/main/java/com/github/streamshub/console/api/security/ConsoleAuthenticationMechanism.java
index 5a8c3d409..a6217495e 100644
--- a/api/src/main/java/com/github/streamshub/console/api/security/ConsoleAuthenticationMechanism.java
+++ b/api/src/main/java/com/github/streamshub/console/api/security/ConsoleAuthenticationMechanism.java
@@ -340,7 +340,7 @@ private void addRoleChecker(KafkaContext ctx, QuarkusSecurityIdentity.Builder bu
Stream globalPermissions = getPermissions(globalSecurity, roleNames, "");
Stream clusterPermissions = clusterSecurity
- .map(cs -> getPermissions(cs, roleNames, "kafkas/" + ctx.clusterId() + '/'))
+ .map(cs -> getPermissions(cs, roleNames, "kafkas/" + ctx.clusterConfig().getName() + '/'))
.orElseGet(Stream::empty);
List possessedPermissions = Stream.concat(globalPermissions, clusterPermissions).toList();
diff --git a/api/src/main/java/com/github/streamshub/console/api/security/ConsolePermission.java b/api/src/main/java/com/github/streamshub/console/api/security/ConsolePermission.java
index f6d80c743..88257b7ee 100644
--- a/api/src/main/java/com/github/streamshub/console/api/security/ConsolePermission.java
+++ b/api/src/main/java/com/github/streamshub/console/api/security/ConsolePermission.java
@@ -36,19 +36,19 @@ public ConsolePermission(String resource, Collection resourceNames, Priv
}
private static Set checkActions(Privilege[] actions) {
- Set validActions = new HashSet<>(actions.length, 1);
- for (Privilege action : actions) {
- validActions.add(validateAndTrim(action, "Action"));
+ Objects.requireNonNull(actions);
+
+ if (actions.length == 0) {
+ throw new IllegalArgumentException("actions must not be zero length");
}
- return Collections.unmodifiableSet(validActions);
- }
- private static Privilege validateAndTrim(Privilege action, String paramName) {
- if (action == null) {
- throw new IllegalArgumentException(String.format("%s must not be null", paramName));
+ Set validActions = new HashSet<>(actions.length, 1);
+
+ for (Privilege action : actions) {
+ validActions.add(Objects.requireNonNull(action));
}
- return action;
+ return Collections.unmodifiableSet(validActions);
}
public ConsolePermission resourceName(String resourceName) {
@@ -74,18 +74,6 @@ boolean implies(ConsolePermission requiredPermission) {
return false;
}
- // actions are optional, however if at least one action was specified,
- // an intersection of compared sets must not be empty
- if (requiredPermission.actions.isEmpty()) {
- // no required actions
- return true;
- }
-
- if (actions.isEmpty()) {
- // no possessed actions
- return false;
- }
-
if (actions.contains(Privilege.ALL)) {
// all actions possessed
return true;
diff --git a/api/src/main/java/com/github/streamshub/console/api/service/TopicDescribeService.java b/api/src/main/java/com/github/streamshub/console/api/service/TopicDescribeService.java
index c18573212..966355a8b 100644
--- a/api/src/main/java/com/github/streamshub/console/api/service/TopicDescribeService.java
+++ b/api/src/main/java/com/github/streamshub/console/api/service/TopicDescribeService.java
@@ -284,7 +284,7 @@ private CompletableFuture maybeFetchConsumerGroups(Map topics
return consumerGroupService
.listConsumerGroupMembership(searchTopics)
- .thenAccept(consumerGroups -> {
+ .thenAccept(consumerGroups ->
topics.forEach((topicId, topic) -> {
String idString = topicId.toString();
@@ -294,8 +294,8 @@ private CompletableFuture maybeFetchConsumerGroups(Map topics
topic.consumerGroups().data().addAll(identifiers);
topic.consumerGroups().addMeta("count", identifiers.size());
}
- });
- }).toCompletableFuture();
+ }))
+ .toCompletableFuture();
}
/* package */ CompletionStage