@shivaedev/identity 0.38.0 → 0.38.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/CHANGELOG.md +12 -0
- package/README.md +3 -3
- package/package.json +12 -12
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.38.2 - 2026-11-21
|
|
4
|
+
|
|
5
|
+
### Changed
|
|
6
|
+
|
|
7
|
+
- Update `@shivaedev/contract` from 0.55.0 to 0.56.0.
|
|
8
|
+
|
|
9
|
+
## 0.38.1 - 2026-11-21
|
|
10
|
+
|
|
11
|
+
### Changed
|
|
12
|
+
|
|
13
|
+
- Update `@shivaedev/contract` from 0.54.1 to 0.55.0.
|
|
14
|
+
|
|
3
15
|
## 0.38.0 - 2026-11-21
|
|
4
16
|
|
|
5
17
|
### Added
|
package/README.md
CHANGED
|
@@ -451,7 +451,7 @@ const names = yield* directory.names([userId]);
|
|
|
451
451
|
|
|
452
452
|
`list` takes `UserListInput` (a limit of 1–100 and an optional exclusive user-id cursor) and returns `UserList`: users ordered by id with id, name, email, declared role and UTC creation time, plus an optional next cursor. `role` and `assignRole` fail with `NotFound` for a missing user. `names` returns existing `{ id, name }` accounts ordered by id, omitting unknown ids and duplicates; an empty request returns no accounts. Storage and decoding failures return `AuthUnavailable`, including an undeclared role requested through the port.
|
|
453
453
|
|
|
454
|
-
The port is for trusted server code; applications authorize callers before using it. Assignments share the transactional last-assigner guard below. Identity exports `userKeys` and `roleKeys` collections from `@shivaedev/identity/users.ts`. Successful role changes announce both user and role item keys after commit, also refreshing their list readers. Contract queries can declare `reads: () => [userKeys.list]` or `reads: ({ userId }) => [roleKeys.item(userId)]`.
|
|
454
|
+
The port is for trusted server code; applications authorize callers before using it. Assignments share the transactional last-assigner guard below. Identity exports `userKeys` and `roleKeys` collections from `@shivaedev/identity/users.ts`. Successful role changes announce both user and role item keys after commit, also refreshing their list readers. Another `UserDirectory` implementation must announce its changes the same way, as the Better Auth directory does with `userKeys.item`, because a users list, such as the admin Users page, reruns only when a change is announced: the Users page's role change declares no keys of its own. Contract queries can declare `reads: () => [userKeys.list]` or `reads: ({ userId }) => [roleKeys.item(userId)]`.
|
|
455
455
|
|
|
456
456
|
### Role assignments
|
|
457
457
|
|
|
@@ -529,7 +529,7 @@ Native sign-out revokes the stored session. Signing in again while sending the c
|
|
|
529
529
|
|
|
530
530
|
The host answers native preflights with POST for RPC, GET and POST for auth, and only `Authorization` and `Content-Type` headers. Native responses echo the allowed origin exactly with `Vary: Origin`; auth responses expose `set-auth-token`. Native responses never enable CORS credentials. It strips cookies from admitted native requests before auth or RPC session resolution, so only the signed bearer session can authenticate them. This prevents native access from opening a cookie CSRF path, even if a caller sends a cookie. Resource authorization remains app-owned.
|
|
531
531
|
|
|
532
|
-
|
|
532
|
+
A WebView's live queries subscribe over the shared WebSocket client: pass the signed credential as `bearerToken` to contract's `makeClient`, which sends it as the socket's first frame, as the [contract guide](https://github.com/ShivaeDev/platform/blob/main/packages/contract/README.md#build-a-shared-websocket-client) describes. The host refuses a query's change stream over HTTP with `WebSocketRequired`. Over HTTP, use the WebView's own fetch with `credentials: "omit"` for commands, one-off reads and explicit NDJSON streams, and abort a stream's request to release server work; a buffering native HTTP bridge cannot deliver a stream incrementally. The host still validates trusted proxy peers and forwarded authority, enforces NDJSON and body limits, uses only transport credentials, redacts diagnostics and authorizes sessions. Native HTTP callers without an Origin can exercise bearer RPC with an origin policy that explicitly permits missing Origins.
|
|
533
533
|
|
|
534
534
|
### Decide who may sign in
|
|
535
535
|
|
|
@@ -1114,7 +1114,7 @@ With database-backed sessions and cookie caching disabled, revocation rejects th
|
|
|
1114
1114
|
|
|
1115
1115
|
### Deliver typed auth emails
|
|
1116
1116
|
|
|
1117
|
-
Give `betterAuthMount` one `emails` configuration instead of four Better Auth callbacks. The application supplies absolute route URLs and a delivery Effect; it owns the transport and message text.
|
|
1117
|
+
Give `betterAuthMount` one `emails` configuration instead of four Better Auth callbacks. The application supplies absolute route URLs and a delivery Effect; it owns the transport and message text. To send them through a durable job queue with default copy, declare them with `authEmailQueue` from `@shivaedev/email/server/authEmailQueue.ts`, which returns this configuration together with the queue's producer and worker Layers; see the email package's [auth email section](https://github.com/ShivaeDev/platform/blob/main/packages/email/README.md#send-better-auths-emails).
|
|
1118
1118
|
|
|
1119
1119
|
```ts
|
|
1120
1120
|
const mounted = yield* betterAuthMount(AppAuth, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shivaedev/identity",
|
|
3
|
-
"version": "0.38.
|
|
3
|
+
"version": "0.38.2",
|
|
4
4
|
"description": "Request identity, sessions, transport trust and permission enforcement for Effect RPC servers",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"effect"
|
|
@@ -48,32 +48,32 @@
|
|
|
48
48
|
"dependencies": {
|
|
49
49
|
"@shivaedev/access": "0.7.0",
|
|
50
50
|
"@shivaedev/changes": "0.14.1",
|
|
51
|
-
"@shivaedev/contract": "0.
|
|
51
|
+
"@shivaedev/contract": "0.56.0",
|
|
52
52
|
"@shivaedev/errors": "0.14.1",
|
|
53
53
|
"@shivaedev/rate-limit": "0.8.0",
|
|
54
54
|
"@shivaedev/service": "0.9.2",
|
|
55
55
|
"@shivaedev/sql": "0.54.0"
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
|
-
"@better-auth/oauth-provider": "1.7.
|
|
58
|
+
"@better-auth/oauth-provider": "1.7.23",
|
|
59
59
|
"@effect/platform-node": "4.1.4",
|
|
60
60
|
"@effect/sql-pg": "4.1.4",
|
|
61
|
-
"@shivaedev/admin": "0.28.
|
|
62
|
-
"@shivaedev/build": "0.5.
|
|
63
|
-
"@shivaedev/quality": "0.
|
|
64
|
-
"@shivaedev/server": "0.
|
|
65
|
-
"@shivaedev/test-kits": "0.16.
|
|
61
|
+
"@shivaedev/admin": "0.28.3",
|
|
62
|
+
"@shivaedev/build": "0.5.2",
|
|
63
|
+
"@shivaedev/quality": "0.83.1",
|
|
64
|
+
"@shivaedev/server": "0.41.1",
|
|
65
|
+
"@shivaedev/test-kits": "0.16.2",
|
|
66
66
|
"@shivaedev/test-sql": "0.26.0",
|
|
67
|
-
"@shivaedev/test-story": "0.52.
|
|
67
|
+
"@shivaedev/test-story": "0.52.2",
|
|
68
68
|
"@types/node": "24.19.2",
|
|
69
|
-
"better-auth": "1.7.
|
|
69
|
+
"better-auth": "1.7.23",
|
|
70
70
|
"effect": "4.1.4",
|
|
71
71
|
"typescript": "7.0.2",
|
|
72
72
|
"vitest": "5.1.0"
|
|
73
73
|
},
|
|
74
74
|
"peerDependencies": {
|
|
75
|
-
"@better-auth/oauth-provider": "1.7.
|
|
76
|
-
"better-auth": "1.7.
|
|
75
|
+
"@better-auth/oauth-provider": "1.7.23",
|
|
76
|
+
"better-auth": "1.7.23",
|
|
77
77
|
"effect": "4.1.4"
|
|
78
78
|
},
|
|
79
79
|
"peerDependenciesMeta": {
|