Skip to content

Commit

Permalink
Merge pull request #18 from collectiveidea/dependency-updates
Browse files Browse the repository at this point in the history
Dependency updates; Ktor 3
  • Loading branch information
darronschall authored Nov 24, 2024
2 parents 15962b4 + 89bf5bd commit bd0b4f1
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 16 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

## [Unreleased]

* Update dependencies. See [#17](https://github.com/collectiveidea/twirp-kmp/pull/17)
* Bump Kotlin from 2.0.20 to 2.0.21
* Runtime - Bump Ktor to 3.0.1
* Runtime - Bump kotlinx-serialization to 1.7.3
* Bump pbandk to 0.16.0
* **BREAKING** Rename project from twirp-kmm to twirp-kmp. See [#16](https://github.com/collectiveidea/twirp-kmm/pull/16)
* Generator - Ensure generator .jar artifact is built for Java 8. See [#15](https://github.com/collectiveidea/twirp-kmm/pull/15).

Expand Down
8 changes: 4 additions & 4 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[versions]
kotlin = "2.0.20"
kotlin = "2.0.21"
android-gradle-plugin = "8.5.2"

kotlinx-serialization = "1.7.1"
ktor = "2.3.12"
pbandk = "0.15.0"
kotlinx-serialization = "1.7.3"
ktor = "3.0.1"
pbandk = "0.16.0"

[libraries]
kotlin-test = { module = "org.jetbrains.kotlin:kotlin-test", version.ref = "kotlin" }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,12 @@
package com.collectiveidea.ktor

import io.ktor.client.HttpClient
import io.ktor.client.plugins.auth.Auth
import io.ktor.client.plugins.auth.authProvider
import io.ktor.client.plugins.auth.providers.BearerAuthProvider
import io.ktor.client.plugins.plugin

// Force the Auth plugin to invoke the `loadTokens` block again.
// See: https://stackoverflow.com/q/72064782 and https://stackoverflow.com/a/67316630
// and https://youtrack.jetbrains.com/issue/KTOR-4759/Auth-BearerAuthProvider-caches-result-of-loadToken-until-process-death
public fun HttpClient.invalidateBearerTokens() {
try {
plugin(Auth)
.providers
.filterIsInstance<BearerAuthProvider>()
.first()
.clearToken()
} catch (e: IllegalStateException) {
// No-op; plugin not installed
}
authProvider<BearerAuthProvider>()?.clearToken()
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package com.collectiveidea.twirp

import kotlinx.serialization.decodeFromString
import kotlinx.serialization.json.Json
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down

0 comments on commit bd0b4f1

Please sign in to comment.