@happyvertical/smrt-users 0.49.3 → 0.49.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.
- package/dist/chunks/{TerminalAuthService-D6i0WoaZ.js → TerminalAuthService-BuOM9zbU.js} +2 -2
- package/dist/chunks/{TerminalAuthService-D6i0WoaZ.js.map → TerminalAuthService-BuOM9zbU.js.map} +1 -1
- package/dist/index.js +3 -3
- package/dist/manifest.json +868 -94
- package/dist/smrt-knowledge.json +16 -16
- package/dist/sveltekit.js +1 -1
- package/package.json +9 -9
package/dist/smrt-knowledge.json
CHANGED
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
"sensitiveFieldsExcluded": true,
|
|
4
4
|
"generatedAt": "1970-01-01T00:00:00.000Z",
|
|
5
5
|
"packageName": "@happyvertical/smrt-users",
|
|
6
|
-
"packageVersion": "0.49.
|
|
6
|
+
"packageVersion": "0.49.4",
|
|
7
7
|
"sourceManifestPath": "dist/manifest.json",
|
|
8
8
|
"agentDocPath": "AGENTS.md",
|
|
9
9
|
"sourceHashes": {
|
|
10
|
-
"manifest": "
|
|
11
|
-
"packageJson": "
|
|
10
|
+
"manifest": "b6818d9adf076e7c783abbdeb0edca091d0691f2971782c9ac1d6dcb907821ae",
|
|
11
|
+
"packageJson": "11c1d92f6c815c4bd35bfe70f2d1675c4f34d078900d20486eae31fd04a06c5a",
|
|
12
12
|
"agents": "ec09e41d9c5e1b55abf454eb5b88a98637094e2aa67bffce2f11db0dcb68b441",
|
|
13
13
|
"moduleDoc:agents/permissions.md": "f801411ae51fc625ad99054e284fd1abc6e7b2a5555dd8797a83dfd30273db68",
|
|
14
14
|
"moduleDoc:agents/oidc-provisioning.md": "5efa607ff23b9a693391e0c02670324a8cea4114d4968c9718f10a763da919c6",
|
|
@@ -422,7 +422,7 @@
|
|
|
422
422
|
"name": "GroupCollection",
|
|
423
423
|
"qualifiedName": "@happyvertical/smrt-users:GroupCollection",
|
|
424
424
|
"collection": "groups",
|
|
425
|
-
"tableName": "
|
|
425
|
+
"tableName": "groups",
|
|
426
426
|
"packageName": "@happyvertical/smrt-users",
|
|
427
427
|
"extends": "SmrtCollection",
|
|
428
428
|
"fields": [],
|
|
@@ -502,7 +502,7 @@
|
|
|
502
502
|
"name": "GroupMemberCollection",
|
|
503
503
|
"qualifiedName": "@happyvertical/smrt-users:GroupMemberCollection",
|
|
504
504
|
"collection": "groupmembers",
|
|
505
|
-
"tableName": "
|
|
505
|
+
"tableName": "group_members",
|
|
506
506
|
"packageName": "@happyvertical/smrt-users",
|
|
507
507
|
"extends": "SmrtCollection",
|
|
508
508
|
"fields": [],
|
|
@@ -759,7 +759,7 @@
|
|
|
759
759
|
"name": "GroupRoleCollection",
|
|
760
760
|
"qualifiedName": "@happyvertical/smrt-users:GroupRoleCollection",
|
|
761
761
|
"collection": "grouproles",
|
|
762
|
-
"tableName": "
|
|
762
|
+
"tableName": "group_roles",
|
|
763
763
|
"packageName": "@happyvertical/smrt-users",
|
|
764
764
|
"extends": "SmrtCollection",
|
|
765
765
|
"fields": [],
|
|
@@ -1065,7 +1065,7 @@
|
|
|
1065
1065
|
"name": "MembershipCollection",
|
|
1066
1066
|
"qualifiedName": "@happyvertical/smrt-users:MembershipCollection",
|
|
1067
1067
|
"collection": "memberships",
|
|
1068
|
-
"tableName": "
|
|
1068
|
+
"tableName": "memberships",
|
|
1069
1069
|
"packageName": "@happyvertical/smrt-users",
|
|
1070
1070
|
"extends": "SmrtCollection",
|
|
1071
1071
|
"fields": [],
|
|
@@ -1290,7 +1290,7 @@
|
|
|
1290
1290
|
"name": "MembershipOverrideCollection",
|
|
1291
1291
|
"qualifiedName": "@happyvertical/smrt-users:MembershipOverrideCollection",
|
|
1292
1292
|
"collection": "membershipoverrides",
|
|
1293
|
-
"tableName": "
|
|
1293
|
+
"tableName": "membership_overrides",
|
|
1294
1294
|
"packageName": "@happyvertical/smrt-users",
|
|
1295
1295
|
"extends": "SmrtCollection",
|
|
1296
1296
|
"fields": [],
|
|
@@ -1577,7 +1577,7 @@
|
|
|
1577
1577
|
"name": "PermissionCollection",
|
|
1578
1578
|
"qualifiedName": "@happyvertical/smrt-users:PermissionCollection",
|
|
1579
1579
|
"collection": "permissions",
|
|
1580
|
-
"tableName": "
|
|
1580
|
+
"tableName": "permissions",
|
|
1581
1581
|
"packageName": "@happyvertical/smrt-users",
|
|
1582
1582
|
"extends": "SmrtCollection",
|
|
1583
1583
|
"fields": [],
|
|
@@ -1741,7 +1741,7 @@
|
|
|
1741
1741
|
"name": "RoleCollection",
|
|
1742
1742
|
"qualifiedName": "@happyvertical/smrt-users:RoleCollection",
|
|
1743
1743
|
"collection": "roles",
|
|
1744
|
-
"tableName": "
|
|
1744
|
+
"tableName": "roles",
|
|
1745
1745
|
"packageName": "@happyvertical/smrt-users",
|
|
1746
1746
|
"extends": "SmrtCollection",
|
|
1747
1747
|
"fields": [],
|
|
@@ -1934,7 +1934,7 @@
|
|
|
1934
1934
|
"name": "RolePermissionCollection",
|
|
1935
1935
|
"qualifiedName": "@happyvertical/smrt-users:RolePermissionCollection",
|
|
1936
1936
|
"collection": "rolepermissions",
|
|
1937
|
-
"tableName": "
|
|
1937
|
+
"tableName": "role_permissions",
|
|
1938
1938
|
"packageName": "@happyvertical/smrt-users",
|
|
1939
1939
|
"extends": "SmrtCollection",
|
|
1940
1940
|
"fields": [],
|
|
@@ -2191,7 +2191,7 @@
|
|
|
2191
2191
|
"name": "SessionCollection",
|
|
2192
2192
|
"qualifiedName": "@happyvertical/smrt-users:SessionCollection",
|
|
2193
2193
|
"collection": "sessions",
|
|
2194
|
-
"tableName": "
|
|
2194
|
+
"tableName": "sessions",
|
|
2195
2195
|
"packageName": "@happyvertical/smrt-users",
|
|
2196
2196
|
"extends": "SmrtCollection",
|
|
2197
2197
|
"fields": [],
|
|
@@ -2566,7 +2566,7 @@
|
|
|
2566
2566
|
"name": "TenantCollection",
|
|
2567
2567
|
"qualifiedName": "@happyvertical/smrt-users:TenantCollection",
|
|
2568
2568
|
"collection": "tenants",
|
|
2569
|
-
"tableName": "
|
|
2569
|
+
"tableName": "tenants",
|
|
2570
2570
|
"packageName": "@happyvertical/smrt-users",
|
|
2571
2571
|
"extends": "SmrtCollection",
|
|
2572
2572
|
"fields": [],
|
|
@@ -3197,7 +3197,7 @@
|
|
|
3197
3197
|
"name": "TenantPermissionOverrideCollection",
|
|
3198
3198
|
"qualifiedName": "@happyvertical/smrt-users:TenantPermissionOverrideCollection",
|
|
3199
3199
|
"collection": "tenantpermissionoverrides",
|
|
3200
|
-
"tableName": "
|
|
3200
|
+
"tableName": "tenant_permission_overrides",
|
|
3201
3201
|
"packageName": "@happyvertical/smrt-users",
|
|
3202
3202
|
"extends": "SmrtCollection",
|
|
3203
3203
|
"fields": [],
|
|
@@ -3690,7 +3690,7 @@
|
|
|
3690
3690
|
"name": "UserCollection",
|
|
3691
3691
|
"qualifiedName": "@happyvertical/smrt-users:UserCollection",
|
|
3692
3692
|
"collection": "users",
|
|
3693
|
-
"tableName": "
|
|
3693
|
+
"tableName": "users",
|
|
3694
3694
|
"packageName": "@happyvertical/smrt-users",
|
|
3695
3695
|
"extends": "SmrtCollection",
|
|
3696
3696
|
"fields": [],
|
|
@@ -10210,7 +10210,7 @@
|
|
|
10210
10210
|
"junctionCollections": 0,
|
|
10211
10211
|
"hierarchicalObjects": 0,
|
|
10212
10212
|
"polymorphicAssociations": 0,
|
|
10213
|
-
"uuidColumns":
|
|
10213
|
+
"uuidColumns": 82
|
|
10214
10214
|
},
|
|
10215
10215
|
"agentDoc": "# @happyvertical/smrt-users\n\nMulti-tenant identity, RBAC, hierarchical tenants, sessions, and SvelteKit auth.\n\n## Modules\n\nRead only the module relevant to the change; protocol and provisioning details\nare not prerequisites for unrelated user-package work.\n\n| Module | Scope | Module doc |\n|---|---|---|\n| `src/services/PermissionResolver.ts` | permission precedence, inherited memberships, guards, RLS, role seeding | [agents/permissions.md](agents/permissions.md) |\n| `src/services/OidcLoginService.ts`, collections and OIDC handlers | identity reconciliation, transaction boundaries, migration readiness | [agents/oidc-provisioning.md](agents/oidc-provisioning.md) |\n| `src/services/MobileAuthService.ts` | mobile handshake, bearer sessions, bootstrap extension boundary | [agents/mobile-auth.md](agents/mobile-auth.md) |\n| `src/retention.ts` | expired session/token/CLI-auth reaping and retention sweep wiring | [agents/retention.md](agents/retention.md) |\n\n## Models and authority\n\n- Users are global; tenant access comes through Membership (unique user/tenant).\n User email is normalized and globally unique through readonly nullable\n `emailKey`. `profileId` is a unique cross-package reference: at most one User\n owns each non-null Profile.\n- Tenant uses STI and a materialized hierarchy, maximum depth 10.\n `createChild()` calculates paths; `moveToParent()` updates all descendants.\n- Role with `tenantId = null` is available to all tenants; `isSystem` prevents\n deletion. `inheritsToDescendants` is opt-in. Seed owner/admin/member/viewer\n through `RoleCollection.seedSystemRoles()` at application initialization.\n- Group roles apply only in their own tenant. Use `getGroupIdsForTenant()`,\n never cross-tenant `getGroupIds()`, for authorization.\n- Membership DENY always wins. Direct inactive membership blocks inherited\n authority; a direct active membership pins resolution instead of unioning it\n with ancestors. Read the permissions module before changing these rules.\n- AccessRequest has no generated API/MCP/CLI operations; access it through\n `AccessRequestService`. Its JSON field is `requestContext`, not reserved\n slug-scoping `context`.\n\n## Security boundaries\n\n- Generated REST/MCP operations on identity/RBAC models are list/get only.\n Route authentication does not authorize authority mutations, and these models\n are not tenant-scoped. Use permission-gated services or explicitly checked\n consumer handlers. CLI remains a local-operator surface. Preserve the\n registry assertions in `security-audit-1400.test.ts`.\n- Resource guards take the resource tenant, not the session tenant. Omit a\n session membership when targeting a different tenant; mismatches fail closed.\n `loadSessionContext().tenantAuthorization` must be checked by required-tenant\n consumers: null membership can represent inherited authority.\n- Sessions use secure UUIDs; TTL is seconds (default seven days). Access marks\n expired sessions EXPIRED. Magic-link tokens are single use.\n- Tenant switching verifies active membership before writing and rotates the\n session ID for non-null targets, revoking the old session. Persist the returned\n `SwitchTenantResult.sessionId`; `switchSessionTenant()` updates the cookie and\n preserves its security settings. Failed switches mutate nothing; null clears\n do not rotate. `SessionCollection.setSessionTenant()` is unguarded and must\n never receive an untrusted tenant ID.\n- OIDC provisioning is atomic and fail-closed. Preserve exact issuer/subject\n identifiers, claim-source email verification, unique global Person ownership,\n and transaction-bound reconciliation. Read the OIDC module and canonical\n scenario matrix before changing any provisioning path.\n\n## Entry points and validation\n\n`src/sveltekit/` owns `createSessionHandler`, `createSessionCookie`,\n`destroySessionCookie`, and `switchSessionTenant`. Use README integration examples\nrather than copying application setup into these instructions.\n\nFrom the repository root:\n\n```bash\npnpm --filter @happyvertical/smrt-users test\npnpm --filter @happyvertical/smrt-users typecheck\npnpm --filter @happyvertical/smrt-users test:postgres\n```\n\nStart with the relevant test file via `test -- src/__tests__/<file>.test.ts`.\nRun `test:postgres` for RLS, principal context, OIDC, or terminal-auth database\nchanges. `typecheck` includes Svelte accessibility checks; plain `tsc` is\ninsufficient. Follow root knowledge freshness checks before shipping.\n",
|
|
10216
10216
|
"moduleDocs": [
|
package/dist/sveltekit.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as decodeOidcTransaction, E as resolveOidcProviderConfig, S as OidcLoginService, T as getUsersOidcConfig, _ as readMobileBearerToken, a as TerminalAuthRateLimitError, g as MobileAuthService, h as MobileAuthError, i as TerminalAuthError, m as withSessionPermissionContext, o as TerminalAuthService, s as OperationPermissionError, v as validateMobileRedirectUri, w as encodeOidcTransaction, x as OidcLoginError, y as SessionService } from "./chunks/TerminalAuthService-
|
|
1
|
+
import { C as decodeOidcTransaction, E as resolveOidcProviderConfig, S as OidcLoginService, T as getUsersOidcConfig, _ as readMobileBearerToken, a as TerminalAuthRateLimitError, g as MobileAuthService, h as MobileAuthError, i as TerminalAuthError, m as withSessionPermissionContext, o as TerminalAuthService, s as OperationPermissionError, v as validateMobileRedirectUri, w as encodeOidcTransaction, x as OidcLoginError, y as SessionService } from "./chunks/TerminalAuthService-BuOM9zbU.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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happyvertical/smrt-users",
|
|
3
|
-
"version": "0.49.
|
|
3
|
+
"version": "0.49.4",
|
|
4
4
|
"smrtJsdoc": "strict",
|
|
5
5
|
"description": "Multi-tenant user management for the SMRT framework - users, tenants, roles, permissions, groups",
|
|
6
6
|
"type": "module",
|
|
@@ -47,18 +47,18 @@
|
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@happyvertical/logger": "^0.89.6",
|
|
50
|
-
"@happyvertical/smrt-config": "0.49.
|
|
51
|
-
"@happyvertical/smrt-core": "0.49.
|
|
52
|
-
"@happyvertical/smrt-mobile-contract": "0.49.
|
|
53
|
-
"@happyvertical/smrt-profiles": "0.49.
|
|
54
|
-
"@happyvertical/smrt-tenancy": "0.49.
|
|
55
|
-
"@happyvertical/smrt-types": "0.49.
|
|
56
|
-
"@happyvertical/smrt-ui": "0.49.
|
|
50
|
+
"@happyvertical/smrt-config": "0.49.4",
|
|
51
|
+
"@happyvertical/smrt-core": "0.49.4",
|
|
52
|
+
"@happyvertical/smrt-mobile-contract": "0.49.4",
|
|
53
|
+
"@happyvertical/smrt-profiles": "0.49.4",
|
|
54
|
+
"@happyvertical/smrt-tenancy": "0.49.4",
|
|
55
|
+
"@happyvertical/smrt-types": "0.49.4",
|
|
56
|
+
"@happyvertical/smrt-ui": "0.49.4",
|
|
57
57
|
"@happyvertical/sql": "^0.89.6",
|
|
58
58
|
"jose": "^6.2.3"
|
|
59
59
|
},
|
|
60
60
|
"devDependencies": {
|
|
61
|
-
"@happyvertical/smrt-vitest": "0.49.
|
|
61
|
+
"@happyvertical/smrt-vitest": "0.49.4",
|
|
62
62
|
"@sveltejs/package": "^2.5.8",
|
|
63
63
|
"@sveltejs/vite-plugin-svelte": "^7.1.2",
|
|
64
64
|
"@types/node": "24.13.2",
|