Files
Jason RhinelanderandClaude Opus 4.8 ec840151b4 tests/pro_backend: fix seed_payment obfuscated-account-id derivation
The backend dropped the `{google,apple}_obfuscated_account_id_from_master_pkey`
helpers, so seed_payment.py's [pro_live] seeding died with
`AttributeError: module 'backend' has no attribute
'apple_obfuscated_account_id_from_master_pkey'`.

The account tag each provider attests changed, and the seeded witnessed-payment
row must equal what the backend now recomputes from the request-signed master key
at redeem time (backend.py add_pro_payment):
- Google: the client sets setObfuscatedAccountId to the master pubkey verbatim
  (no more sha256), so the id is the raw 32-byte master pubkey -> `bytes(vk)`.
- Apple: appAccountToken = UUID(first 16 bytes of the master pubkey) via
  providers.app_store.uuid_from_master_pk, stored lowercased.

Import the Apple provider lazily (its module pulls the Apple SDK) so seeding a
non-Apple payment doesn't require it.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
2026-07-27 18:18:14 -03:00
..