refactor: store API keys in app preferences

This commit is contained in:
2026-03-15 21:42:31 -04:00
parent 30f9ac6b98
commit 5016704627
10 changed files with 214 additions and 85 deletions

View File

@@ -10,7 +10,6 @@ Kanbn4Droid is an unofficial app to connect to and manipulate data stored in sel
- AndroidX Preferences library.
- AndroidX SplashScreen library.
- AndroidX Credential Manager library.
- Kotlin coroutines (Android dispatcher).
## Current bootstrap status
@@ -48,10 +47,12 @@ Kanbn4Droid is an unofficial app to connect to and manipulate data stored in sel
- The view has fields to request the user for an instance base URL (http or https, with or without port number) and an API key.
- The default base URL is that of the standard Kan.bn instance at https://kan.bn/
- The view tries to check connection with the server at the given base URL using the Kan.bn API healthcheck endpoint.
- The API key is managed using Android's own Credential Manager.
- The API key is stored in app preferences together with the base URL.
- No migration is performed from prior Credential Manager storage, so users must re-enter their API key one time after upgrading.
- On success, the view stores the URL and API key pair in preferences and moves over to the boards view.
- If there is a URL and API Key pair stored, the view tries to authenticate the user through the API automatically and proceeds to the boards view instantly without showing the login screen if successful.
- Current status: implemented in `MainActivity` with XML views and a temporary boards destination (`BoardsPlaceholderActivity`) while the real boards list view is still pending.
- If startup authentication fails due to invalid credentials then the stored API key is invalidated; transient connectivity/server failures keep the stored key and return to login.
- Current status: implemented in `MainActivity` with XML views and navigation into `BoardsActivity`.
**Boards list view**
- Displays a list of boards as rounded-square cards with the board's title centered in it.