KInMemoryTokenStore
class KInMemoryTokenStore(initialAccessToken: String? = null, initialRefreshToken: String? = null) : KTokenStore(source)
In-memory KTokenStore implementation.
Tokens are never persisted — they are lost when the instance is discarded. Intended for unit tests and mock environments where persistence is undesirable.
Usage:
// In tests
val store = KInMemoryTokenStore()
val session = KSessionManager(store)
// Pre-seed a token for authenticated tests
val store = KInMemoryTokenStore(
initialAccessToken = "test-access-token",
initialRefreshToken = "test-refresh-token",
)Content copied to clipboard
Parameters
initialAccessToken
Optional pre-seeded access token.
initialRefreshToken
Optional pre-seeded refresh token.