Skip to content

Commit d9c601e

Browse files
authored
Merge branch 'main' into feature/user-polling-options
2 parents 9407cdb + 49894b8 commit d9c601e

File tree

133 files changed

+1496
-830
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

133 files changed

+1496
-830
lines changed

.dev/dev_arm64.yaml renamed to .dev/dev.yaml

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
# This is a compose file designed for arm64/Apple Silicon systems
2-
# To adapt this to x86 please find and replace ".arm64" with empty
3-
4-
# ARM64 supported images for kafka can be found here
5-
# https://hub.docker.com/r/confluentinc/cp-kafka/tags?page=1&name=arm64
6-
---
71
version: '3.8'
82
name: "kafbat-ui-dev"
93

@@ -32,8 +26,7 @@ services:
3226
KAFKA_CLUSTERS_0_AUDIT_CONSOLEAUDITENABLED: 'true'
3327

3428
kafka0:
35-
image: confluentinc/cp-kafka:7.8.0.arm64
36-
user: "0:0"
29+
image: confluentinc/cp-kafka:7.8.0
3730
hostname: kafka0
3831
container_name: kafka0
3932
ports:
@@ -60,7 +53,7 @@ services:
6053
CLUSTER_ID: 'MkU3OEVBNTcwNTJENDM2Qk'
6154

6255
schema-registry0:
63-
image: confluentinc/cp-schema-registry:7.8.0.arm64
56+
image: confluentinc/cp-schema-registry:7.8.0
6457
ports:
6558
- 8085:8085
6659
depends_on:
@@ -76,7 +69,7 @@ services:
7669
SCHEMA_REGISTRY_KAFKASTORE_TOPIC: _schemas
7770

7871
kafka-connect0:
79-
image: confluentinc/cp-kafka-connect:7.8.0.arm64
72+
image: confluentinc/cp-kafka-connect:7.8.0
8073
ports:
8174
- 8083:8083
8275
depends_on:
@@ -101,7 +94,7 @@ services:
10194
CONNECT_PLUGIN_PATH: "/usr/share/java,/usr/share/confluent-hub-components,/usr/local/share/kafka/plugins,/usr/share/filestream-connectors"
10295

10396
ksqldb0:
104-
image: confluentinc/cp-ksqldb-server:7.8.0.arm64
97+
image: confluentinc/cp-ksqldb-server:7.8.0
10598
depends_on:
10699
- kafka0
107100
- kafka-connect0
@@ -119,7 +112,7 @@ services:
119112
KSQL_CACHE_MAX_BYTES_BUFFERING: 0
120113

121114
kafka-init-topics:
122-
image: confluentinc/cp-kafka:7.8.0.arm64
115+
image: confluentinc/cp-kafka:7.8.0
123116
volumes:
124117
- ../documentation/compose/data/message.json:/data/message.json
125118
depends_on:

.github/FUNDING.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
github: [kafbat]
2+
open_collective: kafka-ui

.github/workflows/cve_checks.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Infra: CVE checks"
22
on:
3+
pull_request:
4+
types: [ "opened", "reopened", "synchronize" ]
5+
push:
6+
branches: [ "main" ]
37
workflow_dispatch:
48
schedule:
59
# * is a special character in YAML so you have to quote this string
@@ -71,7 +75,7 @@ jobs:
7175

7276
notify:
7377
needs: check-cves
74-
if: ${{ always() && needs.build-and-test.result == 'failure' }}
78+
if: ${{ always() && needs.build-and-test.result == 'failure' && github.event_name == 'schedule' }}
7579
uses: ./.github/workflows/infra_discord_hook.yml
7680
with:
7781
message: "Attention! CVE checks run failed! Please fix them CVEs :("

.github/workflows/docker_publish.yml

Lines changed: 16 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ jobs:
2020
strategy:
2121
fail-fast: false
2222
matrix:
23-
registry: [ 'docker.io', 'ghcr.io', 'ecr' ]
23+
registry: [ 'docker.io', 'ghcr.io', 'public.ecr.aws' ]
2424

2525
runs-on: ubuntu-latest
2626
steps:
@@ -31,7 +31,8 @@ jobs:
3131
name: image
3232
path: /tmp
3333

34-
# setup containerd to preserve provenance attestations :https://docs.docker.com/build/attestations/#creating-attestations
34+
# setup containerd to preserve provenance attestations:
35+
# https://docs.docker.com/build/attestations/#creating-attestations
3536
- name: Setup docker with containerd
3637
uses: crazy-max/ghaction-setup-docker@v3
3738
with:
@@ -63,33 +64,33 @@ jobs:
6364
password: ${{ secrets.GITHUB_TOKEN }}
6465

6566
- name: Configure AWS credentials
66-
if: matrix.registry == 'ecr'
67+
if: matrix.registry == 'public.ecr.aws'
6768
uses: aws-actions/configure-aws-credentials@v4
6869
with:
6970
aws-region: us-east-1 # This region only for public ECR
7071
role-to-assume: ${{ secrets.AWS_ROLE }}
7172

7273
- name: Login to public ECR
73-
if: matrix.registry == 'ecr'
74+
if: matrix.registry == 'public.ecr.aws'
7475
id: login-ecr-public
7576
uses: aws-actions/amazon-ecr-login@v2
7677
with:
7778
registry-type: public
7879

79-
- name: define env vars
80+
- name: Define env vars for container registry URL
8081
run: |
81-
if [ ${{matrix.registry }} == 'docker.io' ]; then
82-
echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
83-
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
84-
elif [ ${{ matrix.registry }} == 'ghcr.io' ]; then
85-
echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
86-
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
87-
elif [ ${{ matrix.registry }} == 'ecr' ]; then
82+
if [ ${{ matrix.registry }} == 'public.ecr.aws' ]; then
83+
# vars.ECR_REGISTRY value is expected to be of the `public.ecr.aws/<public_ecr_id>` form
84+
# The `public_ecr_id` must be a *default* alias associated with public regsitry (rather
85+
# than a custom alias)
8886
echo "REGISTRY=${{ vars.ECR_REGISTRY }}" >> $GITHUB_ENV
87+
# Trim GH Org name so that resulting Public ECR URL has no duplicate org name
88+
# Public ECR default alias: public.ecr.aws/<public_ecr_id>/kafka-ui
89+
# Public ECR custom alias: public.ecr.aws/kafbat/kafka-ui
90+
echo "REPOSITORY=$(basename ${{ github.repository }})" >> $GITHUB_ENV
91+
else # this covers the case of docker.io and ghcr.io
92+
echo "REGISTRY=${{ matrix.registry }}" >> $GITHUB_ENV
8993
echo "REPOSITORY=${{ github.repository }}" >> $GITHUB_ENV
90-
else
91-
echo "REGISTRY=" >> $GITHUB_ENV
92-
echo "REPOSITORY=notworking" >> $GITHUB_ENV
9394
fi
9495
9596
- name: Push images to ${{ matrix.registry }}

.github/workflows/frontend_tests.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@ jobs:
2323

2424
- uses: pnpm/[email protected]
2525
with:
26-
version: 9.15.0
26+
version: 9.15.4
2727

2828
- name: Install node
2929
uses: actions/[email protected]
3030
with:
31-
node-version: "18.17.1"
31+
node-version: "22.12.0"
3232
cache: "pnpm"
3333
cache-dependency-path: "./frontend/pnpm-lock.yaml"
3434

.mvn/jvm.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
-Djava.net.useSystemProxies=true

api/pom.xml

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,19 @@
212212
<version>${okhttp3.mockwebserver.version}</version>
213213
<scope>test</scope>
214214
</dependency>
215+
<dependency>
216+
<groupId>org.apache.kafka</groupId>
217+
<artifactId>kafka-clients</artifactId>
218+
<version>${confluent.version}-ccs</version>
219+
<classifier>test</classifier>
220+
<scope>test</scope>
221+
</dependency>
222+
<dependency>
223+
<groupId>org.bouncycastle</groupId>
224+
<artifactId>bcpkix-jdk18on</artifactId>
225+
<version>1.80</version>
226+
<scope>test</scope>
227+
</dependency>
215228

216229
<dependency>
217230
<groupId>org.springframework.boot</groupId>
@@ -329,7 +342,7 @@
329342
<groupId>org.apache.maven.plugins</groupId>
330343
<artifactId>maven-surefire-plugin</artifactId>
331344
<configuration>
332-
<argLine>@{argLine} --illegal-access=permit</argLine>
345+
<argLine>@{argLine}</argLine>
333346
</configuration>
334347
</plugin>
335348
<plugin>
@@ -492,6 +505,7 @@
492505
</goals>
493506
<configuration>
494507
<arguments>build</arguments>
508+
<pnpmInheritsProxyConfigFromMaven>false</pnpmInheritsProxyConfigFromMaven>
495509
</configuration>
496510
</execution>
497511
</executions>

api/src/main/java/io/kafbat/ui/client/RetryingKafkaConnectClient.java

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
import io.kafbat.ui.connect.model.ConnectorTopics;
1313
import io.kafbat.ui.connect.model.NewConnector;
1414
import io.kafbat.ui.connect.model.TaskStatus;
15-
import io.kafbat.ui.exception.KafkaConnectConflictReponseException;
15+
import io.kafbat.ui.exception.KafkaConnectConflictResponseException;
1616
import io.kafbat.ui.exception.ValidationException;
1717
import io.kafbat.ui.util.WebClientConfigurator;
1818
import jakarta.validation.constraints.NotNull;
@@ -48,7 +48,7 @@ private static Retry conflictCodeRetry() {
4848
.fixedDelay(MAX_RETRIES, RETRIES_DELAY)
4949
.filter(e -> e instanceof WebClientResponseException.Conflict)
5050
.onRetryExhaustedThrow((spec, signal) ->
51-
new KafkaConnectConflictReponseException(
51+
new KafkaConnectConflictResponseException(
5252
(WebClientResponseException.Conflict) signal.failure()));
5353
}
5454

@@ -238,6 +238,16 @@ public Mono<ResponseEntity<Void>> pauseConnectorWithHttpInfo(String connectorNam
238238
return withRetryOnConflictOrRebalance(super.pauseConnectorWithHttpInfo(connectorName));
239239
}
240240

241+
@Override
242+
public Mono<Void> stopConnector(String connectorName) throws WebClientResponseException {
243+
return withRetryOnConflictOrRebalance(super.stopConnector(connectorName));
244+
}
245+
246+
@Override
247+
public Mono<ResponseEntity<Void>> stopConnectorWithHttpInfo(String connectorName) throws WebClientResponseException {
248+
return withRetryOnConflictOrRebalance(super.stopConnectorWithHttpInfo(connectorName));
249+
}
250+
241251
@Override
242252
public Mono<Void> restartConnector(String connectorName, Boolean includeTasks, Boolean onlyFailed)
243253
throws WebClientResponseException {
@@ -261,6 +271,18 @@ public Mono<ResponseEntity<Void>> restartConnectorTaskWithHttpInfo(String connec
261271
return withRetryOnConflictOrRebalance(super.restartConnectorTaskWithHttpInfo(connectorName, taskId));
262272
}
263273

274+
@Override
275+
public Mono<Void> resetConnectorOffsets(String connectorName)
276+
throws WebClientResponseException {
277+
return withRetryOnConflictOrRebalance(super.resetConnectorOffsets(connectorName));
278+
}
279+
280+
@Override
281+
public Mono<ResponseEntity<Void>> resetConnectorOffsetsWithHttpInfo(String connectorName)
282+
throws WebClientResponseException {
283+
return withRetryOnConflictOrRebalance(super.resetConnectorOffsetsWithHttpInfo(connectorName));
284+
}
285+
264286
@Override
265287
public Mono<Void> resumeConnector(String connectorName) throws WebClientResponseException {
266288
return withRetryOnRebalance(super.resumeConnector(connectorName));

api/src/main/java/io/kafbat/ui/config/auth/BasicAuthSecurityConfig.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package io.kafbat.ui.config.auth;
22

3-
import io.kafbat.ui.util.EmptyRedirectStrategy;
43
import io.kafbat.ui.util.StaticFileWebFilter;
5-
import java.net.URI;
64
import lombok.extern.slf4j.Slf4j;
75
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
86
import org.springframework.context.annotation.Bean;
@@ -12,8 +10,6 @@
1210
import org.springframework.security.config.web.server.SecurityWebFiltersOrder;
1311
import org.springframework.security.config.web.server.ServerHttpSecurity;
1412
import org.springframework.security.web.server.SecurityWebFilterChain;
15-
import org.springframework.security.web.server.authentication.RedirectServerAuthenticationSuccessHandler;
16-
import org.springframework.security.web.server.authentication.logout.RedirectServerLogoutSuccessHandler;
1713
import org.springframework.security.web.server.util.matcher.ServerWebExchangeMatchers;
1814

1915
@Configuration

api/src/main/java/io/kafbat/ui/config/auth/LdapSecurityConfig.java

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,13 @@
33
import io.kafbat.ui.service.rbac.AccessControlService;
44
import io.kafbat.ui.service.rbac.extractor.RbacActiveDirectoryAuthoritiesExtractor;
55
import io.kafbat.ui.service.rbac.extractor.RbacLdapAuthoritiesExtractor;
6+
import io.kafbat.ui.util.CustomSslSocketFactory;
67
import io.kafbat.ui.util.StaticFileWebFilter;
78
import java.util.Collection;
89
import java.util.List;
10+
import java.util.Map;
911
import java.util.Optional;
12+
import java.util.stream.Stream;
1013
import lombok.RequiredArgsConstructor;
1114
import lombok.extern.slf4j.Slf4j;
1215
import org.springframework.beans.factory.annotation.Autowired;
@@ -47,6 +50,9 @@
4750
@RequiredArgsConstructor
4851
@Slf4j
4952
public class LdapSecurityConfig extends AbstractAuthSecurityConfig {
53+
private static final Map<String, Object> BASE_ENV_PROPS = Map.of(
54+
"java.naming.ldap.factory.socket", CustomSslSocketFactory.class.getName()
55+
);
5056

5157
private final LdapProperties props;
5258

@@ -63,13 +69,10 @@ public AbstractLdapAuthenticationProvider authenticationProvider(LdapAuthorities
6369

6470
AbstractLdapAuthenticationProvider authProvider;
6571

66-
if (!props.isActiveDirectory()) {
67-
authProvider = new LdapAuthenticationProvider(ba, authoritiesExtractor);
72+
if (props.isActiveDirectory()) {
73+
authProvider = activeDirectoryProvider(authoritiesExtractor);
6874
} else {
69-
authProvider = new ActiveDirectoryLdapAuthenticationProvider(props.getActiveDirectoryDomain(),
70-
props.getUrls());
71-
authProvider.setUseAuthenticationRequestCredentials(true);
72-
((ActiveDirectoryLdapAuthenticationProvider) authProvider).setAuthoritiesPopulator(authoritiesExtractor);
75+
authProvider = new LdapAuthenticationProvider(ba, authoritiesExtractor);
7376
}
7477

7578
if (rbacEnabled) {
@@ -80,7 +83,7 @@ public AbstractLdapAuthenticationProvider authenticationProvider(LdapAuthorities
8083
}
8184

8285
@Bean
83-
@ConditionalOnProperty(value = "oauth2.ldap.activeDirectory", havingValue = "false")
86+
@ConditionalOnProperty(value = "oauth2.ldap.activeDirectory", havingValue = "false", matchIfMissing = true)
8487
public BindAuthenticator ldapBindAuthentication(LdapContextSource ldapContextSource) {
8588
BindAuthenticator ba = new BindAuthenticator(ldapContextSource);
8689

@@ -159,6 +162,22 @@ public SecurityWebFilterChain configureLdap(ServerHttpSecurity http) {
159162
return builder.build();
160163
}
161164

165+
private ActiveDirectoryLdapAuthenticationProvider activeDirectoryProvider(LdapAuthoritiesPopulator populator) {
166+
ActiveDirectoryLdapAuthenticationProvider provider = new ActiveDirectoryLdapAuthenticationProvider(
167+
props.getActiveDirectoryDomain(),
168+
props.getUrls()
169+
);
170+
171+
provider.setUseAuthenticationRequestCredentials(true);
172+
provider.setAuthoritiesPopulator(populator);
173+
174+
if (Stream.of(props.getUrls().split(",")).anyMatch(url -> url.startsWith("ldaps://"))) {
175+
provider.setContextEnvironmentProperties(BASE_ENV_PROPS);
176+
}
177+
178+
return provider;
179+
}
180+
162181
private static class RbacUserDetailsMapper extends LdapUserDetailsMapper {
163182
@Override
164183
public UserDetails mapUserFromContext(DirContextOperations ctx, String username,

api/src/main/java/io/kafbat/ui/config/auth/condition/ActiveDirectoryCondition.java

Lines changed: 0 additions & 21 deletions
This file was deleted.

api/src/main/java/io/kafbat/ui/config/auth/logout/CognitoLogoutSuccessHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ public Mono<Void> handle(WebFilterExchange exchange, Authentication authenticati
4040
requestUri.getPath(), requestUri.getQuery());
4141

4242
final UriComponents baseUrl = UriComponentsBuilder
43-
.fromHttpUrl(fullUrl)
43+
.fromUriString(fullUrl)
4444
.replacePath("/")
4545
.replaceQuery(null)
4646
.fragment(null)

0 commit comments

Comments
 (0)