Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(deps): remove operate client #3638

Merged
merged 15 commits into from
Dec 3, 2024
36 changes: 15 additions & 21 deletions .ci/preview-environments/charts/c8sm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,14 @@ global:
# necessary due to name override bugs
url:
host: elasticsearch
auth:
username: demo
password: demo

identity:
auth:
# Enable Camunda Identity-based authentication
enabled: true
# Token issuer (Keycloak) URL
publicIssuerUrl: https://{{ include "ingress.domain" . }}/auth/realms/camunda-platform
connectors:
# fixed secret, to avoid generating a random one each time
existingSecret: connectors
operate:
# fixed secret, to avoid generating a random one each time
existingSecret: operate
redirectUrl: https://{{ include "ingress.domain" . }}/operate
webModeler:
redirectUrl: https://{{ include "ingress.domain" . }}/modeler
zeebe:
# fixed secret, to avoid generating a random one each time
existingSecret: zeebe
keycloak:
auth:
# necessary due to name override bugs
adminUser: admin
existingSecret: identity-keycloak
existingSecretKey: admin-password
enabled: false
zeebeClusterName: zeebe-cluster


Expand All @@ -85,6 +69,16 @@ camunda-platform:
env:
- name: JAVA_OPTS
value: "-Xms512m -Xmx512m"
- name: CAMUNDA_CLIENT_AUTH_USERNAME
value: demo
- name: CAMUNDA_CLIENT_AUTH_PASSWORD
value: demo
- name: CAMUNDA_CONNECTOR_POLLING_ENABLED
value: "false"
- name: CAMUNDA_CLIENT_ZEEBE_REST-ADDRESS
value: http://zeebe-cluster-gateway:9600
- name: CAMUNDA_CLIENT_ZEEBE_GRPC-ADDRESS
value: http://zeebe-cluster-gateway:26500
resources:
limits:
cpu: 1
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/TEST_FEATURE_BRANCH.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ jobs:
- name: Install element templates CLI
run: npm install --global element-templates-cli

- name: Build Connectors
run: mvn --batch-mode clean test -PcheckFormat
#- name: Build Connectors
# run: mvn --batch-mode clean test -PcheckFormat

- name: Lint Dockerfile - connector-runtime
uses: hadolint/[email protected]
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ server.port=8080

management.server.port=9080
management.endpoints.web.exposure.include=metrics,health,prometheus,loggers
management.endpoint.health.group.readiness.include[]=zeebeClient,operate
management.endpoint.health.group.readiness.include[]=zeebeClient,processDefinitionImport

camunda.connector.polling.enabled=true
camunda.connector.polling.interval=5000
Expand All @@ -23,7 +23,6 @@ camunda.client.zeebe.base-url=http://${zeebe.client.broker.gateway-address}
camunda.client.mode=saas
camunda.client.region=${zeebe.client.cloud.region}
camunda.client.cluster-id=${zeebe.client.cloud.cluster-id}
operate.client.profile=saas
operate.client.region=${zeebe.client.cloud.region}
operate.client.cluster-id=${zeebe.client.cloud.cluster-id}

Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.put;
import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;

import io.camunda.operate.CamundaOperateClient;
import io.camunda.process.test.api.CamundaSpringProcessTest;
import java.time.Duration;
import org.junit.jupiter.api.Test;
Expand All @@ -36,7 +35,6 @@
import org.springframework.boot.test.autoconfigure.web.servlet.AutoConfigureMockMvc;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.boot.test.context.SpringBootTest.WebEnvironment;
import org.springframework.boot.test.mock.mockito.MockBean;
import org.springframework.boot.test.web.server.LocalManagementPort;
import org.springframework.boot.web.client.RestTemplateBuilder;
import org.springframework.http.HttpEntity;
Expand All @@ -49,7 +47,7 @@

@SpringBootTest(
webEnvironment = WebEnvironment.RANDOM_PORT,
classes = {SaaSConnectorRuntimeApplication.class, MockSaaSConfiguration.class},
classes = {SaaSConnectorRuntimeApplication.class},
properties = {
"camunda.saas.secrets.projectId=42",
"camunda.client.zeebe.enabled=true",
Expand All @@ -59,11 +57,7 @@
"zeebe.client.cloud.region=bru-1",
"camunda.connector.auth.audience=connectors.dev.ultrawombat.com",
"camunda.connector.auth.issuer=https://weblogin.cloud.dev.ultrawombat.com/",
"camunda.operate.client.url=" + MockSaaSConfiguration.OPERATE_CLIENT_URL,
"camunda.operate.client.authUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_AUTH_URL,
"camunda.operate.client.baseUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_BASEURL,
"camunda.connector.secretprovider.discovery.enabled=false",
"operate.client.profile=oidc",
"management.endpoints.web.exposure.include=*"
})
@DirtiesContext
Expand All @@ -77,10 +71,6 @@ public class SecurityConfigurationTest {
@LocalManagementPort int managementPort;
@Autowired private MockMvc mvc;

@MockBean
@SuppressWarnings("unused")
private CamundaOperateClient operateClient;

@Test
public void publishLogsEndpoint_fromLocalhost_returns200() throws Exception {
mvc.perform(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,12 @@
*/
package io.camunda.connector.runtime.saas;

import static org.assertj.core.api.AssertionsForClassTypes.assertThat;

import org.junit.jupiter.api.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.ActiveProfiles;

@SpringBootTest(
classes = {SaaSConnectorRuntimeApplication.class, MockSaaSConfiguration.class},
classes = {SaaSConnectorRuntimeApplication.class},
properties = {
"camunda.saas.secrets.projectId=42",
"zeebe.client.cloud.clusterId=42",
Expand All @@ -33,33 +30,16 @@
"zeebe.client.security.plaintext=true",
"camunda.connector.auth.audience=connectors.dev.ultrawombat.com",
"camunda.connector.auth.issuer=https://weblogin.cloud.dev.ultrawombat.com/",
"camunda.operate.client.url=" + MockSaaSConfiguration.OPERATE_CLIENT_URL,
"camunda.operate.client.authUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_AUTH_URL,
"camunda.operate.client.baseUrl=" + MockSaaSConfiguration.OPERATE_CLIENT_BASEURL,
"camunda.connector.secretprovider.discovery.enabled=false",
"operate.client.profile=oidc",
"camunda.connector.secretprovider.discovery.enabled=false"
})
@ActiveProfiles("test")
public class TestSpringContextStartup {

@Autowired private SaaSOperateClientFactory operateClientFactory;

@Test
public void contextLoaded() {
// This test case just verifies that the runtime comes up without problems around
// conflicting class files in logging or other wired behavior that can be observed
// when the Spring context is initialized (e.g.
// https://github.com/camunda/team-connectors/issues/251)
}

@Test
public void jwtCredentialConfigured() {
var jwtCredential = operateClientFactory.configureJwtCredential();
assertThat(jwtCredential).isNotNull();
assertThat(jwtCredential.clientId()).isEqualTo(MockSaaSConfiguration.OPERATE_CLIENT_CLIENT_ID);
assertThat(jwtCredential.clientSecret()).isEqualTo(MockSaaSConfiguration.OPERATE_CLIENT_SECRET);
assertThat(jwtCredential.audience()).isEqualTo(MockSaaSConfiguration.OPERATE_CLIENT_BASEURL);
assertThat(jwtCredential.authUrl().toString())
.isEqualTo(MockSaaSConfiguration.OPERATE_CLIENT_AUTH_URL);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ camunda.client.mode=self-managed
camunda.client.auth.username=demo
camunda.client.auth.password=demo
camunda.client.auth.issuer="" # if present, will trigger OIDC mode
operate.client.profile=simple
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
server.port=8080

management.context-path=/actuator
management.endpoints.web.exposure.include=metrics,health,prometheus,loggers
management.endpoint.health.group.readiness.include[]=zeebeClient,operate
management.endpoint.health.group.readiness.include[]=zeebeClient,processDefinitionImport
management.endpoint.health.show-components=always
management.endpoint.health.show-details=always
operate.client.base-url=http://localhost:8081

camunda.client.zeebe.gateway-url=http://localhost:26500
camunda.client.zeebe.defaults.max-jobs-active=32
camunda.client.zeebe.defaults.worker-threads=10
camunda.client.zeebe.defaults.stream-enabled=true

camunda.client.mode=self-managed

# Config for use with docker-compose.yml
camunda.client.zeebe.rest-address=http://localhost:8080
camunda.client.auth.client-id=connectors
camunda.client.auth.client-secret=XALaRPl5qwTEItdwCMiPS62nVpKs7dL7
camunda.client.auth.oidc-type=keycloak
camunda.client.auth.issuer=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token
camunda.client.identity.audience=connectors
camunda.client.identity.base-url=http://localhost:8084
operate.client.profile=oidc
operate.client.auth-url=http://localhost:18080/auth/realms/camunda-platform/protocol/openid-connect/token
operate.client.client-id=connectors
operate.client.client-secret=XALaRPl5qwTEItdwCMiPS62nVpKs7dL7

# Config for use with docker-compose-core.yml
#camunda.client.auth.username=demo
#camunda.client.auth.password=demo
#operate.client.profile=simple
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
management.context-path=/actuator
management.endpoints.web.exposure.include=metrics,health,prometheus,loggers
management.endpoint.health.group.readiness.include[]=zeebeClient,operate
management.endpoint.health.group.readiness.include[]=zeebeClient,processDefinitionImport
4 changes: 0 additions & 4 deletions connector-runtime/connector-runtime-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
<groupId>io.camunda</groupId>
<artifactId>zeebe-client-java</artifactId>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>java-client-operate</artifactId>
</dependency>

<dependency>
<groupId>org.slf4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,15 +36,15 @@ public class DefaultInboundConnectorContextFactory implements InboundConnectorCo
private final InboundCorrelationHandler correlationHandler;
private final SecretProviderAggregator secretProviderAggregator;
private final ValidationProvider validationProvider;
private final OperateClientAdapter operateClientAdapter;
private final ProcessInstanceClient operateClientAdapter;
private final DocumentFactory documentFactory;

public DefaultInboundConnectorContextFactory(
final ObjectMapper mapper,
final InboundCorrelationHandler correlationHandler,
final SecretProviderAggregator secretProviderAggregator,
final ValidationProvider validationProvider,
final OperateClientAdapter operateClientAdapter,
final ProcessInstanceClient operateClientAdapter,
final DocumentFactory documentFactory) {
this.objectMapper = mapper;
this.correlationHandler = correlationHandler;
Expand Down
Loading
Loading