@@ -2,9 +2,7 @@ package com.coder.toolbox.util
2
2
3
3
import com.coder.toolbox.CoderToolboxContext
4
4
import com.coder.toolbox.cli.CoderCLIManager
5
- import com.coder.toolbox.cli.ensureCLI
6
5
import com.coder.toolbox.models.WorkspaceAndAgentStatus
7
- import com.coder.toolbox.plugin.PluginManager
8
6
import com.coder.toolbox.sdk.CoderRestClient
9
7
import com.coder.toolbox.sdk.v2.models.Workspace
10
8
import com.coder.toolbox.sdk.v2.models.WorkspaceAgent
@@ -154,29 +152,6 @@ open class CoderProtocolHandler(
154
152
return workspace
155
153
}
156
154
157
- private suspend fun buildRestClient (deploymentURL : String , token : String? ): CoderRestClient ? {
158
- try {
159
- return authenticate(deploymentURL, token)
160
- } catch (ex: Exception ) {
161
- context.logAndShowError(CAN_T_HANDLE_URI_TITLE , humanizeConnectionError(deploymentURL.toURL(), true , ex))
162
- return null
163
- }
164
- }
165
-
166
- /* *
167
- * Returns an authenticated Coder CLI.
168
- */
169
- private suspend fun authenticate (deploymentURL : String , token : String? ): CoderRestClient {
170
- val client = CoderRestClient (
171
- context,
172
- deploymentURL.toURL(),
173
- token,
174
- PluginManager .pluginInfo.version
175
- )
176
- client.initializeSession()
177
- return client
178
- }
179
-
180
155
private suspend fun List<Workspace>.matchName (workspaceName : String , deploymentURL : String ): Workspace ? {
181
156
val workspace = this .firstOrNull { it.name == workspaceName }
182
157
if (workspace == null ) {
@@ -326,29 +301,6 @@ open class CoderProtocolHandler(
326
301
return true
327
302
}
328
303
329
- private suspend fun configureCli (
330
- deploymentURL : String ,
331
- restClient : CoderRestClient ,
332
- progressReporter : (String ) -> Unit
333
- ): CoderCLIManager {
334
- val cli = ensureCLI(
335
- context,
336
- deploymentURL.toURL(),
337
- restClient.buildInfo().version,
338
- progressReporter
339
- )
340
-
341
- // We only need to log in if we are using token-based auth.
342
- if (restClient.token != null ) {
343
- context.logger.info(" Authenticating Coder CLI..." )
344
- cli.login(restClient.token)
345
- }
346
-
347
- context.logger.info(" Configuring Coder CLI..." )
348
- cli.configSsh(restClient.workspacesByAgents())
349
- return cli
350
- }
351
-
352
304
private fun launchIde (
353
305
environmentId : String ,
354
306
productCode : String ,
0 commit comments