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: zeebe client auth in saas #3748

Draft
wants to merge 9 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 3 additions & 8 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,8 @@ jobs:
- name: Validate release tag and determine previous tag
id: validate_tag
run: |
OUTPUT="$(.github/workflows/scripts/prev_tag.sh ${{ github.event.release.tag_name }})"
if [ $? -ne 0 ]; then
echo "Script failed"
exit 1
fi
echo "type=$( echo $OUTPUT | cut -d ' ' -f1 )" >> $GITHUB_OUTPUT
echo "previousTag=$( echo $OUTPUT | cut -d ' ' -f2 )" >> $GITHUB_OUTPUT
echo "type=RC" >> $GITHUB_OUTPUT
echo "previousTag=8.7.0-alpha1" >> $GITHUB_OUTPUT

# We will update this branch by setting the new version and pushing it
- name: Determine release branch name
Expand Down Expand Up @@ -115,7 +110,7 @@ jobs:
RELEASE_VERSION: ${{ github.event.release.tag_name }}

- name: Deploy artifacts to Artifactory and Maven Central (Staging)
run: mvn -B compile generate-sources source:jar javadoc:jar deploy -PcheckFormat -Psonatype-oss-release
run: mvn -B compile generate-sources source:jar javadoc:jar deploy -Psonatype-oss-release -DskipTests
env:
NEXUS_USR: ${{ steps.secrets.outputs.ARTIFACTORY_USR }}
NEXUS_PSW: ${{ steps.secrets.outputs.ARTIFACTORY_PSW }}
Expand Down
2 changes: 1 addition & 1 deletion bundle/camunda-saas-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-runtime-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>connector-runtime-bundle-saas</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
package io.camunda.connector.runtime.saas;

import io.camunda.connector.api.secret.SecretProvider;
import io.camunda.zeebe.client.CredentialsProvider;
import io.camunda.zeebe.client.ZeebeClientConfiguration;
import io.camunda.zeebe.client.api.JsonMapper;
import io.camunda.zeebe.client.impl.oauth.OAuthCredentialsProviderBuilder;
import io.camunda.zeebe.spring.client.configuration.ZeebeClientConfigurationImpl;
import io.camunda.zeebe.spring.client.jobhandling.ZeebeClientExecutorService;
import io.camunda.zeebe.spring.client.properties.CamundaClientProperties;
import io.camunda.zeebe.spring.client.properties.ZeebeClientConfigurationProperties;
import io.grpc.ClientInterceptor;
import java.util.List;
import org.apache.hc.client5.http.async.AsyncExecChainHandler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Primary;

@Configuration
public class ZeebeClientSaaSConfiguration {

public static String SECRET_NAME_CLIENT_ID = "M2MClientId";
public static String SECRET_NAME_SECRET = "M2MSecret";

private final SecretProvider internalSecretProvider;

@Value("${camunda.operate.client.authUrl}")
private String operateAuthUrl;

public ZeebeClientSaaSConfiguration(@Autowired SaaSConfiguration saaSConfiguration) {
this.internalSecretProvider = saaSConfiguration.getInternalSecretProvider();
}

private static class SaaSZeebeClientConfiguration extends ZeebeClientConfigurationImpl {

private final CredentialsProvider customCredentialsProvider;

public SaaSZeebeClientConfiguration(
ZeebeClientConfigurationProperties properties,
CamundaClientProperties camundaClientProperties,
JsonMapper jsonMapper,
List<ClientInterceptor> interceptors,
List<AsyncExecChainHandler> chainHandlers,
ZeebeClientExecutorService zeebeClientExecutorService,
CredentialsProvider credentialsProvider) {
super(properties, camundaClientProperties, jsonMapper, interceptors, chainHandlers,
zeebeClientExecutorService);
this.customCredentialsProvider = credentialsProvider;
}

@Override
public CredentialsProvider getCredentialsProvider() {
return customCredentialsProvider;
}
}

@Bean
@Primary
public ZeebeClientConfiguration saasZeebeClientConfiguration(
final ZeebeClientConfigurationProperties properties,
final CamundaClientProperties camundaClientProperties,
final JsonMapper jsonMapper,
final List<ClientInterceptor> interceptors,
final List<AsyncExecChainHandler> chainHandlers,
final ZeebeClientExecutorService zeebeClientExecutorService) {
return new SaaSZeebeClientConfiguration(properties, camundaClientProperties, jsonMapper,
interceptors, chainHandlers, zeebeClientExecutorService, credentialsProvider());
}

private CredentialsProvider credentialsProvider() {
final var builder = new OAuthCredentialsProviderBuilder();
builder.clientId(internalSecretProvider.getSecret(SECRET_NAME_CLIENT_ID));
builder.clientSecret(internalSecretProvider.getSecret(SECRET_NAME_SECRET));
builder.authorizationServerUrl(operateAuthUrl);
builder.audience("zeebe.dev.ultrawombat.com");
return builder.build();
}
}
2 changes: 1 addition & 1 deletion bundle/default-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connector-runtime-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>connector-runtime-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-parent</artifactId>
<relativePath>../parent/pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<modules>
Expand Down
2 changes: 1 addition & 1 deletion connector-runtime/connector-runtime-application/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion connector-runtime/connector-runtime-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-bundle-parent</artifactId>
<relativePath>../../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connector-runtime-core</name>
Expand Down
2 changes: 1 addition & 1 deletion connector-runtime/connector-runtime-spring/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../../pom.xml</relativePath>
</parent>

Expand Down
4 changes: 2 additions & 2 deletions connector-sdk/core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connector-core</name>
Expand Down Expand Up @@ -44,7 +44,7 @@
<dependency>
<groupId>io.camunda.connector</groupId>
<artifactId>jackson-datatype-document</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</dependency>

<dependency>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/document/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connector-document</name>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/feel-wrapper/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<artifactId>connector-feel-wrapper</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/jackson-datatype-document/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<artifactId>jackson-datatype-document</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/jackson-datatype-feel/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<artifactId>jackson-datatype-feel</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<parent>
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-bundle-parent</artifactId>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
<relativePath>../pom.xml</relativePath>
</parent>

Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/test/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connector-test</name>
Expand Down
2 changes: 1 addition & 1 deletion connector-sdk/validation/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-sdk-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connector-validation</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connectors-e2e-test-aws-base</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connectors-e2e-test-aws-dynamodb</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<artifactId>connectors-e2e-test-aws-event-bridge</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connectors-e2e-test-aws-lambda</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connectors-e2e-test-aws-sns</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-aws-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<name>connectors-e2e-test-aws-sqs</name>
Expand Down
4 changes: 2 additions & 2 deletions connectors-e2e-test/connectors-e2e-test-aws/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<artifactId>connectors-e2e-test-aws-parent</artifactId>
<packaging>pom</packaging>
<name>connectors-e2e-test-aws-parent</name>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>

<modules>
<module>connectors-e2e-test-aws-base</module>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Connectors Test Base project</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-easy-post/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-http/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-kafka/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-mail/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-rabbitmq/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connectors-e2e-test-parent</artifactId>
<relativePath>../pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>Tests</description>
Expand Down
2 changes: 1 addition & 1 deletion connectors-e2e-test/connectors-e2e-test-soap/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<groupId>io.camunda.connector</groupId>
<artifactId>connector-parent</artifactId>
<relativePath>../../parent/pom.xml</relativePath>
<version>8.7.0-SNAPSHOT</version>
<version>8.7.0-SNAPSHOT-quasar-gen2</version>
</parent>

<description>SOAP Connector tests</description>
Expand Down
Loading
Loading