Skip to content

fix: fall back to TLS trust when cluster CA path is missing#317

Merged
adietish merged 6 commits into
redhat-developer:mainfrom
adietish:crw-11253
Jul 15, 2026
Merged

fix: fall back to TLS trust when cluster CA path is missing#317
adietish merged 6 commits into
redhat-developer:mainfrom
adietish:crw-11253

Conversation

@adietish

@adietish adietish commented Jun 12, 2026

Copy link
Copy Markdown
Collaborator

@coderabbitai

coderabbitai Bot commented Jun 12, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

This PR redesigns TLS trust resolution, OAuth discovery and token exchange, OpenShift API client construction, authentication strategy integration, and wizard connection execution. It also updates kubeconfig handling, selected timing conversions, UI trust prompts, and related tests.

Changes

TLS, authentication, and wizard connection flow

Layer / File(s) Summary
TLS contracts and trust decision UI
src/main/kotlin/com/redhat/devtools/gateway/auth/tls/*, src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/*
TLS contexts now track trust modes and endpoint kinds, while trust decisions use the new dialog and adapter.
Endpoint-aware TLS trust resolution
src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt, src/test/kotlin/com/redhat/devtools/gateway/auth/tls/*
Trust resolution now probes existing certificates and system trust, captures failed handshakes, persists accepted certificates, and handles OpenShift OAuth endpoints.
OAuth discovery and authorization-code exchange
src/main/kotlin/com/redhat/devtools/gateway/auth/code/*, src/test/kotlin/com/redhat/devtools/gateway/auth/code/*
OAuth metadata discovery, HTTP token requests, redirect parsing, and shared token exchange are implemented and tested.
OpenShift API client builders
src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/*, src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/*
Token, client-certificate, and kubeconfig-link builders replace the removed factory-based client construction.
Authentication strategies using TLS contexts
src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/*
Authentication contracts and strategies pass TLS contexts directly, use the new builders, and schedule UI callbacks through the application thread.
Asynchronous wizard connection execution
src/main/kotlin/com/redhat/devtools/gateway/view/*, src/main/kotlin/com/redhat/devtools/gateway/view/steps/*
Wizard navigation and cluster connection now run through WizardAsyncWork, with cancellation, TLS resolution, authentication, persistence, and failure handling coordinated asynchronously.

Kubeconfig, timing, and repository support

Layer / File(s) Summary
Kubeconfig locking and lookup support
src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/*
Kubeconfig saves use canonical-path locks, cluster lookup accepts normalized server URLs, and TLS-skip state is exposed by cluster entries.
Timing and repository cleanup
.gitignore, src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt, src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
Additional local directories are ignored, pod polling uses millisecond values, and the relocated API client utility is imported explicitly.

Estimated code review effort: 5 (Critical) | ~120 minutes

Sequence Diagram(s)

sequenceDiagram
  participant Wizard
  participant TLSManager
  participant OAuthDiscovery
  participant AuthStrategy
  participant ApiClientBuilder

  Wizard->>TLSManager: createOpenShiftTlsContext(apiServerUrl)
  TLSManager->>OAuthDiscovery: endpointBaseUrls()
  OAuthDiscovery-->>TLSManager: OAuth endpoint URLs
  TLSManager-->>Wizard: TlsContext
  Wizard->>AuthStrategy: authenticate(tlsContext)
  AuthStrategy->>ApiClientBuilder: build()
  ApiClientBuilder-->>AuthStrategy: ApiClient
  AuthStrategy-->>Wizard: authentication result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.18% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The PR links the relevant issue and the stated objective matches the reported OpenShift OAuth login failure.
Out of Scope Changes check ✅ Passed The refactors and UI/client changes are aligned with the TLS trust and OpenShift login fix, with only minor ancillary edits.
Title check ✅ Passed The title clearly summarizes the main change: falling back to TLS trust when the cluster CA path is missing.
Description check ✅ Passed The description is directly related to the change by linking the issue this PR fixes.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@adietish adietish self-assigned this Jun 12, 2026
@codecov-commenter

codecov-commenter commented Jun 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 46.82540% with 335 lines in your changes missing coverage. Please review.
✅ Project coverage is 32.34%. Comparing base (71098f6) to head (d233bab).
⚠️ Report is 388 commits behind head on main.

Files with missing lines Patch % Lines
...ools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt 0.00% 52 Missing ⚠️
...ools/gateway/view/steps/DevSpacesServerStepView.kt 0.00% 48 Missing ⚠️
...evtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt 14.89% 39 Missing and 1 partial ⚠️
...evtools/gateway/auth/tls/DefaultTlsTrustManager.kt 79.35% 22 Missing and 10 partials ⚠️
...vtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt 0.00% 25 Missing ⚠️
.../view/steps/auth/AbstractAuthenticationStrategy.kt 0.00% 21 Missing ⚠️
...view/steps/auth/RedHatSSOAuthenticationStrategy.kt 0.00% 20 Missing ⚠️
...devtools/gateway/auth/code/HttpClientExtensions.kt 35.71% 17 Missing and 1 partial ⚠️
...at/devtools/gateway/DevSpacesConnectionProvider.kt 0.00% 12 Missing ⚠️
...hat/devtools/gateway/auth/tls/SslContextFactory.kt 67.56% 11 Missing and 1 partial ⚠️
... and 13 more
Additional details and impacted files
@@            Coverage Diff             @@
##            main     #317       +/-   ##
==========================================
+ Coverage   0.00%   32.34%   +32.34%     
==========================================
  Files          4      111      +107     
  Lines         26     4566     +4540     
  Branches       0      861      +861     
==========================================
+ Hits           0     1477     +1477     
- Misses        26     2888     +2862     
- Partials       0      201      +201     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@adietish
adietish force-pushed the crw-11253 branch 14 times, most recently from aaa5778 to c0a8be0 Compare June 18, 2026 09:19
@adietish
adietish force-pushed the crw-11253 branch 12 times, most recently from 615e1a3 to ee48a19 Compare July 3, 2026 13:54

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt (1)

271-293: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Unused/swallowed exception in waitPhaseChanges.

catch (e: Exception) binds e but never logs/uses it before delaying and retrying, silently discarding potential diagnostic info (flagged by detekt). The sibling waitPhase uses catch (_: Exception) for the same pattern — align for consistency, or better, log at debug level like other catch blocks in this codebase.

Proposed fix
                 val devWorkspace = try {
                     DevWorkspaces(client).get(namespace, name)
-                } catch (e: Exception) {
+                } catch (e: Exception) {
+                    thisLogger().debug("Failed to fetch devworkspace phase, retrying", e)
                     delay(1000L)
                     continue
                 }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt`
around lines 271 - 293, The waitPhaseChanges retry block in DevWorkspaces is
swallowing an exception by binding it as e and never using it, so either change
the catch to discard the exception like the sibling waitPhase method for
consistency, or log the caught Exception at debug level before delaying and
continuing. Keep the behavior of DevWorkspaces.waitPhaseChanges and its
DevWorkspaces(client).get(namespace, name) polling loop the same, but avoid the
unused exception binding flagged by detekt.

Source: Linters/SAST tools

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt`:
- Around line 271-293: The waitPhaseChanges retry block in DevWorkspaces is
swallowing an exception by binding it as e and never using it, so either change
the catch to discard the exception like the sibling waitPhase method for
consistency, or log the caught Exception at debug level before delaying and
continuing. Keep the behavior of DevWorkspaces.waitPhaseChanges and its
DevWorkspaces(client).get(namespace, name) polling loop the same, but avoid the
unused exception binding flagged by detekt.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 39e955cd-3899-4f08-af2a-1c543d3e294e

📥 Commits

Reviewing files that changed from the base of the PR and between bd91e25 and ec48232.

📒 Files selected for processing (63)
  • .gitignore
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnection.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/session/AbstractAuthSessionManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaceRestart.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/RestartDevWorkspaceAnnotationWatch.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/server/RemoteIDEServer.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ClipboardTokenMonitor.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ProgressCountdown.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientBuilderTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
💤 Files with no reviewable changes (4)
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
✅ Files skipped from review due to trivial changes (3)
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/RestartDevWorkspaceAnnotationWatch.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • .gitignore
🚧 Files skipped from review as they are similar to previous changes (47)
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt`:
- Around line 289-294: The waitPhaseChanges loop in DevWorkspaces is swallowing
every exception, unlike waitPhase, which only retries retryable ApiException
cases. Update the catch around DevWorkspaces(client).get(namespace, name) to
mirror waitPhase’s selective retry logic: catch ApiException, retry only when
isRetryable() is true, and rethrow all other exceptions instead of delaying and
continuing. Keep the behavior aligned with waitPhase so non-retryable failures
surface immediately.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 1b4ef047-d2d4-4062-be83-fd67f264d0ab

📥 Commits

Reviewing files that changed from the base of the PR and between ec48232 and e5432dc.

📒 Files selected for processing (63)
  • .gitignore
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnection.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/session/AbstractAuthSessionManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaceRestart.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaces.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/RestartDevWorkspaceAnnotationWatch.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/server/RemoteIDEServer.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ClipboardTokenMonitor.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ProgressCountdown.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientBuilderTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
💤 Files with no reviewable changes (4)
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
✅ Files skipped from review due to trivial changes (2)
  • .gitignore
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
🚧 Files skipped from review as they are similar to previous changes (55)
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/session/AbstractAuthSessionManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ProgressCountdown.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/RestartDevWorkspaceAnnotationWatch.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnection.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ClipboardTokenMonitor.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/server/RemoteIDEServer.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/devworkspace/DevWorkspaceRestart.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@src/test/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientBuilderTest.kt`:
- Around line 111-119: Update both fallback tests for LinkClientBuilder,
including `LinkClientBuilder falls back when no kubeconfig files exist`, to
assert the result of `build()` rather than discarding `runCatching`. Verify the
expected successful client properties, such as `basePath`, or replace
`runCatching` with `assertThatThrownBy` and assert the specific expected
exception type when failure is intended, while retaining the existing
interaction verifications.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Enterprise

Run ID: 69430ff4-bb12-41ed-903a-18706fabd7a8

📥 Commits

Reviewing files that changed from the base of the PR and between e5432dc and 8fbcf37.

📒 Files selected for processing (55)
  • .gitignore
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientBuilderTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
💤 Files with no reviewable changes (4)
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UiTlsDecisionAdapter.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigTestHelpers.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TLSTrustDecisionHandler.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/OpenShiftClientFactory.kt
✅ Files skipped from review due to trivial changes (3)
  • src/test/kotlin/com/redhat/devtools/gateway/openshift/ApiClientUtilsTest.kt
  • .gitignore
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigNamedClusterTest.kt
🚧 Files skipped from review as they are similar to previous changes (47)
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsEndpointKind.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/UITlsDecisionAdapter.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/util/ExceptionUtilsTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/BlockStyleFilePersister.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/LinkClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/ExceptionUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsServerCertificateInfo.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerCaTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ApiClientUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/TokenClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscovery.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTestCertificates.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/SslContextFactory.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/ui/TlsTrustDecisionDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/DevSpacesConnectionProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/TokenAuthenticationStrategy.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtilsTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OAuthDiscoveryTest.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlowTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftOAuthAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/SelectClusterDialog.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/HttpClientExtensions.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/TlsContext.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesWizardStep.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/WizardAsyncWork.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/sandbox/SandboxClusterAuthProvider.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/DevWorkspacePods.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/TlsTrustManagerTestFixtures.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/ClientCertClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/openshift/apiclient/BaseClientBuilder.kt
  • src/main/kotlin/com/redhat/devtools/gateway/util/UrlUtils.kt
  • src/test/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigClusterTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/kubeconfig/KubeConfigEntries.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/RedHatAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/OpenShiftCredentialsAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/AbstractAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/ClientCertificateAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/DevSpacesWizardView.kt
  • src/test/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManagerTrustTest.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/KubeConfigTlsUtils.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/auth/RedHatSSOAuthenticationStrategy.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/code/OpenShiftAuthCodeFlow.kt
  • src/main/kotlin/com/redhat/devtools/gateway/auth/tls/DefaultTlsTrustManager.kt
  • src/main/kotlin/com/redhat/devtools/gateway/view/steps/DevSpacesServerStepView.kt

@adietish
adietish force-pushed the crw-11253 branch 4 times, most recently from 1672c8d to faa157f Compare July 13, 2026 10:41
@adietish
adietish force-pushed the crw-11253 branch 5 times, most recently from 9d1fdfe to dc022db Compare July 14, 2026 13:21
Add the missing import for ApiClientUtils, remove unused imports,
and suppress warnings in DevWorkspacePodsTest.
@adietish
adietish force-pushed the crw-11253 branch 2 times, most recently from 53c8178 to 80ae047 Compare July 14, 2026 15:54
@adietish

Copy link
Copy Markdown
Collaborator Author

@azatsarynnyy, @vrubezhny, @msivasubramaniaan:

How to test:

Steps:

  1. ASSERT: have a cluster with self-signed certificate (ex. https://api.ds-airgap-XXXX.com:6443) in your kube config
  2. EXEC: launch gateway and "Connect to Dev Spaces"
  3. EXEC: select your cluster with self signed certificates, switch auth to "OpenShift OAuth" and hit "Check connection"
  4. ASSERT: you get 2 dialogs that ask you to trust insecure certificates. Trust them both "Trust for this session only" (if you trust permanently, you wont get prompted again)
  5. ASSERT: you get a browser window where you are prompted to log into the cluster. Log in and close the browser.

Result:
You get the list of your workspaces on the cluster

@vrubezhny vrubezhny left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. And works fine with the airgap-cluster. Thanks!

adietish and others added 5 commits July 15, 2026 22:03
…rust dialogs (crw-11253)

- fix: skip unreadable kubeconfig CA paths during TLS setup
- fix: build token API client from wizard TLS context
- refactor: client factory -> builder
- refactor: removed duplicate http request codes
- refactor: extracted #getTrustedCerts for better readable code
- refactor: move cluster-by-server lookup to KubeConfigUtils
- fix: wire wizard CA field into TLS trust resolution
- fix: show sequential TLS trust dialogs during OpenShift connect
- refactor: extracted OAuthDiscovery for better readable OpenShiftAuthCodeFlow class
- fix: insecure-skip-tls-verify is honoured by OAuth strategy
- fix: improve TLS trust dialog UI — clickable URL, text wrapping, certificate display
- fix: avoid deadlock when displaying trust dialog
- refactor: symmetrize OpenShift TLS trust establishment
- refactor: extracted apiclient builders to own files and package
- fix: TokenClientBuilder is using ssl trust
- refactor: address review complaints

Signed-off-by: Andre Dietisheim <adietish@redhat.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
Composite JVM default CAs with custom trusted certificates when building
TLS contexts so merged OpenShift/OAuth trust retains public CA coverage.

Author: Cristian SFERCOCI
Co-authored-by: Cursor <cursoragent@cursor.com>
Use SelfSubjectAccessReview instead of listing namespaces to check
authentication, avoiding broader permissions during OAuth validation.

Author: Cristian SFERCOCI
Co-authored-by: Cursor <cursoragent@cursor.com>
Complete immediately when the thin client is already running before
listeners attach, and fail with a timeout if IDE readiness never arrives.

Author: Cristian SFERCOCI
Co-authored-by: Cursor <cursoragent@cursor.com>
Update ProjectsTest for SelfSubjectAccessReview auth validation and
adjust mergeTrustedContext assertions for composite JVM plus custom trust.

Co-authored-by: Cursor <cursoragent@cursor.com>
@adietish
adietish merged commit 07ca022 into redhat-developer:main Jul 15, 2026
7 checks passed
@adietish
adietish deleted the crw-11253 branch July 15, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Gateway] V0.0.16 can't connect with Openshift Oauth

3 participants