feat(jit): consume bunyip given_name/family_name claims (BUNYIP-141) #327
No reviewers
Labels
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
psa-systems/mokosh-server!327
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/bunyip-141-jit-consume-name-claims"
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?
Third slice of BUNYIP-103, mokosh-server half. Bunyip's /oauth2/userinfo
now emits given_name + family_name standard OIDC claims when the at+jwt's
scope set carries
profileAND the user has filled them in on bunyip(BUNYIP-139 + BUNYIP-140). Wire those claims through to the JIT path so
a bunyip-provisioned user lands in mokosh-server with their real name on
first sight instead of
synthetic_name_from_email's email-local-partplaceholder.
oidc_rs::UserInfoadds optionalgiven_name/family_name/phone_number(the third unused by mokosh today but pinned for thenext env change). NULL columns serialize as ABSENT per BUNYIP-140, so
Option<String>is the right shape for every branch.ensure_user_from_bunyip(middleware) reads them off the sameuserinfo round-trip that already fetches email + email_verified.
place_bunyip_useradds two args threading the hints toupsert_user_from_oidc. Suppressed clippy::too_many_arguments locallysince bundling these into a synthetic struct would force every test
call site (7 of them) to construct that struct from the same fields.
upsert_user_from_oidcwrites the claim hint when both are non-empty,falls back to
synthetic_name_from_emailotherwise. Subsequent JITruns (the ON CONFLICT DO UPDATE branch) refresh only email +
updated_at - they do NOT overwrite first_name / last_name, so a tenant
admin or the user's own future /profile screen edit is never silently
reverted on next login.
Test surface: all 7
place_bunyip_usercall sites intests/bunyip_login.rs grow None, None for the two new claim args.
Existing synthetic-name tests in service.rs unchanged - they still cover
the fallback path, which fires when both hints are None or empty.
just pre-commitgreen (fmt + clippy -D warnings + workspace compile#BUNYIP-141
#BUNYIP-103
Co-Authored-By: Claude Opus 4.7 noreply@anthropic.com