Skip to content

Maestro auth bootstrap: pick a mechanism for authenticated KYC/Buy/Sell flows #553

@TaprootFreak

Description

@TaprootFreak

Context

#543 (Tier 3 Maestro scale-out) blocks 27 of 31 new flows on this decision. Onboarding flows start from cold-boot; KYC / Buy / Sell / Transaction-History / Support / Settings-User-Data flows need an authenticated session + DFX JWT + (for KYC) a known KYC state on the backend. No existing Maestro flow touches the API.

This issue picks the auth-bootstrap mechanism and delivers it as a reusable Maestro fixture.

Options

Option A — Debug-auth shortcut flow

Reuse the existing /debugAuth route (lib/screens/debug_auth/debug_auth_page.dart, kDebugMode-gated at router_config.dart:90-95). Maestro walks: cold-boot → tap "Address + Signature" card on welcome → enter test wallet address → emit DebugAuthCompleteEvent → land at dashboard with seeded JWT.

  • Pros: Zero new infrastructure; route already exists.
  • Cons: Requires kDebugMode build flag honored in CI (Maestro tests already run debug builds, so should work — verify); seeds a wallet without persisting through WalletService.createDebugWallet's full path; backend still needs a real or stubbed user.

Option B — Fake DFX-API base URL

Point the app at a recorded-response fixture server (e.g. localhost:8089 running a static JSON server) during Maestro runs. Set apiHost via --dart-define=API_HOST=... (requires the env-flag mechanism that doesn't exist today; tied to the /debugAuth env-flag issue).

  • Pros: Deterministic, no backend dependency; same fixtures across flows.
  • Cons: New plumbing; fixtures need to be authored and maintained as the API evolves.

Option C — Dedicated test backend instance

Provision a real DFX-API DEV instance with pre-provisioned users at known KYC states.

  • Pros: Highest fidelity; flushes real regressions.
  • Cons: Operational cost; test users need ongoing curation; KYC providers (Sumsub) may rate-limit or block test traffic.

Deliverable

  1. Decision: A / B / C
  2. The chosen mechanism implemented as a reusable Maestro flow snippet (e.g. .maestro/handbook/_setup-authenticated.yaml) that other flows include via runFlow
  3. Documentation in docs/testing.md under "Tier 3" explaining how to use it
  4. Validation by porting one existing-but-unauthenticated flow to use it (e.g. 27-buy-asset-selection.yaml)

Acceptance criteria

Estimated effort

Option Days
A — debug-auth Maestro snippet 1.0
B — fixture server + env-flag wiring + snippet 3.0
C — backend provisioning + snippet 2.0 + ops cost

Decision itself: 0.5 day. Total including decision + implementation: 1.5-3.5 engineer-days.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions