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(spring-zeebe) bump version of spring zeebe to 8.5.7 #2815

Merged
merged 3 commits into from
Jul 8, 2024
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
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 @@ -44,16 +44,15 @@ public class ConsoleSecretProviderTest {

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 = Map.of("Authorization", "Bearer XXX");
when(auth.getTokenHeader(Product.CONSOLE)).thenReturn(authToken);

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

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

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

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

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

// New secrets should be resolved
Expand Down
2 changes: 1 addition & 1 deletion 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.3</version.zeebe>
<version.feel-engine>1.18.0-alpha1</version.feel-engine>
<version.spring-zeebe>8.5.5</version.spring-zeebe>
<version.spring-zeebe>8.5.7</version.spring-zeebe>

<!-- Third party dependencies -->

Expand Down