test(auth): end-to-end placement tests for the bunyip login path (PMS-249) #182
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/mapps-249-bunyip-login-e2e"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
What
Closes the last gap from the org-membership work: the full "authenticate via Bunyip -> land in the right tenant" path was only unit/service-tested because it ran through a live OIDC verifier.
How
Extracts the verifier-free core of
ensure_user_from_bunyipintopub place_bunyip_user(auth, tenants, invitations, sub, email, email_verified, claims)- everything after the userinfo fetch (tenant resolution, re-home, JIT mirror, invite accept, role reconciliation,AuthState).ensure_user_from_bunyipnow just fetches userinfo and delegates, so behavior is unchanged; the placement logic is drivable with stubbedemail/email_verified, no network.tests/bunyip_login.rs(placement asserted on theusersrow):bunyip_role=subscribertranslation (PMS-172); the invite is consumed;personaltenant (owned by them, not the shared default);Verification
cargo check --all-targets+cargo clippy --all-targetsclean;bunyip_login(4),tenants(7),invitations(6),auth(14) pass. (One auth test flaked once on sqlx test-db provisioning and passed on rerun - unrelated.)🤖 Generated with Claude Code