@happyvertical/smrt-users 0.54.3 → 0.55.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { $ as DEFAULT_LOGIN_LOCKOUT_FACTOR, $t as Group, A as readMobileBearerToken, At as deriveOperationPermissionCollectionName, B as DEFAULT_PIN_MANAGE_PERMISSION, Bt as PermissionCollection, C as hasOperationPermission, Ct as applyTenantHierarchyUpdates, D as withSessionPermissionContext, Dt as DEFAULT_ROLE_PERMISSION_PATTERNS, E as withPrincipalPermissionContext, Et as recordTenantHierarchyChanges, F as encodeOidcTransaction, Ft as RolePermission, G as PIN_LOGIN_KIND, Gt as MembershipOverride, H as DeviceCredentialForbiddenError, Ht as UsersPasswordCredentialCollection, I as getUsersOidcConfig, It as RoleCollection, J as ensurePinPermissionsRegistered, Jt as GroupRoleCollection, K as PIN_PERMISSION_DEFINITIONS, Kt as MembershipCollection, L as resolveOidcProviderConfig, Lt as Role, M as OidcLoginError, Mt as normalizeOperationPermissionAction, N as OidcLoginService, Nt as registerPermissionDefinitions, O as MobileAuthError, Ot as RolePermissionCollection, P as decodeOidcTransaction, Pt as syncPermissionCatalog, Q as DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, Qt as GroupCollection, Rt as UsersPinCredentialCollection, S as checkOperationPermission, St as TenantHierarchyError, T as getRequestScopedDatabase, Tt as planTenantHierarchy, U as DeviceCredentialPolicyError, Ut as UsersPasswordCredential, V as DeviceCredentialError, Vt as Permission, W as DeviceCredentialService, Wt as MembershipOverrideCollection, X as PermissionResolver, Xt as GroupMemberCollection, Y as SessionService, Yt as GroupRole, Z as DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, Zt as GroupMember, _ as PasswordCredentialService, _t as TenantPermissionOverrideCollection, a as TerminalAuthError, an as UsersLoginAttemptCollection, at as LoginRateLimitError, b as OperationPermissionError, bt as Tenant, c as DEFAULT_PASSWORD_DENYLIST, cn as SessionCollection, ct as DEFAULT_ANCESTOR_READ_MAX_DEPTH, d as DEFAULT_PASSWORD_MIN_LENGTH, dn as Session, dt as normalizeAncestorReadPolicy, en as User, et as DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, f as PASSWORD_LOGIN_KIND, fn as generateSessionId, ft as OidcProvisioningError, g as PasswordCredentialForbiddenError, gt as backfillUserEmailKeys, h as PasswordCredentialError, ht as UserEmailKeyBackfillError, i as TERMINAL_APPROVE_LOGIN_KIND, in as UsersLoginAuditEvent, it as LoginAttemptLimiter, j as validateMobileRedirectUri, jt as deriveOperationPermissionSlug, k as MobileAuthService, kt as PermissionCatalogService, l as DEFAULT_PASSWORD_MANAGE_PERMISSION, ln as DEFAULT_SESSION_TTL, lt as getConfiguredAncestorReadPolicy, m as PASSWORD_PERMISSION_DEFINITIONS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nn as normalizeEmail, nt as DurableLoginAuditSink, o as TerminalAuthRateLimitError, on as UsersLoginAttempt, ot as withoutListBounds, p as PASSWORD_MAX_LENGTH_CEILING, pn as UsersCliAuthRequest, pt as UserCollection, q as PinVerifier, qt as Membership, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rn as UsersLoginAuditEventCollection, rt as InvalidCredentialsError, s as TerminalAuthService, sn as UsersCliAuthRequestCollection, st as ANCESTOR_READ_ACTION, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tn as isValidEmail, tt as DEFAULT_LOGIN_MAX_ATTEMPTS, u as DEFAULT_PASSWORD_MAX_LENGTH, un as SESSION_DATA_KEYS, ut as isAncestorReadableSlug, v as PasswordPolicyError, vt as TenantPermissionOverride, w as getCurrentSessionPermissionContext, wt as assertTenantTableName, x as assertOperationPermission, xt as MAX_TENANT_HIERARCHY_DEPTH, y as ensurePasswordPermissionsRegistered, yt as TenantCollection, z as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, zt as UsersPinCredential } from "./chunks/TerminalAuthService-Bc67JXJ5.js";
1
+ import { $ as DEFAULT_LOGIN_LOCKOUT_FACTOR, $t as Group, A as readMobileBearerToken, At as deriveOperationPermissionCollectionName, B as DEFAULT_PIN_MANAGE_PERMISSION, Bt as PermissionCollection, C as hasOperationPermission, Ct as applyTenantHierarchyUpdates, D as withSessionPermissionContext, Dt as DEFAULT_ROLE_PERMISSION_PATTERNS, E as withPrincipalPermissionContext, Et as recordTenantHierarchyChanges, F as encodeOidcTransaction, Ft as RolePermission, G as PIN_LOGIN_KIND, Gt as MembershipOverride, H as DeviceCredentialForbiddenError, Ht as UsersPasswordCredentialCollection, I as getUsersOidcConfig, It as RoleCollection, J as ensurePinPermissionsRegistered, Jt as GroupRoleCollection, K as PIN_PERMISSION_DEFINITIONS, Kt as MembershipCollection, L as resolveOidcProviderConfig, Lt as Role, M as OidcLoginError, Mt as normalizeOperationPermissionAction, N as OidcLoginService, Nt as registerPermissionDefinitions, O as MobileAuthError, Ot as RolePermissionCollection, P as decodeOidcTransaction, Pt as syncPermissionCatalog, Q as DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS, Qt as GroupCollection, Rt as UsersPinCredentialCollection, S as checkOperationPermission, St as TenantHierarchyError, T as getRequestScopedDatabase, Tt as planTenantHierarchy, U as DeviceCredentialPolicyError, Ut as UsersPasswordCredential, V as DeviceCredentialError, Vt as Permission, W as DeviceCredentialService, Wt as MembershipOverrideCollection, X as PermissionResolver, Xt as GroupMemberCollection, Y as SessionService, Yt as GroupRole, Z as DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS, Zt as GroupMember, _ as PasswordCredentialService, _t as TenantPermissionOverrideCollection, a as TerminalAuthError, an as UsersLoginAttemptCollection, at as LoginRateLimitError, b as OperationPermissionError, bt as Tenant, c as DEFAULT_PASSWORD_DENYLIST, cn as SessionCollection, ct as DEFAULT_ANCESTOR_READ_MAX_DEPTH, d as DEFAULT_PASSWORD_MIN_LENGTH, dn as Session, dt as normalizeAncestorReadPolicy, en as User, et as DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS, f as PASSWORD_LOGIN_KIND, fn as generateSessionId, ft as OidcProvisioningError, g as PasswordCredentialForbiddenError, gt as backfillUserEmailKeys, h as PasswordCredentialError, ht as UserEmailKeyBackfillError, i as TERMINAL_APPROVE_LOGIN_KIND, in as UsersLoginAuditEvent, it as LoginAttemptLimiter, j as validateMobileRedirectUri, jt as deriveOperationPermissionSlug, k as MobileAuthService, kt as PermissionCatalogService, l as DEFAULT_PASSWORD_MANAGE_PERMISSION, ln as DEFAULT_SESSION_TTL, lt as getConfiguredAncestorReadPolicy, m as PASSWORD_PERMISSION_DEFINITIONS, n as DEFAULT_CLI_AUTH_REQUEST_TTL_SECONDS, nn as normalizeEmail, nt as DurableLoginAuditSink, o as TerminalAuthRateLimitError, on as UsersLoginAttempt, ot as withoutListBounds, p as PASSWORD_MAX_LENGTH_CEILING, pn as UsersCliAuthRequest, pt as UserCollection, q as PinVerifier, qt as Membership, r as DEFAULT_CLI_SESSION_TTL_SECONDS, rn as UsersLoginAuditEventCollection, rt as InvalidCredentialsError, s as TerminalAuthService, sn as UsersCliAuthRequestCollection, st as ANCESTOR_READ_ACTION, t as DEFAULT_CLI_AUTH_POLL_INTERVAL_SECONDS, tn as isValidEmail, tt as DEFAULT_LOGIN_MAX_ATTEMPTS, u as DEFAULT_PASSWORD_MAX_LENGTH, un as SESSION_DATA_KEYS, ut as isAncestorReadableSlug, v as PasswordPolicyError, vt as TenantPermissionOverride, w as getCurrentSessionPermissionContext, wt as assertTenantTableName, x as assertOperationPermission, xt as MAX_TENANT_HIERARCHY_DEPTH, y as ensurePasswordPermissionsRegistered, yt as TenantCollection, z as DEFAULT_DEVICE_PERSON_IDLE_SECONDS, zt as UsersPinCredential } from "./chunks/TerminalAuthService-DdV-Rm4h.js";
2
2
  import { a as MembershipStatus, c as TenantPermissionEffect, i as DEFAULT_TENANT_POLICY, l as TenantStatus, n as DEFAULT_ROLES, o as OverrideEffect, r as DEFAULT_ROLE_SLUGS, s as SessionStatus, t as AccessRequestStatus, u as UserStatus } from "./chunks/types-DFqeph0R.js";
3
3
  import { ObjectRegistry, SmrtCollection, SmrtObject, bumpChangeFeed, ensureChangeFeedTable, field, findManifestEntryByQualifiedName, foreignKey, isEmbeddedDatabase, isUniqueViolationError, registerRetentionTask, smrt, unregisterRetentionTask, withEmbeddedWriteTransaction } from "@happyvertical/smrt-core";
4
4
  import { createHash, randomUUID } from "node:crypto";
@@ -1382,7 +1382,7 @@ var MagicLinkService = class MagicLinkService {
1382
1382
  * The caller is responsible for emailing the token to the user.
1383
1383
  */
1384
1384
  async generate(email) {
1385
- const { SignJWT } = await import("./chunks/TerminalAuthService-Bc67JXJ5.js").then((n) => n.R);
1385
+ const { SignJWT } = await import("./chunks/TerminalAuthService-DdV-Rm4h.js").then((n) => n.R);
1386
1386
  const key = await this.getSigningKey();
1387
1387
  const nonce = crypto.randomUUID();
1388
1388
  const normalizedEmail = normalizeEmail(email);
@@ -1411,7 +1411,7 @@ var MagicLinkService = class MagicLinkService {
1411
1411
  * @throws {MagicLinkError} If the token is invalid, expired, or already used
1412
1412
  */
1413
1413
  async verify(token) {
1414
- const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-Bc67JXJ5.js").then((n) => n.R);
1414
+ const { jwtVerify, errors } = await import("./chunks/TerminalAuthService-DdV-Rm4h.js").then((n) => n.R);
1415
1415
  const key = await this.getSigningKey();
1416
1416
  let payload;
1417
1417
  try {
@@ -2,7 +2,7 @@
2
2
  "version": "1.0.0",
3
3
  "timestamp": 0,
4
4
  "packageName": "@happyvertical/smrt-users",
5
- "packageVersion": "0.54.3",
5
+ "packageVersion": "0.55.2",
6
6
  "objects": {
7
7
  "@happyvertical/smrt-users:AccessRequestCollection": {
8
8
  "name": "accessrequestcollection",
@@ -4968,6 +4968,7 @@
4968
4968
  "extends": "SmrtObject",
4969
4969
  "exportName": "AccessRequest",
4970
4970
  "collectionExportName": "AccessRequestCollection",
4971
+ "displayLabelField": "name",
4971
4972
  "validationRules": [
4972
4973
  {
4973
4974
  "field": "email",
@@ -5261,7 +5262,13 @@
5261
5262
  "status": {
5262
5263
  "type": "text",
5263
5264
  "required": false,
5264
- "_meta": {}
5265
+ "_meta": {},
5266
+ "enum": [
5267
+ "pending",
5268
+ "approved",
5269
+ "consumed",
5270
+ "expired"
5271
+ ]
5265
5272
  },
5266
5273
  "userId": {
5267
5274
  "type": "foreignKey",
@@ -5518,6 +5525,7 @@
5518
5525
  "extends": "SmrtObject",
5519
5526
  "exportName": "Group",
5520
5527
  "collectionExportName": "GroupCollection",
5528
+ "displayLabelField": "name",
5521
5529
  "validationRules": [
5522
5530
  {
5523
5531
  "field": "tenantId",
@@ -5905,7 +5913,11 @@
5905
5913
  "required": true,
5906
5914
  "_meta": {
5907
5915
  "required": true
5908
- }
5916
+ },
5917
+ "enum": [
5918
+ "subject",
5919
+ "source"
5920
+ ]
5909
5921
  },
5910
5922
  "attemptCount": {
5911
5923
  "type": "integer",
@@ -6123,7 +6135,14 @@
6123
6135
  "required": true,
6124
6136
  "_meta": {
6125
6137
  "required": true
6126
- }
6138
+ },
6139
+ "enum": [
6140
+ "denied",
6141
+ "failed",
6142
+ "succeeded",
6143
+ "locked",
6144
+ "managed"
6145
+ ]
6127
6146
  },
6128
6147
  "subjectKeyHash": {
6129
6148
  "type": "text",
@@ -7119,6 +7138,7 @@
7119
7138
  "extends": "SmrtObject",
7120
7139
  "exportName": "Permission",
7121
7140
  "collectionExportName": "PermissionCollection",
7141
+ "displayLabelField": "name",
7122
7142
  "schema": {
7123
7143
  "tableName": "permissions",
7124
7144
  "ddl": "CREATE TABLE IF NOT EXISTS \"permissions\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"category\" TEXT DEFAULT ''\n);",
@@ -7419,7 +7439,11 @@
7419
7439
  "effect": {
7420
7440
  "type": "text",
7421
7441
  "required": false,
7422
- "_meta": {}
7442
+ "_meta": {},
7443
+ "enum": [
7444
+ "grant",
7445
+ "deny"
7446
+ ]
7423
7447
  },
7424
7448
  "canDelegate": {
7425
7449
  "type": "boolean",
@@ -7711,6 +7735,7 @@
7711
7735
  "extends": "SmrtObject",
7712
7736
  "exportName": "Role",
7713
7737
  "collectionExportName": "RoleCollection",
7738
+ "displayLabelField": "name",
7714
7739
  "schema": {
7715
7740
  "tableName": "roles",
7716
7741
  "ddl": "CREATE TABLE IF NOT EXISTS \"roles\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"tenant_id\" UUID,\n \"name\" TEXT DEFAULT '',\n \"description\" TEXT DEFAULT '',\n \"is_system\" BOOLEAN DEFAULT FALSE,\n \"inherits_to_descendants\" BOOLEAN DEFAULT FALSE\n);",
@@ -8500,6 +8525,7 @@
8500
8525
  "extends": "SmrtObject",
8501
8526
  "exportName": "Tenant",
8502
8527
  "collectionExportName": "TenantCollection",
8528
+ "displayLabelField": "name",
8503
8529
  "schema": {
8504
8530
  "tableName": "tenants",
8505
8531
  "ddl": "CREATE TABLE IF NOT EXISTS \"tenants\" (\n \"id\" UUID PRIMARY KEY NOT NULL,\n \"slug\" TEXT NOT NULL,\n \"context\" TEXT NOT NULL DEFAULT '',\n \"_meta_type\" TEXT NOT NULL,\n \"_meta_data\" JSON,\n \"created_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"updated_at\" TIMESTAMP NOT NULL DEFAULT current_timestamp,\n \"name\" TEXT DEFAULT '',\n \"status\" TEXT,\n \"description\" TEXT DEFAULT '',\n \"parent_tenant_id\" UUID,\n \"hierarchy_level\" INTEGER DEFAULT 0,\n \"hierarchy_path\" TEXT DEFAULT '',\n \"cascade_permissions\" BOOLEAN DEFAULT TRUE,\n \"inherit_permissions\" BOOLEAN DEFAULT TRUE\n);",
@@ -8653,7 +8679,14 @@
8653
8679
  "status": {
8654
8680
  "type": "text",
8655
8681
  "required": false,
8656
- "default": "unprovisioned"
8682
+ "default": "unprovisioned",
8683
+ "enum": [
8684
+ "unprovisioned",
8685
+ "provisioning",
8686
+ "active",
8687
+ "drifted",
8688
+ "failed"
8689
+ ]
8657
8690
  },
8658
8691
  "lastCheckedAt": {
8659
8692
  "type": "datetime",
@@ -3,15 +3,15 @@
3
3
  "sensitiveFieldsExcluded": true,
4
4
  "generatedAt": "1970-01-01T00:00:00.000Z",
5
5
  "packageName": "@happyvertical/smrt-users",
6
- "packageVersion": "0.54.3",
6
+ "packageVersion": "0.55.2",
7
7
  "sourceManifestPath": "dist/manifest.json",
8
8
  "agentDocPath": "AGENTS.md",
9
9
  "sourceHashes": {
10
- "manifest": "8ec5c73317366b97cec8ec93eaa78dfb59ac55446a9235918eec86f3a4ca8abb",
11
- "packageJson": "023de378de6ec6fa58be39c8a5d40055b1b459d0b6fc4115fc4087f943408074",
10
+ "manifest": "9d030b39ff492f4ec431ae26ed48570ac667f5ee9b550d532dabf83970dbe62a",
11
+ "packageJson": "af07a3e664950e4f2dd890f392191880b439336b5965f5141cecbf25d7e5da1d",
12
12
  "agents": "fa1b9005064b329b1d2387cd56307b92a79f2cd4ea951776e687f9850a428335",
13
13
  "moduleDoc:agents/permissions.md": "5f6c0afab7e1fd0887b0d29b5a5b5ab2635694207bade70145d3cbfdb62ba78c",
14
- "moduleDoc:agents/oidc-provisioning.md": "5efa607ff23b9a693391e0c02670324a8cea4114d4968c9718f10a763da919c6",
14
+ "moduleDoc:agents/oidc-provisioning.md": "b73f3fdaf61136720132a614c7e14237b7bd35f7bf5d43eabb29f565485803b9",
15
15
  "moduleDoc:agents/mobile-auth.md": "25e85e83f43e3a46383a92fa809f3a003b4545c3026e78dbe1bccbbc35161e18",
16
16
  "moduleDoc:agents/terminal-auth-testing.md": "8a84c16a19e381427aed81d3b1882344c427fe22a70e87f5ac2db836b1a6822d",
17
17
  "moduleDoc:agents/retention.md": "073874bf16ce3fbbc503157679dc7fe69800fb39a59e40299bcc713f099bf3d8"
@@ -4428,6 +4428,7 @@
4428
4428
  {
4429
4429
  "name": "AccessRequest",
4430
4430
  "qualifiedName": "@happyvertical/smrt-users:AccessRequest",
4431
+ "displayLabelField": "name",
4431
4432
  "collection": "accessrequests",
4432
4433
  "tableName": "access_requests",
4433
4434
  "packageName": "@happyvertical/smrt-users",
@@ -4757,6 +4758,7 @@
4757
4758
  {
4758
4759
  "name": "Group",
4759
4760
  "qualifiedName": "@happyvertical/smrt-users:Group",
4761
+ "displayLabelField": "name",
4760
4762
  "collection": "groups",
4761
4763
  "tableName": "groups",
4762
4764
  "packageName": "@happyvertical/smrt-users",
@@ -5747,6 +5749,7 @@
5747
5749
  {
5748
5750
  "name": "Permission",
5749
5751
  "qualifiedName": "@happyvertical/smrt-users:Permission",
5752
+ "displayLabelField": "name",
5750
5753
  "collection": "permissions",
5751
5754
  "tableName": "permissions",
5752
5755
  "packageName": "@happyvertical/smrt-users",
@@ -6145,6 +6148,7 @@
6145
6148
  {
6146
6149
  "name": "Role",
6147
6150
  "qualifiedName": "@happyvertical/smrt-users:Role",
6151
+ "displayLabelField": "name",
6148
6152
  "collection": "roles",
6149
6153
  "tableName": "roles",
6150
6154
  "packageName": "@happyvertical/smrt-users",
@@ -6888,6 +6892,7 @@
6888
6892
  {
6889
6893
  "name": "Tenant",
6890
6894
  "qualifiedName": "@happyvertical/smrt-users:Tenant",
6895
+ "displayLabelField": "name",
6891
6896
  "collection": "tenants",
6892
6897
  "tableName": "tenants",
6893
6898
  "packageName": "@happyvertical/smrt-users",
@@ -11470,7 +11475,7 @@
11470
11475
  {
11471
11476
  "path": "agents/oidc-provisioning.md",
11472
11477
  "module": "oidc-provisioning",
11473
- "content": "# OIDC provisioning\n\nRead for changes to `src/collections/UserCollection.ts`, `src/services/OidcLoginService.ts`,\nOIDC handlers, or identity migrations. The canonical scenario matrix is\n`packages/profiles/src/testing/oidcProvisioningDecisionMatrix.ts`.\n\n- **OIDC `email_verified` is enforced.** `UserCollection.getOrCreateFromOidc`\n refuses to provision a user when the IdP explicitly returns\n `email_verified: false` (opt out with `{ allowUnverifiedEmail: true }`). An\n absent claim makes no assertion and is not enforced.\n- **RFC 9207 response issuer is exact.** OIDC callbacks validate a supplied\n `iss` against discovered metadata with exact string comparison before trusting\n a code or error. If metadata advertises issuer-response support, `iss` is\n required.\n- **Verified-email Profile reuse is fail-closed.** The typed canonical scenarios\n live in\n `packages/profiles/src/testing/oidcProvisioningDecisionMatrix.ts`; both\n package suites execute that matrix and public docs reference it rather than\n maintaining another behavioral table. Default provisioning reuses only one\n unowned, global `Person`. Tenant-scoped, non-Person, duplicate-email,\n and already-owned matches fail before User/session creation. An existing\n issuer/subject link without a User must still be the unique global Person for\n the current verified claim email; once owned, the stable issuer/subject link\n reuses its canonical Person and owner.\n Issuer and subject are opaque, case-sensitive identifiers; preserve their\n exact value and use trim only to reject blank claims.\n- **`resolveProfile` is the application reconciliation boundary.** The\n SvelteKit handlers, `OidcLoginService`, and `getOrCreateFromOidc` accept the\n same hook inside the provisioning transaction. The service/handler path\n supplies protocol-validated claims; direct collection callers must validate\n and trust their claim source before calling `getOrCreateFromOidc`.\n Token/userinfo merging keeps `email` and `email_verified` paired to the same\n claim source; verification is never borrowed across sources.\n Resolver reads/writes use the supplied `db`, and the hook must be idempotent\n because a concurrent unique-key conflict can retry it. `undefined` chooses\n the secure default and `null` rejects, including exact issuer/subject reuse.\n For a new identity, a supplied Profile is still validated as the unique,\n unowned global Person for the verified email. For an exact existing identity,\n it must be the already-linked Profile and cannot rebind identity authority;\n stable-link owner and canonical-Person checks still apply. The hook receives a\n separate frozen claims snapshot; internal retry and persistence state is not\n exposed for mutation.\n- **Owned first binding requires `authorizeProfileOwner`.** An invitation or\n approval workflow may explicitly return both its pre-provisioned canonical\n global `Person` and existing approved `User` from this transaction-bound\n hook. `undefined` keeps the secure `profile_owned` default and `null`\n rejects. SMRT treats only the selected IDs as input, reloads them in the\n provisioning transaction, and requires `email_verified === true`, the unique\n canonical global Person for the normalized claim email, exactly one owner,\n that owner as the selected User, and the same normalized User email. The\n hook runs before identity/User/session creation and may be retried, so use\n only its supplied `db` and `users` handles and keep application authorization\n idempotent. Never authorize from email matching alone. Existing exact\n identities cannot be rebound; when `resolveProfile` is also present both\n hooks must select the same Profile.\n- **OIDC first login is atomic.** The Profile, `OidcIdentity`, and User are one\n transaction. The database arbiters are `OidcIdentity.identityKey`,\n private `oidc_profile_email_reservations.email_key`, `User.emailKey`, and the\n unique `User.profileId`; local callbacks acquire exact issuer/subject and normalized\n email locks in deterministic order so changed email claims also serialize.\n SQLite and DuckDB callbacks additionally serialize every root-handle statement\n the coordinator owns per database URL — `_smrt_backfills` initialization, the\n transaction, and the post-commit rebind — because one adapter multiplexes a\n single native connection and cannot safely overlap unrelated root\n transactions. Never overlap two statements on one such handle, inside a\n transaction or not: rebind and owner/email candidate reads are sequential,\n never `Promise.all`. Owner-authorized DuckDB callbacks use that same\n root-handle serialization;\n PostgreSQL deadlock and serialization errors use a bounded transaction retry.\n Newly provisioned Profiles use non-semantic per-profile slugs so equal IdP\n display names cannot trigger a natural-key upsert;\n run\n `smrt db:status`, `smrt db:migrate`, then `smrt db:status` before deployment.\n Stop or upgrade old writers first. Before migration, group\n non-null `users.profile_id` values, then reconcile duplicates. After\n migration, run public `backfillProfileEmailKeys(db)`,\n `backfillUserEmailKeys(db)`, then `backfillLegacyUserProfiles(db)` from one\n deploy process. The first two use the shared\n TypeScript `normalizeIdentityEmail()` implementation transactionally and are\n idempotent; the User backfill fails before writes if normalized duplicates\n remain. The legacy Profile backfill transactionally creates canonical global\n Persons for null/blank User links without creating OIDC identities or\n inferring ownership; reconcile any same-email Profile or reservation before\n retrying. Its marker records a completed pass but never skips newly imported\n legacy Users on a later run. Every OIDC path requires the Profile email-key\n readiness marker; creating a User or checking User email uniqueness\n additionally requires the User marker. A stable issuer/subject with an\n existing owning User skips only the User email-key lookup and marker. Full\n scans remain in the explicit deploy step; guarded runtime paths use indexed\n keys and validate only returned candidates. Multiple null links remain valid.\n Legacy race keys backfill only after canonical validation. Pass a root\n database on adapters such as DuckDB that cannot create nested savepoints.\n Root adapters must expose `beginTransaction`; transaction-only handles are\n ambiguous and fail closed before provisioning writes. Caller-owned\n transactions never run `_smrt_backfills` DDL and require that table to\n already exist; use the root database when initialization or recovery is\n needed.\n"
11478
+ "content": "# OIDC provisioning\n\nRead for changes to `src/collections/UserCollection.ts`, `src/services/OidcLoginService.ts`,\nOIDC handlers, or identity migrations. The canonical scenario matrix is\n`packages/profiles/src/testing/oidcProvisioningDecisionMatrix.ts`.\n\n- **OIDC `email_verified` is enforced.** `UserCollection.getOrCreateFromOidc`\n refuses to provision a user when the IdP explicitly returns\n `email_verified: false` (opt out with `{ allowUnverifiedEmail: true }`). An\n absent claim makes no assertion and is not enforced.\n- **RFC 9207 response issuer is exact.** OIDC callbacks validate a supplied\n `iss` against discovered metadata with exact string comparison before trusting\n a code or error. If metadata advertises issuer-response support, `iss` is\n required.\n- **The login start route is the IdP landing URL (#3569).** Kanidm drops a\n pending authorization after any detour through its `/ui/login` and strands the\n user in its apps panel; the client landing URL is the only way back.\n `getOidcClientRegistration()` derives it from `loginPath` (default\n `/auth/<provider>/login`) alongside the callback URL; keep the login handler\n safe to enter with no query string.\n- **Verified-email Profile reuse is fail-closed.** The typed canonical scenarios\n live in\n `packages/profiles/src/testing/oidcProvisioningDecisionMatrix.ts`; both\n package suites execute that matrix and public docs reference it rather than\n maintaining another behavioral table. Default provisioning reuses only one\n unowned, global `Person`. Tenant-scoped, non-Person, duplicate-email,\n and already-owned matches fail before User/session creation. An existing\n issuer/subject link without a User must still be the unique global Person for\n the current verified claim email; once owned, the stable issuer/subject link\n reuses its canonical Person and owner.\n Issuer and subject are opaque, case-sensitive identifiers; preserve their\n exact value and use trim only to reject blank claims.\n- **`resolveProfile` is the application reconciliation boundary.** The\n SvelteKit handlers, `OidcLoginService`, and `getOrCreateFromOidc` accept the\n same hook inside the provisioning transaction. The service/handler path\n supplies protocol-validated claims; direct collection callers must validate\n and trust their claim source before calling `getOrCreateFromOidc`.\n Token/userinfo merging keeps `email` and `email_verified` paired to the same\n claim source; verification is never borrowed across sources.\n Resolver reads/writes use the supplied `db`, and the hook must be idempotent\n because a concurrent unique-key conflict can retry it. `undefined` chooses\n the secure default and `null` rejects, including exact issuer/subject reuse.\n For a new identity, a supplied Profile is still validated as the unique,\n unowned global Person for the verified email. For an exact existing identity,\n it must be the already-linked Profile and cannot rebind identity authority;\n stable-link owner and canonical-Person checks still apply. The hook receives a\n separate frozen claims snapshot; internal retry and persistence state is not\n exposed for mutation.\n- **Owned first binding requires `authorizeProfileOwner`.** An invitation or\n approval workflow may explicitly return both its pre-provisioned canonical\n global `Person` and existing approved `User` from this transaction-bound\n hook. `undefined` keeps the secure `profile_owned` default and `null`\n rejects. SMRT treats only the selected IDs as input, reloads them in the\n provisioning transaction, and requires `email_verified === true`, the unique\n canonical global Person for the normalized claim email, exactly one owner,\n that owner as the selected User, and the same normalized User email. The\n hook runs before identity/User/session creation and may be retried, so use\n only its supplied `db` and `users` handles and keep application authorization\n idempotent. Never authorize from email matching alone. Existing exact\n identities cannot be rebound; when `resolveProfile` is also present both\n hooks must select the same Profile.\n- **OIDC first login is atomic.** The Profile, `OidcIdentity`, and User are one\n transaction. The database arbiters are `OidcIdentity.identityKey`,\n private `oidc_profile_email_reservations.email_key`, `User.emailKey`, and the\n unique `User.profileId`; local callbacks acquire exact issuer/subject and normalized\n email locks in deterministic order so changed email claims also serialize.\n SQLite and DuckDB callbacks additionally serialize every root-handle statement\n the coordinator owns per database URL — `_smrt_backfills` initialization, the\n transaction, and the post-commit rebind — because one adapter multiplexes a\n single native connection and cannot safely overlap unrelated root\n transactions. Never overlap two statements on one such handle, inside a\n transaction or not: rebind and owner/email candidate reads are sequential,\n never `Promise.all`. Owner-authorized DuckDB callbacks use that same\n root-handle serialization;\n PostgreSQL deadlock and serialization errors use a bounded transaction retry.\n Newly provisioned Profiles use non-semantic per-profile slugs so equal IdP\n display names cannot trigger a natural-key upsert;\n run\n `smrt db:status`, `smrt db:migrate`, then `smrt db:status` before deployment.\n Stop or upgrade old writers first. Before migration, group\n non-null `users.profile_id` values, then reconcile duplicates. After\n migration, run public `backfillProfileEmailKeys(db)`,\n `backfillUserEmailKeys(db)`, then `backfillLegacyUserProfiles(db)` from one\n deploy process. The first two use the shared\n TypeScript `normalizeIdentityEmail()` implementation transactionally and are\n idempotent; the User backfill fails before writes if normalized duplicates\n remain. The legacy Profile backfill transactionally creates canonical global\n Persons for null/blank User links without creating OIDC identities or\n inferring ownership; reconcile any same-email Profile or reservation before\n retrying. Its marker records a completed pass but never skips newly imported\n legacy Users on a later run. Every OIDC path requires the Profile email-key\n readiness marker; creating a User or checking User email uniqueness\n additionally requires the User marker. A stable issuer/subject with an\n existing owning User skips only the User email-key lookup and marker. Full\n scans remain in the explicit deploy step; guarded runtime paths use indexed\n keys and validate only returned candidates. Multiple null links remain valid.\n Legacy race keys backfill only after canonical validation. Pass a root\n database on adapters such as DuckDB that cannot create nested savepoints.\n Root adapters must expose `beginTransaction`; transaction-only handles are\n ambiguous and fail closed before provisioning writes. Caller-owned\n transactions never run `_smrt_backfills` DDL and require that table to\n already exist; use the root database when initialization or recovery is\n needed.\n"
11474
11479
  },
11475
11480
  {
11476
11481
  "path": "agents/mobile-auth.md",
@@ -99,6 +99,12 @@ export interface OidcSvelteKitOptions extends SmrtClassOptions, OidcProviderReso
99
99
  provider?: OidcProviderResolver;
100
100
  /** Callback path used when provider.redirectUri is omitted. */
101
101
  callbackPath?: string | ((providerName: string) => string);
102
+ /**
103
+ * Path of the route that starts the login (the `createOidcLoginHandler`
104
+ * route). Defaults to `/auth/<provider>/login`. Only used to derive the
105
+ * IdP landing URL in {@link getOidcClientRegistration}.
106
+ */
107
+ loginPath?: string | ((providerName: string) => string);
102
108
  /** Query parameter used to preserve post-login redirects. */
103
109
  returnToParam?: string;
104
110
  /** Prefix for the temporary OIDC transaction cookie. */
@@ -142,6 +148,18 @@ export interface OidcSvelteKitOptions extends SmrtClassOptions, OidcProviderReso
142
148
  /** Redirect target after failed callback. If omitted, failures return 401. */
143
149
  failureRedirect?: string | ((error: unknown, event: SvelteKitRequestEvent) => string);
144
150
  }
151
+ /** URLs to register with the IdP for one SMRT OIDC client. */
152
+ export interface OidcClientRegistration {
153
+ providerName: string;
154
+ /** Callback URL: register as the client's allowed redirect URL. */
155
+ redirectUri: string;
156
+ /**
157
+ * Login start URL: register as the client's landing / initiate-login URL
158
+ * (Kanidm `set-landing-url`). The IdP links its app tile here, so a user
159
+ * whose pending authorization the IdP discarded can resume sign-in.
160
+ */
161
+ landingUrl: string;
162
+ }
145
163
  export interface BeginOidcLoginResult {
146
164
  providerName: string;
147
165
  transaction: OidcTransaction;
@@ -314,6 +332,30 @@ export declare function beginOidcLogin(event: SvelteKitRequestEvent, options: Oi
314
332
  * the session cookie.
315
333
  */
316
334
  export declare function completeOidcLogin(event: SvelteKitRequestEvent, options: OidcSvelteKitOptions): Promise<CompleteOidcLoginResult>;
335
+ /**
336
+ * Derive the URLs an IdP client registration must carry for this app, from the
337
+ * same options the login and callback handlers use.
338
+ *
339
+ * Register `redirectUri` as the allowed redirect URL and `landingUrl` as the
340
+ * client's landing URL. Kanidm discards a pending authorization whenever the
341
+ * user detours through its own login page (for example "Return to Login"
342
+ * after a mistyped password) and then lands the user in its apps panel; the
343
+ * landing URL is the only way back, so it must start the app's login rather
344
+ * than open its signed-out home page.
345
+ *
346
+ * @example
347
+ * ```typescript
348
+ * const { redirectUri, landingUrl } = getOidcClientRegistration(
349
+ * 'https://app.example.com',
350
+ * { provider: 'kanidm' },
351
+ * );
352
+ * // kanidm system oauth2 add-redirect-url <client> <redirectUri>
353
+ * // kanidm system oauth2 set-landing-url <client> <landingUrl>
354
+ * ```
355
+ */
356
+ export declare function getOidcClientRegistration(origin: string | URL, options?: Omit<OidcSvelteKitOptions, 'provider'> & {
357
+ provider?: string;
358
+ }): OidcClientRegistration;
317
359
  /**
318
360
  * Create a SvelteKit GET handler that redirects to an OIDC provider.
319
361
  *
@@ -326,6 +368,9 @@ export declare function completeOidcLogin(event: SvelteKitRequestEvent, options:
326
368
  * db: { type: 'postgres', url: process.env.DATABASE_URL! },
327
369
  * });
328
370
  * ```
371
+ *
372
+ * Register this route as the IdP client's landing URL; see
373
+ * {@link getOidcClientRegistration}.
329
374
  */
330
375
  export declare function createOidcLoginHandler(options: OidcSvelteKitOptions): (event: SvelteKitRequestEvent) => Promise<Response>;
331
376
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/sveltekit/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AASH,OAAO,yBAAyB,CAAC;AAGjC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACjE,OAAO,KAAK,EACV,0BAA0B,EAC1B,mBAAmB,EACpB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,eAAe,EAGpB,KAAK,6BAA6B,EAClC,KAAK,eAAe,EAGrB,MAAM,iCAAiC,CAAC;AAGzC,OAAO,EAEL,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,KAAK,0BAA0B,EAChC,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,iBAAiB,EACtB,KAAK,mBAAmB,EACxB,6BAA6B,EAC7B,kCAAkC,EAClC,KAAK,mBAAmB,EACxB,KAAK,0BAA0B,EAC/B,gCAAgC,EAChC,KAAK,4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BAAwB,CAuF1B;AAuBD,OAAO,EACL,iBAAiB,EACjB,0BAA0B,EAC1B,mBAAmB,EACnB,KAAK,0BAA0B,GAChC,CAAC"}
package/dist/sveltekit.js CHANGED
@@ -1,4 +1,4 @@
1
- import { A as readMobileBearerToken, D as withSessionPermissionContext, F as encodeOidcTransaction, H as DeviceCredentialForbiddenError, I as getUsersOidcConfig, L as resolveOidcProviderConfig, M as OidcLoginError, N as OidcLoginService, O as MobileAuthError, P as decodeOidcTransaction, U as DeviceCredentialPolicyError, V as DeviceCredentialError, W as DeviceCredentialService, Y as SessionService, _ as PasswordCredentialService, a as TerminalAuthError, at as LoginRateLimitError, b as OperationPermissionError, g as PasswordCredentialForbiddenError, h as PasswordCredentialError, j as validateMobileRedirectUri, k as MobileAuthService, o as TerminalAuthRateLimitError, s as TerminalAuthService, v as PasswordPolicyError } from "./chunks/TerminalAuthService-Bc67JXJ5.js";
1
+ import { A as readMobileBearerToken, D as withSessionPermissionContext, F as encodeOidcTransaction, H as DeviceCredentialForbiddenError, I as getUsersOidcConfig, L as resolveOidcProviderConfig, M as OidcLoginError, N as OidcLoginService, O as MobileAuthError, P as decodeOidcTransaction, U as DeviceCredentialPolicyError, V as DeviceCredentialError, W as DeviceCredentialService, Y as SessionService, _ as PasswordCredentialService, a as TerminalAuthError, at as LoginRateLimitError, b as OperationPermissionError, g as PasswordCredentialForbiddenError, h as PasswordCredentialError, j as validateMobileRedirectUri, k as MobileAuthService, o as TerminalAuthRateLimitError, s as TerminalAuthService, v as PasswordPolicyError } from "./chunks/TerminalAuthService-DdV-Rm4h.js";
2
2
  import { DiscoveryArtifactValidationError, SMRT_APP_RESULT_CONTRACT, SMRT_APP_RESULT_SCHEMA, SMRT_APP_RESULT_VERSION, SMRT_DISCOVERY_CONFORMANCE_ARTIFACT_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_VERSION, SMRT_MCP_RESULT_METADATA_KEY, canonicalizeDiscoveryArtifact, createDiscoveryConformanceArtifact, deriveCommandRequirements, validateDiscoveryConformanceArtifact } from "./app-contract.js";
3
3
  import { ObjectRegistry, createClassNamePredicate, resolveCustomActionMetadata, resolveEffectiveActionMetadata } from "@happyvertical/smrt-core";
4
4
  import { createLogger } from "@happyvertical/logger";
@@ -1052,6 +1052,10 @@ function resolveCallbackPath(providerName, options) {
1052
1052
  if (typeof options.callbackPath === "function") return options.callbackPath(providerName);
1053
1053
  return options.callbackPath ?? `/auth/${providerName}/callback`;
1054
1054
  }
1055
+ function resolveLoginPath(providerName, options) {
1056
+ if (typeof options.loginPath === "function") return options.loginPath(providerName);
1057
+ return options.loginPath ?? `/auth/${providerName}/login`;
1058
+ }
1055
1059
  function resolveProviderWithRedirectUri(event, providerName, provider, options) {
1056
1060
  return {
1057
1061
  ...provider,
@@ -1203,6 +1207,15 @@ async function completeOidcLogin(event, options) {
1203
1207
  event.cookies.delete(cookieName, { path: cookiePath });
1204
1208
  }
1205
1209
  }
1210
+ function getOidcClientRegistration(origin, options = {}) {
1211
+ const resolved = resolveOidcProviderConfig(options.provider, options);
1212
+ const baseOrigin = new URL(origin).origin;
1213
+ return {
1214
+ providerName: resolved.providerName,
1215
+ redirectUri: resolved.provider.redirectUri ?? new URL(resolveCallbackPath(resolved.providerName, options), baseOrigin).toString(),
1216
+ landingUrl: new URL(resolveLoginPath(resolved.providerName, options), baseOrigin).toString()
1217
+ };
1218
+ }
1206
1219
  function createOidcLoginHandler(options) {
1207
1220
  return async (event) => {
1208
1221
  const { url } = await beginOidcLogin(event, options);
@@ -1364,6 +1377,6 @@ var NO_STORE_HEADERS = {
1364
1377
  pragma: "no-cache"
1365
1378
  };
1366
1379
  //#endregion
1367
- export { DiscoveryArtifactValidationError, InvalidBearerError, MobileAuthError, MobileAuthService, SMRT_APP_RESULT_CONTRACT, SMRT_APP_RESULT_SCHEMA, SMRT_APP_RESULT_VERSION, SMRT_DISCOVERY_CONFORMANCE_ARTIFACT_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_VERSION, SMRT_MCP_RESULT_METADATA_KEY, TerminalAuthError, TerminalAuthRateLimitError, TerminalAuthService, beginOidcLogin, canonicalizeDiscoveryArtifact, completeOidcLogin, createBearerSessionDeleteHandler, createDeviceCredentialHandlers, createDiscoveryConformanceArtifact, createMobileAuthHandlers, createOidcCallbackHandler, createOidcLoginHandler, createPasswordCredentialHandlers, createResourceListHandler, createSessionCookie, createSessionHandler, createTerminalAuthStartHandler, createTerminalAuthTokenHandler, defaultSessionLocals, deriveCommandRequirements, destroySessionCookie, loadBearerSessionContext, mountTerminalLoginPage, parseBearerToken, readMobileBearerToken, resolveMobileUploadDedupKey, switchSessionTenant, validateDiscoveryConformanceArtifact, validateMobileRedirectUri };
1380
+ export { DiscoveryArtifactValidationError, InvalidBearerError, MobileAuthError, MobileAuthService, SMRT_APP_RESULT_CONTRACT, SMRT_APP_RESULT_SCHEMA, SMRT_APP_RESULT_VERSION, SMRT_DISCOVERY_CONFORMANCE_ARTIFACT_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_SCHEMA, SMRT_DISCOVERY_CONFORMANCE_VERSION, SMRT_MCP_RESULT_METADATA_KEY, TerminalAuthError, TerminalAuthRateLimitError, TerminalAuthService, beginOidcLogin, canonicalizeDiscoveryArtifact, completeOidcLogin, createBearerSessionDeleteHandler, createDeviceCredentialHandlers, createDiscoveryConformanceArtifact, createMobileAuthHandlers, createOidcCallbackHandler, createOidcLoginHandler, createPasswordCredentialHandlers, createResourceListHandler, createSessionCookie, createSessionHandler, createTerminalAuthStartHandler, createTerminalAuthTokenHandler, defaultSessionLocals, deriveCommandRequirements, destroySessionCookie, getOidcClientRegistration, loadBearerSessionContext, mountTerminalLoginPage, parseBearerToken, readMobileBearerToken, resolveMobileUploadDedupKey, switchSessionTenant, validateDiscoveryConformanceArtifact, validateMobileRedirectUri };
1368
1381
 
1369
1382
  //# sourceMappingURL=sveltekit.js.map