@happyvertical/smrt-users 0.61.3 → 0.61.4

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.
Files changed (34) hide show
  1. package/README.md +6 -1
  2. package/agents/oidc-provisioning.md +3 -1
  3. package/dist/chunks/{PasswordCredentialService-CYBl9GAn.js → PasswordCredentialService-BfYi-lfi.js} +37 -11
  4. package/dist/chunks/PasswordCredentialService-BfYi-lfi.js.map +1 -0
  5. package/dist/chunks/TerminalAuthService-BMa7Wdm1.js +4144 -0
  6. package/dist/chunks/TerminalAuthService-BMa7Wdm1.js.map +1 -0
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.d.ts.map +1 -1
  9. package/dist/index.js +32 -11
  10. package/dist/index.js.map +1 -1
  11. package/dist/manifest.json +1640 -634
  12. package/dist/migrations/backfillLegacyUserProfiles.d.ts +21 -1
  13. package/dist/migrations/backfillLegacyUserProfiles.d.ts.map +1 -1
  14. package/dist/models/CliAuthRequest.d.ts.map +1 -1
  15. package/dist/models/GroupMember.d.ts.map +1 -1
  16. package/dist/models/LoginAttempt.d.ts.map +1 -1
  17. package/dist/models/MembershipOverride.d.ts.map +1 -1
  18. package/dist/models/OAuthAuthorization.d.ts.map +1 -1
  19. package/dist/models/PasskeyChallenge.d.ts.map +1 -1
  20. package/dist/models/PasskeyCredential.d.ts.map +1 -1
  21. package/dist/models/PasswordCredential.d.ts.map +1 -1
  22. package/dist/models/PinCredential.d.ts.map +1 -1
  23. package/dist/models/ResourceGrant.d.ts.map +1 -1
  24. package/dist/models/RolePermission.d.ts.map +1 -1
  25. package/dist/models/TenantPermissionOverride.d.ts.map +1 -1
  26. package/dist/operator.js +1 -1
  27. package/dist/services/canonical-mailbox-identity.d.ts.map +1 -1
  28. package/dist/smrt-knowledge.json +7 -7
  29. package/dist/smrt-knowledge.okf.md +2 -2
  30. package/dist/sveltekit.js +2 -2
  31. package/package.json +12 -12
  32. package/dist/chunks/PasswordCredentialService-CYBl9GAn.js.map +0 -1
  33. package/dist/chunks/TerminalAuthService-BdRQxnPc.js +0 -4137
  34. package/dist/chunks/TerminalAuthService-BdRQxnPc.js.map +0 -1
package/README.md CHANGED
@@ -706,7 +706,12 @@ and links a canonical global Person for each User whose Profile link is still
706
706
  null or blank. It preserves the User ID and data, creates no OIDC identity, and
707
707
  never infers ownership from email: any same-email Profile, duplicate User email,
708
708
  or conflicting reservation must be reconciled explicitly before retrying. Its
709
- marker records a successful pass but does not hide Users imported later. All
709
+ marker records a successful pass but does not hide Users imported later. A
710
+ profileless User with no email fails with `missing_email` by default; hosts
711
+ holding non-person identities (service or agent Users) call
712
+ `backfillLegacyUserProfiles(db, { withoutEmail: 'skip' })`, which leaves them
713
+ untouched. The result is `{ created, linked, skipped }`, where `skipped` counts
714
+ those Users (always `0` without the option). All
710
715
  OIDC paths require the Profile
711
716
  marker; paths that create a User or arbitrate User email uniqueness also require
712
717
  the User marker. Run all three before enabling OIDC provisioning. Pass the
@@ -87,7 +87,9 @@ OIDC handlers, or identity migrations. The canonical scenario matrix is
87
87
  remain. The legacy Profile backfill transactionally creates canonical global
88
88
  Persons for null/blank User links without creating OIDC identities or
89
89
  inferring ownership; reconcile any same-email Profile or reservation before
90
- retrying. Its marker records a completed pass but never skips newly imported
90
+ retrying. It returns `{ created, linked, skipped }`; a profileless User without
91
+ an email fails with `missing_email` unless `{ withoutEmail: 'skip' }` is passed
92
+ for non-person identities. Its marker records a completed pass but never skips newly imported
91
93
  legacy Users on a later run. Every OIDC path requires the Profile email-key
92
94
  readiness marker; creating a User or checking User email uniqueness
93
95
  additionally requires the User marker. A stable issuer/subject with an
@@ -62,9 +62,18 @@ var Membership = class extends SmrtObject {
62
62
  }
63
63
  };
64
64
  __publicField$14(Membership, "__smrtPackage__", "@happyvertical/smrt-users");
65
- __decorateClass$14([foreignKey("User", { required: true }), field({ description: "The person who belongs to this organization." })], Membership.prototype, "userId", 2);
66
- __decorateClass$14([foreignKey("Tenant", { required: true })], Membership.prototype, "tenantId", 2);
67
- __decorateClass$14([foreignKey("Role", { required: true }), field({ description: "The role that determines this member's permissions." })], Membership.prototype, "roleId", 2);
65
+ __decorateClass$14([foreignKey("User", {
66
+ required: true,
67
+ requiredFor: "identity"
68
+ }), field({ description: "The person who belongs to this organization." })], Membership.prototype, "userId", 2);
69
+ __decorateClass$14([foreignKey("Tenant", {
70
+ required: true,
71
+ requiredFor: "tenant-scope"
72
+ })], Membership.prototype, "tenantId", 2);
73
+ __decorateClass$14([foreignKey("Role", {
74
+ required: true,
75
+ requiredFor: "identity"
76
+ }), field({ description: "The role that determines this member's permissions." })], Membership.prototype, "roleId", 2);
68
77
  __decorateClass$14([field({
69
78
  description: "Whether this membership is active, pending, or inactive.",
70
79
  type: "text"
@@ -973,6 +982,7 @@ __publicField$9(UsersLoginAttempt, "__smrtPackage__", "@happyvertical/smrt-users
973
982
  __decorateClass$9([field({
974
983
  type: "text",
975
984
  required: true,
985
+ requiredFor: "identity",
976
986
  unique: true
977
987
  })], UsersLoginAttempt.prototype, "limiterKey", 2);
978
988
  __decorateClass$9([field({
@@ -1251,10 +1261,7 @@ var UsersLoginAuditEvent = class extends SmrtObject {
1251
1261
  }
1252
1262
  };
1253
1263
  __publicField$8(UsersLoginAuditEvent, "__smrtPackage__", "@happyvertical/smrt-users");
1254
- __decorateClass$8([field({
1255
- type: "text",
1256
- required: true
1257
- })], UsersLoginAuditEvent.prototype, "kind", 2);
1264
+ __decorateClass$8([field({ type: "text" })], UsersLoginAuditEvent.prototype, "kind", 2);
1258
1265
  __decorateClass$8([field({
1259
1266
  type: "text",
1260
1267
  required: true
@@ -1338,7 +1345,10 @@ var Group = class extends SmrtObject {
1338
1345
  }
1339
1346
  };
1340
1347
  __publicField$7(Group, "__smrtPackage__", "@happyvertical/smrt-users");
1341
- __decorateClass$7([foreignKey("Tenant", { required: true })], Group.prototype, "tenantId", 2);
1348
+ __decorateClass$7([foreignKey("Tenant", {
1349
+ required: true,
1350
+ requiredFor: "tenant-scope"
1351
+ })], Group.prototype, "tenantId", 2);
1342
1352
  Group = __decorateClass$7([smrt({
1343
1353
  api: { include: ["list", "get"] },
1344
1354
  mcp: { include: ["list", "get"] },
@@ -1400,10 +1410,12 @@ var GroupMember = class extends SmrtObject {
1400
1410
  __publicField$6(GroupMember, "__smrtPackage__", "@happyvertical/smrt-users");
1401
1411
  __decorateClass$6([foreignKey("Group", {
1402
1412
  required: true,
1413
+ requiredFor: "identity",
1403
1414
  onDelete: "NO ACTION"
1404
1415
  })], GroupMember.prototype, "groupId", 2);
1405
1416
  __decorateClass$6([foreignKey("User", {
1406
1417
  required: true,
1418
+ requiredFor: "identity",
1407
1419
  onDelete: "NO ACTION"
1408
1420
  })], GroupMember.prototype, "userId", 2);
1409
1421
  GroupMember = __decorateClass$6([smrt({
@@ -1538,8 +1550,14 @@ var GroupRole = class extends SmrtObject {
1538
1550
  }
1539
1551
  };
1540
1552
  __publicField$5(GroupRole, "__smrtPackage__", "@happyvertical/smrt-users");
1541
- __decorateClass$5([foreignKey("Group", { required: true })], GroupRole.prototype, "groupId", 2);
1542
- __decorateClass$5([foreignKey("Role", { required: true })], GroupRole.prototype, "roleId", 2);
1553
+ __decorateClass$5([foreignKey("Group", {
1554
+ required: true,
1555
+ requiredFor: "identity"
1556
+ })], GroupRole.prototype, "groupId", 2);
1557
+ __decorateClass$5([foreignKey("Role", {
1558
+ required: true,
1559
+ requiredFor: "identity"
1560
+ })], GroupRole.prototype, "roleId", 2);
1543
1561
  GroupRole = __decorateClass$5([smrt({
1544
1562
  api: { include: ["list", "get"] },
1545
1563
  mcp: { include: ["list", "get"] },
@@ -1735,10 +1753,12 @@ var MembershipOverride = class extends SmrtObject {
1735
1753
  __publicField$4(MembershipOverride, "__smrtPackage__", "@happyvertical/smrt-users");
1736
1754
  __decorateClass$4([foreignKey("Membership", {
1737
1755
  required: true,
1756
+ requiredFor: "identity",
1738
1757
  onDelete: "NO ACTION"
1739
1758
  })], MembershipOverride.prototype, "membershipId", 2);
1740
1759
  __decorateClass$4([foreignKey("Permission", {
1741
1760
  required: true,
1761
+ requiredFor: "identity",
1742
1762
  onDelete: "NO ACTION"
1743
1763
  })], MembershipOverride.prototype, "permissionId", 2);
1744
1764
  __decorateClass$4([field({ type: "text" })], MembershipOverride.prototype, "effect", 2);
@@ -1860,11 +1880,13 @@ var UsersPasswordCredential = class extends SmrtObject {
1860
1880
  __publicField$3(UsersPasswordCredential, "__smrtPackage__", "@happyvertical/smrt-users");
1861
1881
  __decorateClass$3([foreignKey("User", {
1862
1882
  required: true,
1883
+ requiredFor: "identity",
1863
1884
  unique: true
1864
1885
  })], UsersPasswordCredential.prototype, "userId", 2);
1865
1886
  __decorateClass$3([field({
1866
1887
  type: "text",
1867
1888
  required: true,
1889
+ requiredFor: "authentication",
1868
1890
  sensitive: true
1869
1891
  })], UsersPasswordCredential.prototype, "passwordHash", 2);
1870
1892
  __decorateClass$3([field({
@@ -2207,10 +2229,12 @@ var RolePermission = class extends SmrtObject {
2207
2229
  __publicField$2(RolePermission, "__smrtPackage__", "@happyvertical/smrt-users");
2208
2230
  __decorateClass$2([foreignKey("Role", {
2209
2231
  required: true,
2232
+ requiredFor: "identity",
2210
2233
  onDelete: "NO ACTION"
2211
2234
  })], RolePermission.prototype, "roleId", 2);
2212
2235
  __decorateClass$2([foreignKey("Permission", {
2213
2236
  required: true,
2237
+ requiredFor: "identity",
2214
2238
  onDelete: "NO ACTION"
2215
2239
  })], RolePermission.prototype, "permissionId", 2);
2216
2240
  RolePermission = __decorateClass$2([smrt({
@@ -3794,10 +3818,12 @@ var TenantPermissionOverride = class extends SmrtObject {
3794
3818
  __publicField(TenantPermissionOverride, "__smrtPackage__", "@happyvertical/smrt-users");
3795
3819
  __decorateClass([foreignKey("Tenant", {
3796
3820
  required: true,
3821
+ requiredFor: "identity",
3797
3822
  onDelete: "NO ACTION"
3798
3823
  })], TenantPermissionOverride.prototype, "tenantId", 2);
3799
3824
  __decorateClass([foreignKey("Permission", {
3800
3825
  required: true,
3826
+ requiredFor: "identity",
3801
3827
  onDelete: "NO ACTION"
3802
3828
  })], TenantPermissionOverride.prototype, "permissionId", 2);
3803
3829
  __decorateClass([field({ type: "text" })], TenantPermissionOverride.prototype, "effect", 2);
@@ -6360,4 +6386,4 @@ var PasswordCredentialService = class PasswordCredentialService {
6360
6386
  //#endregion
6361
6387
  export { PermissionCatalogService as $, InvalidCredentialsError as A, STEP_UP_SIGN_IN_AUTH_METHODS as At, backfillUserEmailKeys as B, DEFAULT_LOGIN_ATTEMPT_WINDOW_SECONDS as C, SessionCollection as Ct, DEFAULT_LOGIN_MAX_ATTEMPTS as D, normalizeUsername as Dt, DEFAULT_LOGIN_LOCKOUT_MAX_SECONDS as E, normalizeEmail as Et, OidcProvisioningError as F, Membership as Ft, MAX_TENANT_HIERARCHY_DEPTH as G, TenantPermissionOverride as H, UserCollection as I, __exportAll as It, assertTenantTableName as J, TenantHierarchyError as K, requireExistingOwnedPerson as L, LoginRateLimitError as M, generateSessionId as Mt, hashSecret as N, Role as Nt, DEFAULT_SOURCE_LOCKOUT_AUDIT_SECONDS as O, DEFAULT_SESSION_TTL as Ot, verifySecretHash as P, Permission as Pt, RolePermissionCollection as Q, USER_EMAIL_KEY_BACKFILL_NAME as R, normalizeAncestorReadPolicy as S, UsersLoginAttempt as St, DEFAULT_LOGIN_LOCKOUT_FACTOR as T, isValidEmail as Tt, TenantCollection as U, TenantPermissionOverrideCollection as V, Tenant as W, recordTenantHierarchyChanges as X, planTenantHierarchy as Y, DEFAULT_ROLE_PERMISSION_PATTERNS as Z, PermissionResolver as _, GroupCollection as _t, DEFAULT_PASSWORD_RECOVERY_MAX_AGE_SECONDS as a, RolePermission as at, getConfiguredAncestorReadPolicy as b, UsersLoginAuditEvent as bt, PASSWORD_PERMISSION_DEFINITIONS as c, UsersPasswordCredentialCollection as ct, PasswordCredentialForbiddenError as d, MembershipOverride as dt, deriveOperationPermissionCollectionName as et, PasswordCredentialService as f, MembershipCollection as ft, SessionService as g, GroupMember as gt, outOfBandProofSessionData as h, GroupMemberCollection as ht, DEFAULT_PASSWORD_MIN_LENGTH as i, withoutListBounds as it, LoginAttemptLimiter as j, Session as jt, DurableLoginAuditSink as k, SESSION_DATA_KEYS as kt, PASSWORD_RECOVERY_MAX_AGE_CEILING_SECONDS as l, UsersPasswordCredential as lt, ensurePasswordPermissionsRegistered as m, GroupRole as mt, DEFAULT_PASSWORD_MANAGE_PERMISSION as n, normalizeOperationPermissionAction as nt, PASSWORD_LOGIN_KIND as o, RoleCollection as ot, PasswordPolicyError as p, GroupRoleCollection as pt, applyTenantHierarchyUpdates as q, DEFAULT_PASSWORD_MAX_LENGTH as r, syncPermissionCatalog as rt, PASSWORD_MAX_LENGTH_CEILING as s, PermissionCollection as st, DEFAULT_PASSWORD_DENYLIST as t, deriveOperationPermissionSlug as tt, PasswordCredentialError as u, MembershipOverrideCollection as ut, ANCESTOR_READ_ACTION as v, Group as vt, DEFAULT_LOGIN_LOCKOUT_BASE_SECONDS as w, User as wt, isAncestorReadableSlug as x, UsersLoginAttemptCollection as xt, DEFAULT_ANCESTOR_READ_MAX_DEPTH as y, UsersLoginAuditEventCollection as yt, UserEmailKeyBackfillError as z };
6362
6388
 
6363
- //# sourceMappingURL=PasswordCredentialService-CYBl9GAn.js.map
6389
+ //# sourceMappingURL=PasswordCredentialService-BfYi-lfi.js.map