Skip to content

[Epic] Migrate SCIM from @better-auth/scim 1.7.0-rc.1 to stable 1.7.x — seven-model provision, sys_scim_provider disposition, token reissue coordination, net-new Setup surface #11632

Description

@os-zhuang

Chartered by maintainer ruling, 2026-08-24, live PM chat on #3653 (「os#3653 立项迁移」). The spec half of #3653's question A is thereby answered implement — the SCIMGroup family becomes true through this migration, not through retirement.

Scope (from the measured chartering input — #3653 comments 5386605190 / 5387582046, the seven-model diff)

  1. Platform objects: provision the seven stable models (scimConnectionBinding, scimIdentityTombstone, scimSubject, scimUser, scimProjectionGrant, scimGroup, scimGroupMember); decide whether managedConnections (the conditional trio scimManagedConnection/scimManagedCredential/scimManagedConnectionEvent) is adopted — stable's managed catalog partially restores DB-backed runtime connections, so sys_scim_provider's disposition (retire vs facade vs managed-catalog adoption) is decided INSIDE this epic with that fact on the table.
  2. plugin-auth: scim({...}) call gains stable's required options (storeSCIMToken is gone; connections / verifyBearerToken / managedConnections three-way); AUTH_MODEL_TO_PROTOCOL entries for the new models (stable accepts no schema option — adapter bridging remains the only naming route).
  3. spec: field-level parity pass between SCIMGroupSchema and stable's group wire shape (unmeasured so far); packages/spec work goes to the spec seat per single-owner rule.
  4. Parity gate: restructure better-auth-schema-parity.test.ts per the Fix the SCIM parity gate's constructor call so it actually prints the seven-model diff against @better-auth/scim 1.7.1 #11380/PR fix(plugin-auth): make the SCIM parity gate reach its model diff on stable @better-auth/scim #11429 repair (its constructor fix is a prerequisite — land or absorb it).
  5. Setup surface: net-new build (objectui and cloud measured at zero SCIM UI today); stable's serverOnly managed-catalog endpoints are the natural backend seam.
  6. ⚠️ Operator coordination: token digests are NOT portable on any path (unsalted SHA-256 → keyed HMAC; stable forces credential expiry) — every SCIM-enabled deployment's IdP reissues its token on migration day. This is a scheduled operational action inside the epic, not a discovery.
  7. Scaffold allowedVersions suppressions retire with the pin move (the two presence-ratchet tests must flip in the same stroke); ⛔ the better-auth>better-sqlite3 and @better-auth/utils entries do NOT retire with it.

Discipline

Contract-first decomposition by the owning seat: parent (this card) + sub-issues per surface, spec first, Blocked-by: chains between legs. Standing operational note until the migration lands: SCIM-enabled deployments must not let the IdP push groups.

Refs: #3653 (decision anchor + measurements) · #11380 / PR #11429 (gate repair) · #11372 (workspace comment correction) · ADR-0071.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions