@shivaedev/identity 0.9.1 → 0.10.0

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/CHANGELOG.md ADDED
@@ -0,0 +1,171 @@
1
+ # Changelog
2
+
3
+ ## 0.10.0 - 2026-10-31
4
+
5
+ ### Added
6
+
7
+ - List active sessions with user details and activity times, and revoke one session through the permission-guarded `identity.sessions` contract. Session revocation uses the existing request and live subscription revalidation path.
8
+ - Generated applications grant session management to their admin and owner roles.
9
+
10
+ ### Fixed
11
+
12
+ - Include `CHANGELOG.md` in published package contents so release notes are available in `node_modules`.
13
+ - Release checks reject published package `files` lists that omit `CHANGELOG.md`, naming the package and how to include it.
14
+ - End hosted live subscriptions with `Unauthorized` when the original session is signed out, revoked or expired, whether detected during a change hint or periodic revalidation. Keep `QueryReadDenied` for a signed-in viewer whose query policy refuses the read.
15
+ - Batch shared socket session lookups with an Effect scheduler yield so advancing `TestClock` past `streamRevalidationInterval` completes revalidation without another clock advance.
16
+ - Preserve typed session-provider failures during hint-time authorization instead of reporting them as read-policy refusals.
17
+
18
+ ## 0.9.1 - 2026-10-30
19
+
20
+ ### Changed
21
+
22
+ - Release with updated workspace dependencies.
23
+
24
+ ## 0.9.0 - 2026-10-30
25
+
26
+ ### Added
27
+
28
+ - Access exports `AssignRoles` and `LastRoleAssigner` from `@shivaedev/access/roles.ts` for shared role policy declarations.
29
+ - Identity provides `assignRole(access, userId, role)` for trusted seeds and operator commands. Supply `SqlClient` and `Reactivity`; it returns whether storage changed and uses the Users page's PostgreSQL lock, last-role-assigner guard and commit invalidation.
30
+
31
+ ### Breaking
32
+
33
+ - Identity mounts with `roles` close Better Auth's `/admin/set-role`, `/admin/update-user` and `/admin/create-user` HTTP endpoints and set its admin plugin's `adminRoles` to `[]`. Remove that setup from applications. Use the admin Users page for authorized requests and identity's `assignRole` for trusted server commands.
34
+ - Admin consumers import `AssignRoles` and `LastRoleAssigner` from `@shivaedev/access/roles.ts` instead of `@shivaedev/admin/permissions.ts` and `@shivaedev/admin/users/roles.ts`. The Users page uses identity's shared assignment operation; its permission checks, typed refusal and audit log remain.
35
+
36
+ ## 0.8.0 - 2026-10-30
37
+
38
+ ### Added
39
+
40
+ - Pass a provider-account lookup to a Better Auth mount's `admittedSessions(getSession, getProviderAccounts)` to read linked provider IDs through `SessionUserWithProviderAccounts` while enforcing admission and session revocation. Omitting the lookup preserves the base session shape.
41
+
42
+ ## 0.7.0 - 2026-10-30
43
+
44
+ ### Fixed
45
+
46
+ - Live reads and change subscriptions preserve policy failures instead of reporting read denial. Generated starter apps report notes database connection failures as `ServiceUnavailable` during the owner's live read.
47
+
48
+ ### Breaking
49
+
50
+ - Query read policies declare their error and service channels with `QueryReadPolicy<Payload, E, R>`. Declare policy errors in the query's `rejections` and provide policy services when building its handler Layer. Custom subscription adapters call `querySubscription(rpc, references, viewer)` instead of resolving requests themselves. Use the native RPC type when calling `authorizeReads` or `resolveChanges` so their inferred channels include policy requirements and errors. The generated change stream includes the queries' declared rejections and service requirements; consumers handling that stream must handle those errors too.
51
+ - Admin pages install their permission's read policy for every query, preserving additional query restrictions. Remove repeated page-grant policies from individual queries and supply the page's permission middleware with the handler Layers.
52
+
53
+ ## 0.6.0 - 2026-10-30
54
+
55
+ ### Added
56
+
57
+ - Identity exposes a socket-scoped session coordinator for hosts to share session rechecks within a batch and drive stream revalidation from one timer.
58
+
59
+ ### Fixed
60
+
61
+ - Hosted live subscriptions on one socket share hint-time session lookups and periodic session revalidation while retaining per-query read-policy checks and typed revocation failures.
62
+
63
+ ## 0.5.1 - 2026-10-30
64
+
65
+ ### Changed
66
+
67
+ - Release with updated workspace dependencies.
68
+
69
+ ## 0.5.0 - 2026-10-30
70
+
71
+ ### Added
72
+
73
+ - Export `SessionUserSchema` from `identity.ts`, `IdentityFailures` from `middleware.ts`, and `providerFailure` from `server/providerFailure.ts` as the shared user description, middleware failure union and redacted provider-failure mapper.
74
+ - Access exports the `Permission` Schema and derives its type from it. Role resolution and identity session decoding use that Schema.
75
+ - Access exports `forbidden(permission)` and `unauthorized()` from `refusal.ts` for consistent permission refusals.
76
+ - Identity's `trustedOrigins` accepts an optional `sameOrigin: { trustedProxy }` policy using the transport guard's loopback and trusted-proxy authority checks. Session resolution supplies the transport peer address; RPC message headers cannot establish proxy trust.
77
+
78
+ ### Fixed
79
+
80
+ - Report failures and defects masked by `rpcBoundary` through Effect's error reporters at Error severity with diagnostic redaction before returning the rejection.
81
+ - Log boundary-masked RPC failures once at ERROR with their redacted stack; keep declared rejections at INFO.
82
+ - Retry command-declared invalidation publication after the handler returns, with two bounded exponential backoffs. Exhausted retries preserve the committed result and resynchronize local live streams, then broadcast Resync to other PostgreSQL hosts when the change channel is reachable.
83
+ - Clarify that atomic record and bucket invalidation comes from the stored model and repository; command `invalidates` keys remain after-commit. No consumer API changes or migration are required.
84
+ - Run mounted session admission and session permission enrichment in the request fiber so request spans, log annotations and interruption survive policy checks.
85
+ - Generated apps accept their own forwarded HTTPS RPC requests without `PUBLIC_URL`, while refusing foreign origins. A configured `PUBLIC_URL` remains the explicit RPC origin allowlist.
86
+
87
+ ### Breaking
88
+
89
+ - `mounted.admittedSessions(lookup)` now returns an Effect `SessionProvider`. Assign it directly to `sessions.provider` instead of wrapping it with `betterAuthSessions`, or use `mounted.sessions` for the default lookup and mounted roles. Provide the application's Config provider to the server Layer for request-time account checks and to explicit revocation workflows; revocation also uses the caller's environment.
90
+ - Import `trustedProxyRanges` from `server/trustedProxyRanges.ts` instead of `server/local.ts`, and `proxyRanges` from `server/proxyRanges.ts` instead of `server/trustedProxy.ts`. The forwarding exports have been removed.
91
+ - `sessionPermissions` now returns an Effect instead of a Promise. Yield it in the caller's Effect workflow.
92
+ - `server/sessionProfile.ts` has been removed. Decode or project profiles with `Schema.decodeSync(SessionUserSchema)` from `identity.ts`.
93
+ - Access, identity and React now share access's grant evaluator: an `any` grant covers an `own` check for the same permission name. An `own` grant still cannot cover an `any` check. Applications that need separate capabilities must declare separate permission names; record ownership checks still belong in `canAccess` or `requireAccess`.
94
+ - Replace `Access.requirePermission(user, permission)` with `requirePermission(yield* Access.resolve(user.role), permission)` from `@shivaedev/access/requirePermission.ts`. The new function takes a signed-in user; reject an absent session with `unauthorized()` from `@shivaedev/access/refusal.ts` before resolving its role. `requireAccess` continues to handle signed-out users itself.
95
+ - Replace identity's `requirePermission(permission)` with access's `requirePermission(yield* SessionUser, permission)`. There is no identity re-export. Admin's built-in handlers use this shared enforcement.
96
+ - Access's `requireAccess` now uses the shared permission refusal message, `Permission required: <name> (<strength>)`, instead of `Access denied: <name>`. Consumers should branch on the `Forbidden` tag.
97
+ - Identity treats an undeclared stored user role as a defect naming the role, rather than `AuthUnavailable`. RPC request tracing logs the defect and Better Auth's session endpoint returns HTTP 500. Consumers must correct the user's stored role or restore its application declaration; reserve `AuthUnavailable` handling for provider outages.
98
+ - Admin role assignment trusts its typed role input and leaves session role resolution to identity. RPC consumers need no change: the contract decodes the role. Direct callers of `changeUserRole` must decode untrusted role input with the application's `Role` schema before calling it.
99
+
100
+ ## 0.4.0 - 2026-10-30
101
+
102
+ ### Added
103
+
104
+ - Scope screen-driver verbs and readouts with `within(container)`, and mount named member screens with independent cookie sessions, atom registries and scoped roots through `memberScreens`.
105
+ - Create password-credential test users with Identity's `passwordUser` helper for real email sign-in stories.
106
+ - Quality accepts app migrations referencing the auth user id with `ON DELETE CASCADE` or `ON DELETE SET NULL`, while keeping auth reads and writes behind identity.
107
+ - Identity exports `userReference` from `server/better-auth/userReference.ts` so app migrations share the user table and id column names.
108
+ - Starter notes use a `user_id` foreign key with cascading deletion. A numbered migration renames the existing ownership column and adds the constraint for existing apps.
109
+
110
+ ### Changed
111
+
112
+ - Require Effect 4.0.6 and align the Effect companion package peers and generated starter catalog to the same exact release. Install the 4.0.6 Effect stack together.
113
+
114
+ ### Fixed
115
+
116
+ - Register hosted RPC cache-control handling through Effect 4.0.6's request-scoped pre-response API so responses keep `private, no-store`.
117
+ - Accept native RPC's `application/x-ndjson` media type while preserving `application/ndjson` callers at the transport guard.
118
+ - Keep subscriptions open after their HTTP request body completes; closing the socket still cancels them.
119
+
120
+ ## 0.3.2 - 2026-10-29
121
+
122
+ ### Changed
123
+
124
+ - Release with updated workspace dependencies.
125
+
126
+ ## 0.3.1 - 2026-10-29
127
+
128
+ ### Changed
129
+
130
+ - Release with updated workspace dependencies.
131
+
132
+ ## 0.3.0 - 2026-10-28
133
+
134
+ ### Added
135
+
136
+ - Identity exports `sweepExpiredSessions`, an Effect over the application's SQL client that deletes expired Better Auth sessions and returns the number removed without mounting auth.
137
+ - The starter worker sweeps expired auth sessions daily at midnight UTC. New apps and apps using the starter updater receive the schedule.
138
+ - `authTestDatabase(pool).expireSessions(userId)` expires only the selected user's sessions; omit the user id to expire every session.
139
+
140
+ ### Fixed
141
+
142
+ - Enforce declared query read policies at the hosted RPC handler boundary, including contracts without identity middleware, whose viewer is anonymous. Query RPC error schemas include `QueryReadDenied` so native clients receive typed refusals before handlers run.
143
+ - Keep collection methods and untyped schema internals from making data parameters appear to carry callable services. Direct service implementations, nested dependency fields and service arrays remain subject to `effect/service-parameters`.
144
+
145
+ ### Breaking
146
+
147
+ - Call `authTestDatabase(pool).expireSessions()` instead of yielding the `expireSessions` property directly.
148
+ - Move key imports from `@shivaedev/contract/keys.ts` to `@shivaedev/changes/keys.ts`. Declare bucket fields with `collection(name, idSchema, fields)` and publish affected buckets alongside record keys.
149
+ - Replace collection policy maps, `mergeReadPolicies`, `ReadPolicy` and `ReadPolicyMemoWindow` with each query's `readPolicy(payload, viewer)`. Declare the same query's live scope with `reads(payload, viewer)`. Bound query atoms and subscriptions refuse missing policies with a declaration error; one-off query `run` calls remain available. Denied queries refuse the entire subscription. Server adapters replace `QueryReads` and `ChangesReads` with `QueryDefinition` and `ChangesQueries`. Custom middleware calls `authorizeReads(effect, request, viewer)` and declares `MissingReadPolicy` and `QueryReadDenied` errors.
150
+ - Custom subscription adapters yield `ChangesQueries.resolve(references)`, call `querySubscription(requests, viewer)` and pass the authorized result to `makeLiveServer.subscribe(subscription, context)`. Metadata values expose `QueryDefinition.definition` and `CommandInvalidation.invalidates` instead of bare definitions and callbacks. Yield the Effect returned by `queryKeys(queries, references)` when projecting keys for a custom stream. `resolveChanges` supplies the authorized subscription in hosted applications. Changed hints can carry query positions so bindings can rerun session-scoped reads without deriving session scopes in the browser.
151
+ - Remove `appHost`'s `readPolicy` option and module policy registration. Session and permission middleware apply query policies using the current session viewer. Handle the new typed policy errors in native clients, including `QueryReadDenied` on query RPCs without identity middleware; widen explicit query error annotations accordingly.
152
+ - Replace `sessionCommandChanges` with `commandChanges` for custom session middleware. Command invalidation callbacks can receive the session viewer as their third argument. Announce viewer buckets there; background writers must explicitly publish those bucket keys after commit.
153
+ - Built-in admin queries declare their permission policies alongside their schemas and read scopes. Consumers keep supplying the existing session and permission middleware layers.
154
+ - Local Work Board and Fleet queries declare their existing loopback read access explicitly so their generated live subscriptions remain available.
155
+
156
+ ## 0.2.0 - 2026-10-27
157
+
158
+ ### Added
159
+
160
+ - Session hosts bound to a non-loopback address without proxy trust warn at startup to configure `TRUSTED_PROXY` or `config.trustedProxy` before forwarding RPC requests.
161
+
162
+ ### Fixed
163
+
164
+ - Development auth accepts both `localhost` and `127.0.0.1` over HTTP on any port when `PUBLIC_URL` is unset. Explicit `baseURL` and `trustedOrigins` options replace those defaults.
165
+ - Auth rate limiting uses the connection peer address without a trusted proxy, separating client buckets and avoiding Better Auth's missing-client-IP warning. Trusted forwarding still takes precedence, and untrusted forwarding headers are ignored.
166
+
167
+ ## 0.1.0 - 2026-10-27
168
+
169
+ ### Added
170
+
171
+ - First release of `@shivaedev/identity`: request identity and the RPC middleware declarations (`identity.ts`, `middleware.ts`, `permission.ts`), session resolution, Origin policy, trusted proxies, permission enforcement and request tracing (`server/`), and the Better Auth mount, sign-in policy and test helpers (`server/better-auth/`). The service and middleware ids now name the package (`@shivaedev/identity/Identity`, `@shivaedev/identity/Authenticated` and so on).
package/README.md CHANGED
@@ -422,7 +422,7 @@ const authentication = Layer.succeed(MyAuthentication, (effect, { headers, rpc,
422
422
 
423
423
  ### Session freshness in streams
424
424
 
425
- `authenticatedLayer`, `authenticatedUserLayer`, `authenticatedUserWithProviderAccountsLayer`, the role layers and signed-in `maybeAuthenticatedLayer` calls revalidate live RPC streams every 30 seconds by default, using the original transport headers. A missing or revoked session ends the stream with `Unauthorized`, including an idle stream. With a session store that reflects sign-out immediately, delivery can continue for up to that interval plus the session lookup time after sign-out. Provider cookie caching or secondary storage can add their own delay; keep Better Auth's cookie cache disabled for database-backed revocation.
425
+ `authenticatedLayer`, `authenticatedUserLayer`, `authenticatedUserWithProviderAccountsLayer`, the role layers and signed-in `maybeAuthenticatedLayer` calls revalidate live RPC streams every 30 seconds by default, using the original transport headers. A signed-out, revoked or expired session ends the stream with `Unauthorized`, including an idle stream and a subscription receiving a change hint. A signed-in viewer whose query read policy now refuses ends the subscription with `QueryReadDenied`. Session intervals use Effect’s Clock, so advancing `TestClock` drives revalidation; batched session lookups do not need another clock advance. With a session store that reflects sign-out immediately, delivery can continue for up to that interval plus the session lookup time after sign-out. Provider cookie caching or secondary storage can add their own delay; keep Better Auth's cookie cache disabled for database-backed revocation.
426
426
 
427
427
  Set `SessionPolicy.streamRevalidationInterval` to an Effect `Duration.Input` to change the interval for middleware using that policy:
428
428
 
@@ -9,7 +9,7 @@ export const makeSocketSession = Effect.fnUntraced(function* (interval) {
9
9
  lookup: (key, lookup) => Effect.gen(function* () {
10
10
  let batch = pending.get(key);
11
11
  if (batch === undefined) {
12
- batch = yield* Effect.cached(Effect.sleep(0).pipe(Effect.andThen(lookup), Effect.ensuring(Effect.sync(() => pending.delete(key)))));
12
+ batch = yield* Effect.cached(Effect.yieldNow.pipe(Effect.andThen(lookup), Effect.ensuring(Effect.sync(() => pending.delete(key)))));
13
13
  pending.set(key, batch);
14
14
  }
15
15
  return yield* batch;
@@ -1 +1 @@
1
- {"version":3,"file":"socketSession.js","sourceRoot":"","sources":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EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAC3C,CAAC;YACF,OAAO,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;QACrC,CAAC,CAAC;KACH,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC;AAEH,MAAM,UAAU,iBAAiB,CAAO,KAAgC,EAAE,QAAwB;IACjG,OAAO,MAAM,CAAC,OAAO,CACpB,MAAM,CAAC,aAAa,CAAC,aAAa,CAAC,EACnC,MAAM,CAAC,KAAK,CAAC;QACZ,MAAM,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC;QAChF,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;KACxD,CAAC,CACF,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shivaedev/identity",
3
- "version": "0.9.1",
3
+ "version": "0.10.0",
4
4
  "description": "Request identity, sessions, transport trust and permission enforcement for Effect RPC servers",
5
5
  "keywords": [
6
6
  "effect"
@@ -41,24 +41,25 @@
41
41
  "!src/**/*.spec.ts",
42
42
  "!src/**/*.spec.tsx",
43
43
  "!src/**/test-support",
44
+ "CHANGELOG.md",
44
45
  "README.md"
45
46
  ],
46
47
  "dependencies": {
47
- "@shivaedev/access": "0.3.0",
48
+ "@shivaedev/access": "0.3.1",
48
49
  "@shivaedev/changes": "0.6.0",
49
- "@shivaedev/contract": "0.25.0",
50
- "@shivaedev/errors": "0.1.2",
50
+ "@shivaedev/contract": "0.26.0",
51
+ "@shivaedev/errors": "0.1.3",
51
52
  "@shivaedev/sql": "0.27.0"
52
53
  },
53
54
  "devDependencies": {
54
55
  "@effect/platform-node": "4.0.6",
55
56
  "@effect/sql-pg": "4.0.6",
56
- "@shivaedev/admin": "0.12.1",
57
+ "@shivaedev/admin": "0.12.2",
57
58
  "@shivaedev/quality": "0.48.1",
58
- "@shivaedev/server": "0.9.2",
59
+ "@shivaedev/server": "0.9.3",
59
60
  "@shivaedev/test": "0.12.0",
60
61
  "@shivaedev/test-sql": "0.15.0",
61
- "@shivaedev/test-story": "0.26.3",
62
+ "@shivaedev/test-story": "0.27.0",
62
63
  "@types/node": "24.19.2",
63
64
  "@types/pg": "8.20.0",
64
65
  "better-auth": "1.7.12",
@@ -27,7 +27,7 @@ export const makeSocketSession = Effect.fnUntraced(function* (interval: Duration
27
27
  Effect.gen(function* () {
28
28
  let batch = pending.get(key);
29
29
  if (batch === undefined) {
30
- batch = yield* Effect.cached(Effect.sleep(0).pipe(Effect.andThen(lookup), Effect.ensuring(Effect.sync(() => pending.delete(key)))));
30
+ batch = yield* Effect.cached(Effect.yieldNow.pipe(Effect.andThen(lookup), Effect.ensuring(Effect.sync(() => pending.delete(key)))));
31
31
  pending.set(key, batch);
32
32
  }
33
33
  return yield* batch;