All checks were successful
PR Checks / android-build (pull_request) Successful in 9m41s
Implements M3 (docs/android/PLAN.md §4): the functional Kotlin auth pass.
- Native username/password (+ single-request TOTP) login over the existing
POST /auth/mobile/login; a 401 { totpRequired } reveals the code field, 429
surfaces a backoff message (§4.1).
- Token pair in EncryptedSharedPreferences (TokenStore behind SessionManager,
the single source of truth for the in-memory bearer + observable Session);
base URL stays in plain DataStore (§4.3).
- OkHttp AuthInterceptor (bearer) + TokenAuthenticator: one-shot, mutex-
serialized refresh-on-401 that replays the request, on its own bare client so
it can never recurse; single-use rotation; dead refresh signs out, transient
network keeps the session.
- Logout (POST /auth/mobile/logout, this session or all devices) tears down
locally even on failure.
- GET /auth/me re-validates the role on every resume; a surviving 401 signs out
(role stays advisory — backend is authority).
- Declarative access-level menu (visibleEntries: public/signed-in/player) with a
Sign in / Sign out toggle + a My Account screen.
- Custom-Tab hand-offs (androidx.browser) to the website for register / forgot-
password / SSO — no native screens (§4.2).
- Settings → Server switch now also clears the stored session (§3).
Biometric app-lock is deferred to M6 (tokens already encrypted at rest; it is
opt-in UX, not a v1 requirement — decided at M3).
JVM unit tests (18): auth-DTO decode (incl. totpRequired vs a plain credential
401), the SessionManager lifecycle over a fake store, and the menu access filter
+ role mapping. No backend/API change — a pure consumer of the existing mobile
bearer + /auth/me surface.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NgyHnrNa8WwG3doxvxjuCr
104 lines
5.0 KiB
TOML
104 lines
5.0 KiB
TOML
# Version catalog — single source of truth for dependency + plugin versions.
|
||
# The full app stack (per docs/android/PLAN.md §2) is declared here so later
|
||
# milestones (M1–M4) reference libraries by alias without re-pinning versions.
|
||
# The M0 skeleton only wires the subset it actually compiles against.
|
||
|
||
[versions]
|
||
# Build toolchain
|
||
agp = "8.6.1"
|
||
kotlin = "2.0.20"
|
||
ksp = "2.0.20-1.0.25"
|
||
|
||
# AndroidX core / lifecycle / activity
|
||
coreKtx = "1.13.1"
|
||
lifecycle = "2.8.5"
|
||
activityCompose = "1.9.2"
|
||
|
||
# Compose
|
||
composeBom = "2024.09.02"
|
||
navigationCompose = "2.8.0"
|
||
|
||
# DI
|
||
hilt = "2.52"
|
||
hiltNavigationCompose = "1.2.0"
|
||
|
||
# Networking
|
||
retrofit = "2.11.0"
|
||
okhttp = "4.12.0"
|
||
kotlinxSerialization = "1.7.1"
|
||
retrofitSerializationConverter = "1.0.0"
|
||
|
||
# Storage
|
||
datastore = "1.1.1"
|
||
securityCrypto = "1.1.0-alpha06"
|
||
|
||
# Web hand-off (Chrome Custom Tabs) — §4.2
|
||
browser = "1.8.0"
|
||
|
||
# Images
|
||
coil = "2.7.0"
|
||
|
||
# Testing
|
||
junit = "4.13.2"
|
||
androidxTestExtJunit = "1.2.1"
|
||
espressoCore = "3.6.1"
|
||
coroutinesTest = "1.8.1"
|
||
|
||
[libraries]
|
||
# Core / lifecycle / activity
|
||
androidx-core-ktx = { group = "androidx.core", name = "core-ktx", version.ref = "coreKtx" }
|
||
androidx-lifecycle-runtime-ktx = { group = "androidx.lifecycle", name = "lifecycle-runtime-ktx", version.ref = "lifecycle" }
|
||
androidx-lifecycle-runtime-compose = { group = "androidx.lifecycle", name = "lifecycle-runtime-compose", version.ref = "lifecycle" }
|
||
androidx-lifecycle-viewmodel-compose = { group = "androidx.lifecycle", name = "lifecycle-viewmodel-compose", version.ref = "lifecycle" }
|
||
androidx-activity-compose = { group = "androidx.activity", name = "activity-compose", version.ref = "activityCompose" }
|
||
|
||
# Compose (versions come from the BOM)
|
||
androidx-compose-bom = { group = "androidx.compose", name = "compose-bom", version.ref = "composeBom" }
|
||
androidx-compose-ui = { group = "androidx.compose.ui", name = "ui" }
|
||
androidx-compose-ui-graphics = { group = "androidx.compose.ui", name = "ui-graphics" }
|
||
androidx-compose-ui-tooling = { group = "androidx.compose.ui", name = "ui-tooling" }
|
||
androidx-compose-ui-tooling-preview = { group = "androidx.compose.ui", name = "ui-tooling-preview" }
|
||
androidx-compose-ui-test-manifest = { group = "androidx.compose.ui", name = "ui-test-manifest" }
|
||
androidx-compose-ui-test-junit4 = { group = "androidx.compose.ui", name = "ui-test-junit4" }
|
||
androidx-compose-material3 = { group = "androidx.compose.material3", name = "material3" }
|
||
androidx-compose-material-icons-core = { group = "androidx.compose.material", name = "material-icons-core" }
|
||
androidx-navigation-compose = { group = "androidx.navigation", name = "navigation-compose", version.ref = "navigationCompose" }
|
||
|
||
# DI
|
||
hilt-android = { group = "com.google.dagger", name = "hilt-android", version.ref = "hilt" }
|
||
hilt-compiler = { group = "com.google.dagger", name = "hilt-compiler", version.ref = "hilt" }
|
||
androidx-hilt-navigation-compose = { group = "androidx.hilt", name = "hilt-navigation-compose", version.ref = "hiltNavigationCompose" }
|
||
|
||
# Networking
|
||
retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref = "retrofit" }
|
||
okhttp-bom = { group = "com.squareup.okhttp3", name = "okhttp-bom", version.ref = "okhttp" }
|
||
okhttp = { group = "com.squareup.okhttp3", name = "okhttp" }
|
||
okhttp-logging-interceptor = { group = "com.squareup.okhttp3", name = "logging-interceptor" }
|
||
okhttp-sse = { group = "com.squareup.okhttp3", name = "okhttp-sse" }
|
||
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerialization" }
|
||
retrofit-kotlinx-serialization-converter = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "retrofitSerializationConverter" }
|
||
|
||
# Storage
|
||
androidx-datastore-preferences = { group = "androidx.datastore", name = "datastore-preferences", version.ref = "datastore" }
|
||
androidx-security-crypto = { group = "androidx.security", name = "security-crypto", version.ref = "securityCrypto" }
|
||
|
||
# Web hand-off
|
||
androidx-browser = { group = "androidx.browser", name = "browser", version.ref = "browser" }
|
||
|
||
# Images
|
||
coil-compose = { group = "io.coil-kt", name = "coil-compose", version.ref = "coil" }
|
||
|
||
# Testing
|
||
junit = { group = "junit", name = "junit", version.ref = "junit" }
|
||
kotlinx-coroutines-test = { group = "org.jetbrains.kotlinx", name = "kotlinx-coroutines-test", version.ref = "coroutinesTest" }
|
||
androidx-test-ext-junit = { group = "androidx.test.ext", name = "junit", version.ref = "androidxTestExtJunit" }
|
||
androidx-espresso-core = { group = "androidx.test.espresso", name = "espresso-core", version.ref = "espressoCore" }
|
||
|
||
[plugins]
|
||
android-application = { id = "com.android.application", version.ref = "agp" }
|
||
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
|
||
kotlin-compose = { id = "org.jetbrains.kotlin.plugin.compose", version.ref = "kotlin" }
|
||
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }
|
||
ksp = { id = "com.google.devtools.ksp", version.ref = "ksp" }
|
||
hilt = { id = "com.google.dagger.hilt.android", version.ref = "hilt" }
|