Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### Fixed

- token is no longer required when authentication is done via certificates

## 0.6.4 - 2025-09-03

### Added
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
version=0.6.4
version=0.6.5
group=com.coder.toolbox
name=coder-toolbox
20 changes: 14 additions & 6 deletions src/main/kotlin/com/coder/toolbox/CoderRemoteProvider.kt
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,10 @@ class CoderRemoteProvider(
* Also called as part of our own logout.
*/
override fun close() {
pollJob?.cancel()
pollJob?.let {
it.cancel()
context.logger.info("Cancelled workspace poll job ${pollJob.toString()}")
}
client?.close()
lastEnvironments.clear()
environments.value = LoadableState.Value(emptyList())
Expand Down Expand Up @@ -327,6 +330,7 @@ class CoderRemoteProvider(

environments.showLoadingMessage()
pollJob = poll(restClient, cli)
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created while handling URI $uri")
isInitialized.waitForTrue()
}
} catch (ex: Exception) {
Expand Down Expand Up @@ -396,19 +400,23 @@ class CoderRemoteProvider(
private fun onConnect(client: CoderRestClient, cli: CoderCLIManager) {
// Store the URL and token for use next time.
context.secrets.lastDeploymentURL = client.url.toString()
context.secrets.lastToken = client.token ?: ""
context.secrets.storeTokenFor(client.url, context.secrets.lastToken)
context.logger.info("Deployment URL and token were stored and will be available for automatic connection")
if (context.settingsStore.requireTokenAuth) {
context.secrets.lastToken = client.token ?: ""
context.secrets.storeTokenFor(client.url, context.secrets.lastToken)
context.logger.info("Deployment URL and token were stored and will be available for automatic connection")
} else {
context.logger.info("Deployment URL was stored and will be available for automatic connection")
}
this.client = client
pollJob?.let {
it.cancel()
context.logger.info("Workspace poll job with reference ${pollJob} was canceled")
context.logger.info("Cancelled workspace poll job ${pollJob.toString()} in order to start a new one")
}
environments.showLoadingMessage()
coderHeaderPage.setTitle(context.i18n.pnotr(client.url.toString()))
context.logger.info("Displaying ${client.url} in the UI")
pollJob = poll(client, cli)
context.logger.info("Workspace poll job created with reference $pollJob")
context.logger.info("Workspace poll job with name ${pollJob.toString()} was created")
}

private fun MutableStateFlow<LoadableState<List<CoderRemoteEnvironment>>>.showLoadingMessage() {
Expand Down
Loading