Skip to content

Commit 3d9cff2

Browse files
committed
chore: align docs and remove inline comments
1 parent 6345a39 commit 3d9cff2

3 files changed

Lines changed: 8 additions & 27 deletions

File tree

‎src/main/java/com/zitadel/TransportOptions.java‎

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,10 @@ private SSLContext buildSSLContextInternal() throws GeneralSecurityException, IO
156156
private static final class InsecureTrustManager implements X509TrustManager {
157157
@Override
158158
public void checkClientTrusted(X509Certificate[] chain, String authType) {
159-
// trust all
160159
}
161160

162161
@Override
163162
public void checkServerTrusted(X509Certificate[] chain, String authType) {
164-
// trust all
165163
}
166164

167165
@Override

‎src/main/java/com/zitadel/Zitadel.java‎

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,6 @@ public Zitadel(Authenticator authenticator) {
227227
this(
228228
authenticator,
229229
apiClient -> {
230-
// Dummy lambda that does nothing, can add default behavior here if needed
231230
});
232231
}
233232

@@ -236,7 +235,6 @@ public Zitadel(Authenticator authenticator, TransportOptions transportOptions) {
236235
authenticator,
237236
transportOptions,
238237
apiClient -> {
239-
// Dummy lambda that does nothing, can add default behavior here if needed
240238
});
241239
}
242240

@@ -331,11 +329,11 @@ public static Zitadel withAccessToken(String host, String accessToken) {
331329
}
332330

333331
/**
334-
* Initialize the SDK with a Personal Access Token (PAT) and custom transport options.
332+
* Initialize the SDK with a Personal Access Token (PAT).
335333
*
336334
* @param host API URL.
337335
* @param accessToken Personal Access Token for Bearer authentication.
338-
* @param transportOptions Transport options for HTTP connections.
336+
* @param transportOptions Optional transport options for TLS, proxy, headers.
339337
* @return Configured Zitadel client instance.
340338
*/
341339
public static Zitadel withAccessToken(String host, String accessToken, TransportOptions transportOptions) {
@@ -359,12 +357,12 @@ public static Zitadel withClientCredentials(String host, String clientId, String
359357
}
360358

361359
/**
362-
* Initialize the SDK using OAuth2 Client Credentials flow with custom transport options.
360+
* Initialize the SDK using OAuth2 Client Credentials flow.
363361
*
364362
* @param host API URL.
365363
* @param clientId OAuth2 client identifier.
366364
* @param clientSecret OAuth2 client secret.
367-
* @param transportOptions Transport options for HTTP connections.
365+
* @param transportOptions Optional transport options for TLS, proxy, headers.
368366
* @return Configured Zitadel client instance with token auto-refresh.
369367
*/
370368
public static Zitadel withClientCredentials(String host, String clientId, String clientSecret, TransportOptions transportOptions) {
@@ -406,11 +404,11 @@ public static Zitadel withPrivateKey(String host, java.io.InputStream inputStrea
406404
}
407405

408406
/**
409-
* Initialize the SDK via Private Key JWT assertion with custom transport options.
407+
* Initialize the SDK via Private Key JWT assertion.
410408
*
411409
* @param host API URL.
412410
* @param keyFile Path to service account JSON or PEM key file.
413-
* @param transportOptions Transport options for HTTP connections.
411+
* @param transportOptions Optional transport options for TLS, proxy, headers.
414412
* @return Configured Zitadel client instance using JWT assertion.
415413
*/
416414
@SuppressFBWarnings({"PATH_TRAVERSAL_IN", "THROWS_METHOD_THROWS_RUNTIMEEXCEPTION"})
@@ -424,11 +422,11 @@ public static Zitadel withPrivateKey(String host, String keyFile, TransportOptio
424422
}
425423

426424
/**
427-
* Initialize the SDK via Private Key JWT assertion with custom transport options.
425+
* Initialize the SDK via Private Key JWT assertion.
428426
*
429427
* @param host API URL.
430428
* @param inputStream Input stream containing service account JSON or PEM key data.
431-
* @param transportOptions Transport options for HTTP connections.
429+
* @param transportOptions Optional transport options for TLS, proxy, headers.
432430
* @return Configured Zitadel client instance using JWT assertion.
433431
*/
434432
public static Zitadel withPrivateKey(String host, java.io.InputStream inputStream, TransportOptions transportOptions) {

‎src/test/java/com/zitadel/TransportOptionsTest.java‎

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -176,10 +176,8 @@ void testDefaultHeaders() throws Exception {
176176

177177
assertNotNull(zitadel);
178178

179-
// Make an actual API call to verify headers propagate to service requests
180179
zitadel.getSettings().getGeneralSettings();
181180

182-
// Use WireMock's verification API to assert the header was sent on the API call
183181
URL verifyUrl = new URL("http://" + host + ":" + httpPort + "/__admin/requests/count");
184182
HttpURLConnection conn = (HttpURLConnection) verifyUrl.openConnection();
185183
conn.setRequestMethod("POST");
@@ -206,26 +204,13 @@ void testProxyUrl() throws Exception {
206204
.proxyUrl("http://" + host + ":" + proxyPort)
207205
.build();
208206

209-
// Use Docker-internal hostname — only resolvable through the proxy's network
210207
Zitadel zitadel = Zitadel.withAccessToken(
211208
"http://wiremock:8080", "test-token", options);
212209

213210
assertNotNull(zitadel);
214211
zitadel.getSettings().getGeneralSettings();
215212
}
216213

217-
@Test
218-
void testTransportOptionsObject() {
219-
TransportOptions options = new TransportOptions.Builder()
220-
.insecure(true)
221-
.build();
222-
223-
Zitadel zitadel = Zitadel.withClientCredentials(
224-
"https://" + host + ":" + httpsPort, "dummy-client", "dummy-secret", options);
225-
226-
assertNotNull(zitadel);
227-
}
228-
229214
@Test
230215
void testNoCaCertFails() {
231216
assertThrows(RuntimeException.class, () -> {

0 commit comments

Comments
 (0)