Compare commits
27 commits
rbac_class
...
master
Author | SHA1 | Date | |
---|---|---|---|
![]() |
83b5a60cc0 | ||
![]() |
3dc4446321 | ||
![]() |
53a6553765 | ||
![]() |
fc97dfa874 | ||
![]() |
68f08a0c9b | ||
![]() |
cc12814a95 | ||
![]() |
5d5358010b | ||
![]() |
de2f06ccf8 | ||
![]() |
ff106a2061 | ||
![]() |
c00cb320cd | ||
![]() |
8a1e9ad8e8 | ||
![]() |
39bb860f8e | ||
![]() |
f66d234d83 | ||
![]() |
68a7268f8b | ||
![]() |
aca3d25dc8 | ||
![]() |
0616883fee | ||
![]() |
59584ed369 | ||
![]() |
bbb739af92 | ||
![]() |
145bf07b5d | ||
![]() |
ceb821acdf | ||
![]() |
d2b0cc51e3 | ||
![]() |
9e7bc02c8a | ||
![]() |
2836b2f5d2 | ||
![]() |
a47848f809 | ||
![]() |
5c9fb994a4 | ||
![]() |
14efe9da1e | ||
![]() |
6676747606 |
14 changed files with 975 additions and 588 deletions
2
.github/workflows/cve.yaml
vendored
2
.github/workflows/cve.yaml
vendored
|
@ -55,7 +55,7 @@ jobs:
|
|||
cache-to: type=local,dest=/tmp/.buildx-cache
|
||||
|
||||
- name: Run CVE checks
|
||||
uses: aquasecurity/trivy-action@0.11.2
|
||||
uses: aquasecurity/trivy-action@0.12.0
|
||||
with:
|
||||
image-ref: "provectuslabs/kafka-ui:${{ steps.build.outputs.version }}"
|
||||
format: "table"
|
||||
|
|
|
@ -91,7 +91,7 @@ docker run -it -p 8080:8080 -e DYNAMIC_CONFIG_ENABLED=true provectuslabs/kafka-u
|
|||
|
||||
Then access the web UI at [http://localhost:8080](http://localhost:8080)
|
||||
|
||||
The command is sufficient to try things out. When you're done trying things out, you can proceed with a [persistent installation](https://docs.kafka-ui.provectus.io/configuration/quick-start#persistent-start)
|
||||
The command is sufficient to try things out. When you're done trying things out, you can proceed with a [persistent installation](https://docs.kafka-ui.provectus.io/quick-start/persistent-start)
|
||||
|
||||
## Persistent installation
|
||||
|
||||
|
|
|
@ -81,6 +81,12 @@
|
|||
<groupId>io.confluent</groupId>
|
||||
<artifactId>kafka-json-schema-serializer</artifactId>
|
||||
<version>${confluent.version}</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>commons-collections</groupId>
|
||||
<artifactId>commons-collections</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>io.confluent</groupId>
|
||||
|
@ -135,6 +141,11 @@
|
|||
<artifactId>commons-pool2</artifactId>
|
||||
<version>${apache.commons.version}</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.apache.commons</groupId>
|
||||
<artifactId>commons-collections4</artifactId>
|
||||
<version>4.4</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.testcontainers</groupId>
|
||||
<artifactId>testcontainers</artifactId>
|
||||
|
@ -238,8 +249,6 @@
|
|||
<groupId>org.springframework.security</groupId>
|
||||
<artifactId>spring-security-ldap</artifactId>
|
||||
</dependency>
|
||||
|
||||
|
||||
<dependency>
|
||||
<groupId>org.codehaus.groovy</groupId>
|
||||
<artifactId>groovy-jsr223</artifactId>
|
||||
|
@ -394,7 +403,7 @@
|
|||
<plugin>
|
||||
<groupId>pl.project13.maven</groupId>
|
||||
<artifactId>git-commit-id-plugin</artifactId>
|
||||
<version>4.0.0</version>
|
||||
<version>4.9.10</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>get-the-git-infos</id>
|
||||
|
|
|
@ -24,6 +24,7 @@ import com.provectus.kafka.ui.model.rbac.permission.AuditAction;
|
|||
import com.provectus.kafka.ui.model.rbac.permission.TopicAction;
|
||||
import com.provectus.kafka.ui.service.DeserializationService;
|
||||
import com.provectus.kafka.ui.service.MessagesService;
|
||||
import com.provectus.kafka.ui.util.DynamicConfigOperations;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Optional;
|
||||
|
@ -31,6 +32,7 @@ import javax.annotation.Nullable;
|
|||
import javax.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.apache.commons.lang3.tuple.Pair;
|
||||
import org.apache.kafka.common.TopicPartition;
|
||||
import org.springframework.http.ResponseEntity;
|
||||
|
@ -47,6 +49,7 @@ public class MessagesController extends AbstractController implements MessagesAp
|
|||
|
||||
private final MessagesService messagesService;
|
||||
private final DeserializationService deserializationService;
|
||||
private final DynamicConfigOperations dynamicConfigOperations;
|
||||
|
||||
@Override
|
||||
public Mono<ResponseEntity<Void>> deleteTopicMessages(
|
||||
|
@ -94,6 +97,10 @@ public class MessagesController extends AbstractController implements MessagesAp
|
|||
.topicActions(MESSAGES_READ)
|
||||
.operationName("getTopicMessages");
|
||||
|
||||
if (StringUtils.isNoneEmpty(q) && MessageFilterTypeDTO.GROOVY_SCRIPT == filterQueryType) {
|
||||
dynamicConfigOperations.checkIfFilteringGroovyEnabled();
|
||||
}
|
||||
|
||||
if (auditService.isAuditTopic(getCluster(clusterName), topicName)) {
|
||||
contextBuilder.auditActions(AuditAction.VIEW);
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ import javax.annotation.Nullable;
|
|||
import lombok.EqualsAndHashCode;
|
||||
import lombok.Getter;
|
||||
import lombok.ToString;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.springframework.util.Assert;
|
||||
|
||||
@Getter
|
||||
|
|
|
@ -8,7 +8,7 @@ import java.util.Objects;
|
|||
import java.util.function.Function;
|
||||
import java.util.stream.Stream;
|
||||
import javax.annotation.Nullable;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.opendatadiscovery.oddrn.JdbcUrlParser;
|
||||
import org.opendatadiscovery.oddrn.model.HivePath;
|
||||
import org.opendatadiscovery.oddrn.model.MysqlPath;
|
||||
|
|
|
@ -33,7 +33,7 @@ import java.util.stream.Collectors;
|
|||
import javax.annotation.Nullable;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.commons.collections.CollectionUtils;
|
||||
import org.apache.commons.collections4.CollectionUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.boot.context.properties.EnableConfigurationProperties;
|
||||
import org.springframework.core.env.Environment;
|
||||
|
|
|
@ -18,6 +18,10 @@ import lombok.RequiredArgsConstructor;
|
|||
@RequiredArgsConstructor(access = PRIVATE)
|
||||
public class ApplicationMetrics {
|
||||
|
||||
// kafka-ui specific metrics prefix. Added to make it easier to distinguish kui metrics from
|
||||
// other metrics, exposed by spring boot (like http stats, jvm, etc.)
|
||||
private static final String COMMON_PREFIX = "kui_";
|
||||
|
||||
private final String clusterName;
|
||||
private final MeterRegistry registry;
|
||||
|
||||
|
@ -40,7 +44,7 @@ public class ApplicationMetrics {
|
|||
}
|
||||
|
||||
private Counter polledRecords(String topic) {
|
||||
return Counter.builder("topic_records_polled")
|
||||
return Counter.builder(COMMON_PREFIX + "topic_records_polled")
|
||||
.description("Number of records polled from topic")
|
||||
.tag("cluster", clusterName)
|
||||
.tag("topic", topic)
|
||||
|
@ -48,7 +52,7 @@ public class ApplicationMetrics {
|
|||
}
|
||||
|
||||
private DistributionSummary polledBytes(String topic) {
|
||||
return DistributionSummary.builder("topic_polled_bytes")
|
||||
return DistributionSummary.builder(COMMON_PREFIX + "topic_polled_bytes")
|
||||
.description("Bytes polled from kafka topic")
|
||||
.tag("cluster", clusterName)
|
||||
.tag("topic", topic)
|
||||
|
@ -56,7 +60,7 @@ public class ApplicationMetrics {
|
|||
}
|
||||
|
||||
private Timer pollTimer(String topic) {
|
||||
return Timer.builder("topic_poll_time")
|
||||
return Timer.builder(COMMON_PREFIX + "topic_poll_time")
|
||||
.description("Time spend in polling for topic")
|
||||
.tag("cluster", clusterName)
|
||||
.tag("topic", topic)
|
||||
|
@ -64,7 +68,7 @@ public class ApplicationMetrics {
|
|||
}
|
||||
|
||||
private Counter pollThrottlingActivations() {
|
||||
return Counter.builder("poll_throttling_activations")
|
||||
return Counter.builder(COMMON_PREFIX + "poll_throttling_activations")
|
||||
.description("Number of poll throttling activations")
|
||||
.tag("cluster", clusterName)
|
||||
.register(registry);
|
||||
|
@ -72,7 +76,7 @@ public class ApplicationMetrics {
|
|||
|
||||
public AtomicInteger activeConsumers() {
|
||||
var count = new AtomicInteger();
|
||||
Gauge.builder("active_consumers", () -> count)
|
||||
Gauge.builder(COMMON_PREFIX + "active_consumers", () -> count)
|
||||
.description("Number of active consumers")
|
||||
.tag("cluster", clusterName)
|
||||
.register(registry);
|
||||
|
|
|
@ -45,6 +45,7 @@ import reactor.core.publisher.Mono;
|
|||
public class DynamicConfigOperations {
|
||||
|
||||
static final String DYNAMIC_CONFIG_ENABLED_ENV_PROPERTY = "dynamic.config.enabled";
|
||||
static final String FILTERING_GROOVY_ENABLED_PROPERTY = "filtering.groovy.enabled";
|
||||
static final String DYNAMIC_CONFIG_PATH_ENV_PROPERTY = "dynamic.config.path";
|
||||
static final String DYNAMIC_CONFIG_PATH_ENV_PROPERTY_DEFAULT = "/etc/kafkaui/dynamic_config.yaml";
|
||||
|
||||
|
@ -64,6 +65,10 @@ public class DynamicConfigOperations {
|
|||
return "true".equalsIgnoreCase(ctx.getEnvironment().getProperty(DYNAMIC_CONFIG_ENABLED_ENV_PROPERTY));
|
||||
}
|
||||
|
||||
public boolean filteringGroovyEnabled() {
|
||||
return "true".equalsIgnoreCase(ctx.getEnvironment().getProperty(FILTERING_GROOVY_ENABLED_PROPERTY));
|
||||
}
|
||||
|
||||
private Path dynamicConfigFilePath() {
|
||||
return Paths.get(
|
||||
Optional.ofNullable(ctx.getEnvironment().getProperty(DYNAMIC_CONFIG_PATH_ENV_PROPERTY))
|
||||
|
@ -147,6 +152,14 @@ public class DynamicConfigOperations {
|
|||
.onErrorMap(th -> new FileUploadException(targetFilePath, th));
|
||||
}
|
||||
|
||||
public void checkIfFilteringGroovyEnabled() {
|
||||
if (!filteringGroovyEnabled()) {
|
||||
throw new ValidationException(
|
||||
"Groovy filters is not allowed. "
|
||||
+ "Set filtering.groovy.enabled property to 'true' to enabled it.");
|
||||
}
|
||||
}
|
||||
|
||||
private void checkIfDynamicConfigEnabled() {
|
||||
if (!dynamicConfigEnabled()) {
|
||||
throw new ValidationException(
|
||||
|
|
|
@ -19,7 +19,7 @@
|
|||
<selenium.version>4.8.1</selenium.version>
|
||||
<selenide.version>6.12.3</selenide.version>
|
||||
<testng.version>7.7.1</testng.version>
|
||||
<allure.version>2.22.2</allure.version>
|
||||
<allure.version>2.23.0</allure.version>
|
||||
<qase.io.version>3.0.5</qase.io.version>
|
||||
<aspectj.version>1.9.9.1</aspectj.version>
|
||||
<assertj.version>3.24.2</assertj.version>
|
||||
|
|
|
@ -86,7 +86,7 @@
|
|||
"eslint": "^8.3.0",
|
||||
"eslint-config-airbnb": "^19.0.4",
|
||||
"eslint-config-airbnb-typescript": "^17.0.0",
|
||||
"eslint-config-prettier": "^8.5.0",
|
||||
"eslint-config-prettier": "^9.0.0",
|
||||
"eslint-import-resolver-node": "^0.3.6",
|
||||
"eslint-import-resolver-typescript": "^3.2.7",
|
||||
"eslint-plugin-import": "^2.26.0",
|
||||
|
|
1490
kafka-ui-react-app/pnpm-lock.yaml
generated
1490
kafka-ui-react-app/pnpm-lock.yaml
generated
File diff suppressed because it is too large
Load diff
|
@ -13,10 +13,10 @@ describe('dateTimeHelpers', () => {
|
|||
it('should output the correct date', () => {
|
||||
const date = new Date();
|
||||
expect(formatTimestamp(date)).toBe(
|
||||
date.toLocaleString([], { hour12: false })
|
||||
date.toLocaleString([], { hourCycle: 'h23' })
|
||||
);
|
||||
expect(formatTimestamp(date.getTime())).toBe(
|
||||
date.toLocaleString([], { hour12: false })
|
||||
date.toLocaleString([], { hourCycle: 'h23' })
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
6
pom.xml
6
pom.xml
|
@ -36,10 +36,10 @@
|
|||
<protobuf-java.version>3.23.3</protobuf-java.version>
|
||||
<scala-lang.library.version>2.13.9</scala-lang.library.version>
|
||||
<snakeyaml.version>2.0</snakeyaml.version>
|
||||
<spring-boot.version>3.1.1</spring-boot.version>
|
||||
<spring-boot.version>3.1.3</spring-boot.version>
|
||||
<kafka-ui-serde-api.version>1.0.0</kafka-ui-serde-api.version>
|
||||
<odd-oddrn-generator.version>0.1.17</odd-oddrn-generator.version>
|
||||
<odd-oddrn-client.version>0.1.23</odd-oddrn-client.version>
|
||||
<odd-oddrn-client.version>0.1.26</odd-oddrn-client.version>
|
||||
<org.json.version>20230227</org.json.version>
|
||||
|
||||
<!-- Test dependency versions -->
|
||||
|
@ -58,7 +58,7 @@
|
|||
<maven-clean-plugin.version>3.2.0</maven-clean-plugin.version>
|
||||
<maven-compiler-plugin.version>3.10.1</maven-compiler-plugin.version>
|
||||
<maven-resources-plugin.version>3.2.0</maven-resources-plugin.version>
|
||||
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version>
|
||||
<maven-surefire-plugin.version>3.1.2</maven-surefire-plugin.version>
|
||||
<openapi-generator-maven-plugin.version>6.6.0</openapi-generator-maven-plugin.version>
|
||||
<springdoc-openapi-webflux-ui.version>1.2.32</springdoc-openapi-webflux-ui.version>
|
||||
</properties>
|
||||
|
|
Loading…
Add table
Reference in a new issue