A first Google sign-in mints an account only under an app's invite grant #18

Merged
eureka merged 6 commits from hands/heimdall-invite-grant-mints into main 2026-11-29 20:04:07 +00:00
Owner

Cut gamecult-chat:cut_spec:cut-heimdall-invite-grant-mints.r1; ruling eureka-body:ruling:first-invite-sign-in-providers.

  • AppProfile.mayGrantFirstLogin (Bifrost sets it).
  • Start accepts firstLoginGrant: "invite" only on sign_in, only from the profile's own authenticated app caller (reuses the existing app-caller gate), only for a profile that may grant; else 401 app_auth_required / 400 first_login_grant_refused.
  • The grant rides only in the signed state (first_login_grant), validated with the other fields; a grant with a non-sign_in mode is an invalid state.
  • Callback: no account holds the identity and the state carries the grant mints the account and audits account_minted_by_grant; otherwise identity_not_linked as before. An existing holder signs in as today; mode: link is unchanged.
  • docs/service-contract.md Google section updated.

Tests on Yggdrasil (node:24, submodule built): typecheck clean, 744 passed / 208 skipped.

Not deployed.

Cut `gamecult-chat:cut_spec:cut-heimdall-invite-grant-mints.r1`; ruling `eureka-body:ruling:first-invite-sign-in-providers`. - `AppProfile.mayGrantFirstLogin` (Bifrost sets it). - Start accepts `firstLoginGrant: "invite"` only on `sign_in`, only from the profile's own authenticated app caller (reuses the existing app-caller gate), only for a profile that may grant; else 401 `app_auth_required` / 400 `first_login_grant_refused`. - The grant rides only in the signed state (`first_login_grant`), validated with the other fields; a grant with a non-sign_in mode is an invalid state. - Callback: no account holds the identity and the state carries the grant mints the account and audits `account_minted_by_grant`; otherwise `identity_not_linked` as before. An existing holder signs in as today; `mode: link` is unchanged. - `docs/service-contract.md` Google section updated. Tests on Yggdrasil (node:24, submodule built): typecheck clean, 744 passed / 208 skipped. Not deployed.
Bifrost's profile may grant; its authenticated sign_in start may carry firstLoginGrant invite.
The callback mints only when no account holds the identity; otherwise identity_not_linked stands.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
eureka merged commit 2bcb2ca4e7 into main 2026-11-29 20:04:07 +00:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
GameCult/Heimdall!18
No description provided.