Skip to content

Check the account and link flows against the backend, show passkey providers - #72

Merged
markusressel merged 1 commit into
masterfrom
feature/account-live-check
Oct 31, 2026
Merged

markusressel merged 1 commit into
masterfrom
feature/account-live-check

Conversation

@markusressel

Copy link
Copy Markdown
Member

Follow-up to #70 after backend #39 (TOTP, account) and #40 (passkeys) reached master.

Live checks against backend master (5f5a133)

I built backend master locally with rateLimits.disabled: true, webauthn.rpId, the CI debug package in webauthn.android, and clientUrl. All opt-in live tests pass:

  • LiveAuthTest (3): login, sessions, sign out other devices, logout, wrong password.
  • LiveAccountTest (new):
    • GET/PATCH /account/ and the password change
    • TOTP enrolment, with the code computed from the otpauth:// URI like an authenticator app; a wrong code gives 400; confirming again gives 409
    • login with the second factor: a TOTP code pasted with a space, and a recovery code (the remaining count drops to 9)
    • step-up with password and code, then new recovery codes
    • passkeys: add (provider reported as "Bitwarden", synced), discoverable login, step-up with a passkey, rename, delete
    • at the end the test removes TOTP and puts the old password and display name back
  • LiveLinkTest (new): an admin creates invites. AuthLinkParser reads the invite URL, and new accounts are created with a password and with a passkey only. The passkey account then signs in with its passkey.

The passkeys come from SoftwareAuthenticator, a port of the backend's passkeytest package. It sends the JSON Credential Manager returns, with the Android origin of the CI debug build (android:apk-key-hash:dKdF-sJKv73wpzCDGHH-pt4kbGvS4_hiSSQnH8TTcEg). This also checks the origin the backend derives from server.auth.webauthn.android.

The backend's /.well-known/assetlinks.json (with serveAssetLinks: true) gives exactly the statement computed from .ci/debug.keystore: handle_all_urls and get_login_creds for de.markusressel.mkdocseditor.debug.

./gradlew :auth:testDebugUnitTest --tests '*Live*' \
  -Pmkdocs.backend.url=http://127.0.0.1:7413 \
  -Pmkdocs.backend.users=alice:password -Pmkdocs.backend.admin=admin:password

App changes for the two additive backend deviations

  • Passkey objects have an optional provider. The account screen shows it next to the dates, for example "Bitwarden · Added … · synced". lastUsedAt is null until first use and shows "never".
  • POST /account/totp/confirm/ without a pending enrolment gives 409 conflict. The setup dialog closes and says the setup expired and must be started again.

Unit tests: an AccountViewModelTest for the expired enrolment and an OkHttpAuthApiTest for the provider and a null lastUsedAt. ./gradlew testDebugUnitTest app:assembleDebug passes (157 tests; the live tests are skipped without properties).

🤖 Generated with Claude Code

…oviders

The opt-in live tests now cover what the account screen and the link
screen call, against a running backend:

- LiveAccountTest: profile, password change, TOTP enrolment with a code
  computed from the otpauth URI, the second factor at login with a TOTP
  code and with a recovery code, step-up, new recovery codes, and
  passkeys (add, discoverable login, step-up, rename, delete).
- LiveLinkTest: an admin creates invites; accounts are created from the
  invite URL with a password and with a passkey only.

Passkeys come from a software authenticator that answers like Bitwarden
in Credential Manager (attestation none, synced, the Android origin of
the CI debug build), ported from the backend's passkeytest package.

The account screen shows the passkey provider the backend reports (for
example "Bitwarden"), and an expired TOTP enrolment (409 conflict on
confirm) closes the dialog and asks to start again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@markusressel
markusressel merged commit 28ef513 into master Oct 31, 2026
3 of 4 checks passed
@markusressel
markusressel deleted the feature/account-live-check branch October 31, 2026 23:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant