Package-level declarations

Types

Link copied to clipboard
object ApiConfig
Link copied to clipboard
interface AuthApi
Link copied to clipboard

Bridges the platform entry point (e.g. Android's MainActivity.onNewIntent, which captures the AuthConfig.GOOGLE_REDIRECT_URI redirect the auth server sends after OAuth completes) into the Compose layer, which has no direct access to that entry point.

Link copied to clipboard
class KtorAuthApi(client: HttpClient) : AuthApi
Link copied to clipboard
class KtorMeApi(client: HttpClient) : MeApi

Uses the main (demo-aware, bearer-attaching) HttpClient — the same one the posts API uses.

Link copied to clipboard
class KtorPostsApi(client: HttpClient) : PostsApi
Link copied to clipboard
class KtorTopicsApi(client: HttpClient) : TopicsApi
Link copied to clipboard
interface MeApi

The skimbyte-server routes about the current user (as opposed to AuthApi, which talks to the auth server at ApiConfig.AUTH_BASE_URL).

Link copied to clipboard
data class Page<T>(val items: List<T>, val nextCursor: String?)
Link copied to clipboard
interface PostsApi
Link copied to clipboard
class RefreshCoordinator(sessionStorage: SessionStorage)

The app runs two independent Ktor HttpClients against SessionStorage — the general one in networkModule and the dedicated one in authModule — each with its own Auth plugin, so each only single-flights refreshes against itself. The server's refresh token is single-use, so without cross-client coordination, concurrent 401s on both clients can each present the same stored refresh token; the second submission gets flagged as replay and the whole session is revoked. This mutex serializes refresh attempts across every client sharing it (wire the same Koin-provided instance into both), and a caller that loses the race is handed whatever the winner already stored instead of replaying a token that's already been consumed.

Link copied to clipboard
interface TopicsApi

Functions

Link copied to clipboard
fun createHttpClient(sessionStorage: SessionStorage, refreshCoordinator: RefreshCoordinator): HttpClient
Link copied to clipboard

Whether this failure means the request never reached the server, as opposed to the server responding with an error status.

Link copied to clipboard
fun <T, R> PageDto<T>.toDomain(mapItem: (T) -> R): Page<R>