4.2 KiB
4.2 KiB
TASK-011: Sign in and list accessible repositories
Status: code complete and independently reviewed — device E2E pending Owner: Codex Reviewer: Claude
Outcome
A user can sign in to the configured company Gitea through the system browser and see every repository visible to that account in a localized read-only list.
Scope
- Included: system-browser OAuth, verified HTTPS App Link callback, PKCE code exchange, authenticated identity check, Keystore-backed token storage, logout, paged
/user/reposloading, and login/loading/content/empty/error UI states. - Excluded: branches, file browsing, commits, diffs, pull requests, issues, offline repository caching, and every write operation.
Writable paths
app/build.gradle.ktsgradle/libs.versions.tomlapp/src/main/AndroidManifest.xmlapp/src/main/java/com/ubisam/ubgitea/MainActivity.ktapp/src/main/java/com/ubisam/ubgitea/core/auth/android/app/src/main/java/com/ubisam/ubgitea/core/network/app/src/main/java/com/ubisam/ubgitea/data/auth/app/src/main/java/com/ubisam/ubgitea/data/repositories/app/src/main/java/com/ubisam/ubgitea/feature/repositories/- Matching test paths
app/src/main/res/values/strings_repositories.xmlapp/src/main/res/xml/data_extraction_rules.xmltasks/002b-oauth-android-integration.mdtasks/004-gitea-api-client.mdtasks/005-repository-branch-ui.mdtasks/011-login-repository-list.mddocs/development-log.md
Acceptance criteria
- Login opens an external browsable HTTPS intent and no WebView dependency or component exists.
- The manifest accepts only the configured verified HTTPS callback host and path.
- Callback processing uses TASK-002A validation and clears pending verifier/state on every terminal result.
- Code exchange sends client ID, redirect URI, original verifier, and no client secret.
- Access/refresh tokens are encrypted with an Android Keystore key, excluded from backup, redacted from string output, and removed on logout.
- The authenticated
/api/v1/usercall confirms the account before repository loading. /api/v1/user/reposfollows pagination to completion, deduplicates by stable repository ID, and has a bounded page count.- DTOs remain in data packages; UI models contain no token, HTTP, or Android persistence types.
- UI has localized signed-out, browser-waiting, loading, content, empty, authentication-expired, permission-denied, offline, and server-error states.
- Repository rows identify owner/name, visibility, optional description, and default branch; logout is explicit.
- Unit tests cover exchange form, callback terminal clearing, token codec, repository mapping/pagination/deduplication, and error mapping.
- Build, unit tests, lint, focused tests, secret scan, and independent review pass.
External evidence
- OAuth application is configured as a public client with the registered redirect URI.
https://gitea.ubisampaju.synology.me/.well-known/assetlinks.jsonpublicly servescom.ubisam.ubgiteawith both development certificate fingerprints.
Required checks
./gradlew assembleDebug
./gradlew testDebugUnitTest
./gradlew lintDebug
Evidence
./gradlew testDebugUnitTest assembleDebug lintDebug— passed; 57 tests across 16 suites, 0 failures/errors; debug APK and lint report generated.- Focused authentication, callback, token-codec, HTTP transport, repository pagination/mapping, error mapping, and immutable UI-state tests passed.
git diff --checkand the sensitive-pattern scan passed; no WebView or production client secret exists.- Independent review confirmed the browser/App Link, PKCE, Keystore/backup, identity-before-repositories, and bounded pagination design. Its P1 browser-cancellation, response-read, and token-retained error-recovery findings were fixed, together with signed-in error/logout UX, nullable DTO validation, immutable snapshots, and focused regression tests. Final re-review found no remaining P0/P1.
- Hosted
assetlinks.jsonwas visually confirmed by the product owner with both development signing fingerprints. No Android device is connected to this workstation, so actual browser callback and authenticated live-server E2E remain a manual verification step.