Compare commits

...
Sign in to create a new pull request.

27 commits

Author SHA1 Message Date
Vladysl
83b5a60cc0
added commons-collections4 library instead of commons-collections (#4427)
Co-authored-by: Narekmat <47845266+Narekmat@users.noreply.github.com>
2024-04-08 18:46:54 +00:00
Vladysl
3dc4446321
added env variable filtering.groovy.enabled which allows to enable/disable groovy script executions (#4426) 2024-04-08 22:30:38 +04:00
dependabot[bot]
53a6553765
Bump vite-tsconfig-paths from 4.2.0 to 4.2.1 in /kafka-ui-react-app (#4215)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 14:17:40 +04:00
dependabot[bot]
fc97dfa874
Bump react-router-dom from 6.3.0 to 6.15.0 in /kafka-ui-react-app (#4217)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-13 14:17:26 +04:00
Edward Muller
68f08a0c9b
Bump Spring Boot (#4227) 2023-09-13 14:08:13 +04:00
dependabot[bot]
cc12814a95
Bump @typescript-eslint/parser from 5.29.0 to 5.62.0 in /kafka-ui-react-app (#4214)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 18:23:14 +04:00
dependabot[bot]
5d5358010b
Bump @testing-library/dom from 9.0.0 to 9.3.1 in /kafka-ui-react-app (#4216)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 18:23:05 +04:00
dependabot[bot]
de2f06ccf8
Bump react-hot-toast from 2.4.0 to 2.4.1 in /kafka-ui-react-app (#4218)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 18:22:49 +04:00
dependabot[bot]
ff106a2061
Bump @openapitools/openapi-generator-cli from 2.5.2 to 2.7.0 in /kafka-ui-react-app (#4219)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 18:22:37 +04:00
dependabot[bot]
c00cb320cd
Bump @types/lossless-json from 1.0.1 to 1.0.2 in /kafka-ui-react-app (#4220)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-12 18:22:23 +04:00
Victoria Miltcheva
8a1e9ad8e8
Docs: Fix persistent installation link in README (#4207) 2023-09-07 22:26:16 +04:00
dependabot[bot]
39bb860f8e
Bump allure.version from 2.22.2 to 2.23.0 (#4039)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:45:09 +04:00
dependabot[bot]
f66d234d83
Bump git-commit-id-plugin from 4.0.0 to 4.9.10 (#4028)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:44:51 +04:00
dependabot[bot]
68a7268f8b
Bump maven-surefire-plugin from 2.22.2 to 3.1.2 (#4026)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:44:34 +04:00
dependabot[bot]
aca3d25dc8
Bump ingestion-contract-client from 0.1.23 to 0.1.26 (#4047)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:43:45 +04:00
dependabot[bot]
0616883fee
Bump eslint from 8.16.0 to 8.48.0 in /kafka-ui-react-app (#4184)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-06 14:33:49 +04:00
Ilya Kuramshin
59584ed369
BE: Add a common prefix for all app metrics (#4177)
Co-authored-by: iliax <ikuramshin@provectus.com>
2023-09-05 18:03:09 +04:00
Mihai Alexandru Agache
bbb739af92
FE: Fix dateTimeHelpers.spec.ts linter error (#4090)
Co-authored-by: Roman Zabaluev <rzabaluev@provectus.com>
2023-09-05 18:01:45 +04:00
dependabot[bot]
145bf07b5d
Bump jest-environment-jsdom from 29.5.0 to 29.6.4 in /kafka-ui-react-app (#4183)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 17:42:55 +04:00
dependabot[bot]
ceb821acdf
Bump sass from 1.52.3 to 1.66.1 in /kafka-ui-react-app (#4185)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 17:42:46 +04:00
dependabot[bot]
d2b0cc51e3
Bump json-schema-faker from 0.5.0-rcv.44 to 0.5.3 in /kafka-ui-react-app (#4189)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 17:42:35 +04:00
dependabot[bot]
9e7bc02c8a
Bump eslint-plugin-jsx-a11y from 6.5.1 to 6.7.1 in /kafka-ui-react-app (#4159)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:33:07 +04:00
dependabot[bot]
2836b2f5d2
Bump eslint-config-prettier from 8.5.0 to 9.0.0 in /kafka-ui-react-app (#4182)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:32:37 +04:00
dependabot[bot]
a47848f809
Bump vite-tsconfig-paths from 4.0.2 to 4.2.0 in /kafka-ui-react-app (#4186)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:31:50 +04:00
dependabot[bot]
5c9fb994a4
Bump react and @types/react in /kafka-ui-react-app (#4187)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:31:27 +04:00
dependabot[bot]
14efe9da1e
Bump @jest/types from 29.5.0 to 29.6.3 in /kafka-ui-react-app (#4188)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:31:09 +04:00
dependabot[bot]
6676747606
Bump aquasecurity/trivy-action from 0.11.2 to 0.12.0 (#4190)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-09-05 13:30:50 +04:00
14 changed files with 975 additions and 588 deletions

View file

@ -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"

View file

@ -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

View file

@ -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>

View file

@ -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);
}

View file

@ -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

View file

@ -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;

View file

@ -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;

View file

@ -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);

View file

@ -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(

View file

@ -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>

View file

@ -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",

File diff suppressed because it is too large Load diff

View file

@ -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' })
);
});
});

View file

@ -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>