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

proposal: move to 8.5.16 of spring zeebe #3831

Merged
merged 1 commit into from
Jan 14, 2025
Merged
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
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 @@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>java-client-operate</artifactId>
<artifactId>java-client-operate-legacy</artifactId>
</dependency>

<dependency>
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 @@ -49,7 +49,7 @@
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>java-client-operate</artifactId>
<artifactId>java-client-operate-legacy</artifactId>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public Map<String, String> getSecrets() {
try (CloseableHttpClient httpClient = HttpClientBuilder.create().build()) {
var request = new HttpGet(secretsEndpoint);
var authHeader = authentication.getTokenHeader(Product.CONSOLE);
request.addHeader(authHeader.getKey(), authHeader.getValue());
authHeader.forEach(request::addHeader);
return httpClient.execute(request, this::handleSecretsResponse);
} catch (Exception e) {
throw new RuntimeException(e);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,23 +37,23 @@
import org.mockito.Mockito;

public class ConsoleSecretProviderTest {
private static final String TOKEN_VALUE = "Bearer XXX";

@RegisterExtension
static WireMockExtension wm =
WireMockExtension.newInstance().options(wireMockConfig().dynamicPort()).build();

static Authentication auth;

static Map.Entry<String, String> authToken;
static Map<String, String> authToken;

static ConsoleSecretApiClient client;

@BeforeAll
static void beforeAll() {
// Mock authentication
auth = Mockito.mock(Authentication.class);
authToken =
Collections.singletonMap("Authorization", "Bearer XXX").entrySet().iterator().next();
authToken = Collections.singletonMap("Authorization", TOKEN_VALUE);
when(auth.getTokenHeader(Product.CONSOLE)).thenReturn(authToken);

client = new ConsoleSecretApiClient(wm.baseUrl() + "/secrets", auth);
Expand All @@ -65,7 +65,7 @@ void testSuccessfulSecretsHandling() {
var secretsResponse = Collections.singletonMap("secretKey", "secretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching(TOKEN_VALUE))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

// Test the client
Expand All @@ -82,7 +82,7 @@ void testFailureOnInitialLoad() {
// Mock failing response
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching(TOKEN_VALUE))
.willReturn(ResponseDefinitionBuilder.responseDefinition().withStatus(500)));

// Test the client
Expand All @@ -95,7 +95,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
var secretsResponse = Collections.singletonMap("secretKey", "secretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching(TOKEN_VALUE))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

var consoleSecretProvider = new ConsoleSecretProvider(client, Duration.ofMillis(1));
Expand All @@ -107,7 +107,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
// Mock failing response
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching(TOKEN_VALUE))
.willReturn(ResponseDefinitionBuilder.responseDefinition().withStatus(500)));

// Previously cached secret should still be resolved
Expand All @@ -120,7 +120,7 @@ void testSuccessfulSecretResolvingInCaseOfFailure() throws InterruptedException
secretsResponse = Collections.singletonMap("secretKey", "newSecretValue");
wm.stubFor(
get(urlPathMatching("/secrets"))
.withHeader("Authorization", matching(authToken.getValue()))
.withHeader("Authorization", matching(TOKEN_VALUE))
.willReturn(ResponseDefinitionBuilder.okForJson(secretsResponse)));

// New secrets should be resolved
Expand Down
4 changes: 4 additions & 0 deletions connectors-e2e-test/connectors-e2e-test-base/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
</dependency>
<dependency>
<groupId>org.assertj</groupId>
<artifactId>assertj-core</artifactId>
Expand Down
4 changes: 2 additions & 2 deletions parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ limitations under the License.</license.inlineheader>
<!-- Camunda internal libraries -->
<version.zeebe>8.5.5</version.zeebe>
<version.feel-engine>1.17.7</version.feel-engine>
<version.spring-zeebe>8.5.5</version.spring-zeebe>
<version.spring-zeebe>8.5.16</version.spring-zeebe>
<version.identity-sdk>8.5.5</version.identity-sdk>

<!-- Third party dependencies -->
Expand Down Expand Up @@ -295,7 +295,7 @@ limitations under the License.</license.inlineheader>
</dependency>
<dependency>
<groupId>io.camunda.spring</groupId>
<artifactId>java-client-operate</artifactId>
<artifactId>java-client-operate-legacy</artifactId>
<version>${version.spring-zeebe}</version>
</dependency>
<dependency>
Expand Down
Loading