Skip to content

Commit

Permalink
Add @internalapi to clearToken
Browse files Browse the repository at this point in the history
  • Loading branch information
osipxd committed Feb 10, 2025
1 parent 5c29a57 commit b7e4963
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public class BasicAuthProvider(
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.auth.providers.BasicAuthProvider.clearToken)
*/
@InternalAPI // TODO KTOR-8180: Provide control over tokens to user code
public fun clearToken() {
tokensHolder.clearToken()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -231,6 +231,7 @@ public class DigestAuthProvider(
*
* [Report a problem](https://ktor.io/feedback/?fqname=io.ktor.client.plugins.auth.providers.DigestAuthProvider.clearToken)
*/
@InternalAPI // TODO KTOR-8180: Provide control over tokens to user code
public fun clearToken() {
tokenHolder.clearToken()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import io.ktor.client.plugins.auth.providers.*
import io.ktor.client.request.*
import io.ktor.http.*
import io.ktor.http.auth.*
import io.ktor.utils.io.*
import kotlinx.coroutines.test.runTest
import kotlin.test.Test
import kotlin.test.assertEquals
Expand Down Expand Up @@ -50,6 +51,7 @@ class BasicProviderTest {
assertTrue(provider.isApplicable(header), "Provider with capitalized scheme should be applicable")
}

@OptIn(InternalAPI::class)
@Test
fun `update credentials after clearToken`() = runTest {
var credentials = BasicAuthCredentials("admin", "admin")
Expand Down

0 comments on commit b7e4963

Please sign in to comment.