Skip to content

Commit 8ce2b1b

Browse files
fix: remove deprecated X-Tenant-ID header from SDK requests
Tenant identity is now derived from OAuth2 client credentials on the server side. The X-Tenant-ID header is no longer needed. - Remove addTenantIdHeader method and all calls - Remove X-Tenant-ID header from policy API requests Part of #1488: Unify auth to OAuth2 Client Credentials (RFC 6749).
1 parent 1201052 commit 8ce2b1b

2 files changed

Lines changed: 3 additions & 14 deletions

File tree

src/main/java/com/getaxonflow/sdk/AxonFlow.java

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2727,7 +2727,6 @@ public void streamExecutionStatus(
27272727
.get();
27282728

27292729
addAuthHeaders(builder);
2730-
addTenantIdHeader(builder);
27312730

27322731
Request httpRequest = builder.build();
27332732

@@ -2929,11 +2928,6 @@ private Request buildRequest(String method, String path, Object body) {
29292928
// Add authentication headers
29302929
addAuthHeaders(builder);
29312930

2932-
// Add tenant ID for policy APIs (uses clientId)
2933-
if (config.getClientId() != null && !config.getClientId().isEmpty()) {
2934-
builder.header("X-Tenant-ID", config.getClientId());
2935-
}
2936-
29372931
// Add mode header
29382932
if (config.getMode() != null) {
29392933
builder.header("X-AxonFlow-Mode", config.getMode().getValue());
@@ -3139,12 +3133,6 @@ private String getEffectiveClientId() {
31393133
return (clientId != null && !clientId.isEmpty()) ? clientId : "community";
31403134
}
31413135

3142-
private void addTenantIdHeader(Request.Builder builder) {
3143-
if (config.getClientId() != null && !config.getClientId().isEmpty()) {
3144-
builder.header("X-Tenant-ID", config.getClientId());
3145-
}
3146-
}
3147-
31483136
private <T> T parseResponse(Response response, Class<T> type) throws IOException {
31493137
handleErrorResponse(response);
31503138

@@ -3739,7 +3727,6 @@ private Request buildOrchestratorRequest(String method, String path, Object body
37393727
.header("Accept", "application/json");
37403728

37413729
addAuthHeaders(builder);
3742-
addTenantIdHeader(builder);
37433730

37443731
RequestBody requestBody = null;
37453732
if (body != null) {

src/test/java/com/getaxonflow/sdk/telemetry/TelemetryReporterTest.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,9 +419,11 @@ void testPayloadDeploymentModeEnterprise(WireMockRuntimeInfo wmRuntimeInfo) thro
419419
String customUrl = wmRuntimeInfo.getHttpBaseUrl() + "/v1/ping";
420420

421421
// telemetryEnabled=true overrides localhost guard (WireMock runs on localhost)
422+
// Use localhost:1 so detectPlatformVersion gets immediate connection-refused
423+
// (localhost:8080 may have a running service that returns a version)
422424
TelemetryReporter.sendPing(
423425
"enterprise",
424-
"http://localhost:8080",
426+
"http://localhost:1",
425427
Boolean.TRUE,
426428
false,
427429
true, // hasCredentials

0 commit comments

Comments
 (0)