Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit0e490e8

Browse files
committed
refactor: remove unused logic in URI handler
PR#180 delegated all the logic for rest client and cliinitialization to the usual authentication screen which providedbetter feedback/progress. But it also left over previous logicthat can be removed.
1 parentb316d1d commit0e490e8

File tree

1 file changed

+0
-48
lines changed

1 file changed

+0
-48
lines changed

‎src/main/kotlin/com/coder/toolbox/util/CoderProtocolHandler.kt‎

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@ package com.coder.toolbox.util
22

33
importcom.coder.toolbox.CoderToolboxContext
44
importcom.coder.toolbox.cli.CoderCLIManager
5-
importcom.coder.toolbox.cli.ensureCLI
65
importcom.coder.toolbox.models.WorkspaceAndAgentStatus
7-
importcom.coder.toolbox.plugin.PluginManager
86
importcom.coder.toolbox.sdk.CoderRestClient
97
importcom.coder.toolbox.sdk.v2.models.Workspace
108
importcom.coder.toolbox.sdk.v2.models.WorkspaceAgent
@@ -154,29 +152,6 @@ open class CoderProtocolHandler(
154152
return workspace
155153
}
156154

157-
privatesuspendfunbuildRestClient(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-
returnnull
163-
}
164-
}
165-
166-
/**
167-
* Returns an authenticated Coder CLI.
168-
*/
169-
privatesuspendfunauthenticate(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-
180155
privatesuspendfun List<Workspace>.matchName(workspaceName:String,deploymentURL:String):Workspace? {
181156
val workspace=this.firstOrNull { it.name== workspaceName }
182157
if (workspace==null) {
@@ -326,29 +301,6 @@ open class CoderProtocolHandler(
326301
returntrue
327302
}
328303

329-
privatesuspendfunconfigureCli(
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-
352304
privatefunlaunchIde(
353305
environmentId:String,
354306
productCode:String,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp