@shivaedev/identity 0.38.3 → 0.39.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 +14 -0
- package/README.md +62 -43
- package/dist/generated/AccountPreferences.d.ts.map +1 -1
- package/dist/generated/AccountPreferences.js +3 -8
- package/dist/generated/AccountPreferences.js.map +1 -1
- package/dist/generated/Sessions.d.ts.map +1 -1
- package/dist/generated/Sessions.js +3 -7
- package/dist/generated/Sessions.js.map +1 -1
- package/dist/server/NativeOrigins.d.ts +5 -0
- package/dist/server/NativeOrigins.d.ts.map +1 -0
- package/dist/server/NativeOrigins.js +16 -0
- package/dist/server/NativeOrigins.js.map +1 -0
- package/dist/server/SessionPolicy.d.ts +2 -0
- package/dist/server/SessionPolicy.d.ts.map +1 -1
- package/dist/server/SessionPolicy.js.map +1 -1
- package/dist/server/adapters/local.d.ts +1 -1
- package/dist/server/adapters/local.d.ts.map +1 -1
- package/dist/server/adapters/local.js +3 -4
- package/dist/server/adapters/local.js.map +1 -1
- package/dist/server/better-auth/adapters/admittedSessions.d.ts +1 -2
- package/dist/server/better-auth/adapters/admittedSessions.d.ts.map +1 -1
- package/dist/server/better-auth/adapters/admittedSessions.js +3 -3
- package/dist/server/better-auth/adapters/admittedSessions.js.map +1 -1
- package/dist/server/better-auth/adapters/bearerSessions.d.ts +1 -3
- package/dist/server/better-auth/adapters/bearerSessions.d.ts.map +1 -1
- package/dist/server/better-auth/adapters/bearerSessions.js +6 -0
- package/dist/server/better-auth/adapters/bearerSessions.js.map +1 -1
- package/dist/server/better-auth/adapters/response.d.ts +1 -2
- package/dist/server/better-auth/adapters/response.d.ts.map +1 -1
- package/dist/server/better-auth/adapters/response.js +2 -2
- package/dist/server/better-auth/adapters/response.js.map +1 -1
- package/dist/server/better-auth/define.d.ts +4 -0
- package/dist/server/better-auth/define.d.ts.map +1 -1
- package/dist/server/better-auth/define.js.map +1 -1
- package/dist/server/better-auth/mount.d.ts +4 -5
- package/dist/server/better-auth/mount.d.ts.map +1 -1
- package/dist/server/better-auth/mount.js +8 -5
- package/dist/server/better-auth/mount.js.map +1 -1
- package/dist/server/localOwner.d.ts +3 -1
- package/dist/server/localOwner.d.ts.map +1 -1
- package/dist/server/localOwner.js +3 -0
- package/dist/server/localOwner.js.map +1 -1
- package/dist/server/lookupSession.d.ts.map +1 -1
- package/dist/server/lookupSession.js +2 -1
- package/dist/server/lookupSession.js.map +1 -1
- package/package.json +8 -8
- package/src/generated/AccountPreferences.ts +3 -8
- package/src/generated/Sessions.ts +3 -7
- package/src/server/NativeOrigins.ts +23 -0
- package/src/server/SessionPolicy.ts +2 -0
- package/src/server/adapters/local.ts +2 -4
- package/src/server/better-auth/adapters/admittedSessions.ts +4 -4
- package/src/server/better-auth/adapters/bearerSessions.ts +10 -4
- package/src/server/better-auth/adapters/response.ts +4 -4
- package/src/server/better-auth/define.ts +10 -5
- package/src/server/better-auth/mount.ts +8 -6
- package/src/server/localOwner.ts +4 -0
- package/src/server/lookupSession.ts +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.39.0 - 2026-11-21
|
|
4
|
+
|
|
5
|
+
### Added
|
|
6
|
+
|
|
7
|
+
- The auth declaration names a bundled native client's origins once, in `defineAuth({ nativeOrigins, options })`. From that list the mount installs Better Auth's signed bearer plugin, adds the origins to Better Auth's `trustedOrigins` (a list, a function or the default), returns them on `mounted.sessions.nativeOrigins` for `SessionPolicy`, and the session origin check admits them beside the `origin` policy. Wildcards, patterns, `null` and URLs with paths fail the mount at startup with a config error.
|
|
8
|
+
- `localOwner({ nativeOrigins, owner, roles })` takes the same list for a local-owner host, refuses the same malformed origins at start and puts the list on its `sessions`, so the session origin check, the RPC guard, CORS and the RPC socket upgrade admit it.
|
|
9
|
+
- `SessionPolicy` has an optional `nativeOrigins` field typed by the branded `NativeOrigins` schema from `@shivaedev/identity/server/NativeOrigins.ts`, so only a validated list reaches it.
|
|
10
|
+
- `SessionCredential` from `@shivaedev/identity/client/SessionCredential.ts` is a credential port for clients that keep their own session token, such as a bundled native shell. Like `SessionMemory`, it has `read`, `write` and `clear` Effects that fail with `SessionCredentialUnavailable`; the application supplies one Layer over its shell's secure storage. `sessionCredentialPlugin(layer)` from `@shivaedev/identity/client/adapters/sessionCredentialPlugin.ts` is a Better Auth client plugin that sends the stored credential as `Authorization: Bearer` with `credentials: "omit"`, stores the `set-auth-token` header after sign-in and clears the credential on sign-out or a signed-out session check. An answer changes the stored credential only when its request carried the one stored now, so a session check sent before sign-in that answers after it keeps the new credential. `storedCredential` answers the stored credential for `makeClient`'s `bearerToken`, so the socket sends the current one each time it connects.
|
|
11
|
+
|
|
12
|
+
### Breaking
|
|
13
|
+
|
|
14
|
+
- `betterAuthMount`'s `bearerSessions` option is removed. Move its `origins` into the declaration: replace `betterAuthMount(AppAuth, { bearerSessions: { origins } })` with `betterAuthMount({ ...AppAuth, nativeOrigins: origins })`, or name `nativeOrigins` in `defineAuth`. Remove those origins from Better Auth's `trustedOrigins` and from the `trustedOrigins({ allow })` session policy, and spread `mounted.sessions` into `SessionPolicy`.
|
|
15
|
+
- `localRpcGuard(effect, trustedProxy)` from `@shivaedev/identity/server/adapters/local.ts` takes no native origin list; it reads `SessionPolicy.nativeOrigins`. Drop the third argument. `admittedSessions(gate, storage, bearer)` from `@shivaedev/identity/server/better-auth/adapters/admittedSessions.ts` takes a boolean instead of `{ origins }`. The `BearerSessionsOptions` type is removed.
|
|
16
|
+
|
|
3
17
|
## 0.38.3 - 2026-11-21
|
|
4
18
|
|
|
5
19
|
### Changed
|
package/README.md
CHANGED
|
@@ -210,7 +210,7 @@ const sessions = Layer.succeed(SessionPolicy, {
|
|
|
210
210
|
const host = appHost({ group, handlers, routes: mounted.routes, sessions });
|
|
211
211
|
```
|
|
212
212
|
|
|
213
|
-
Identity owns the browser origin declaration; there is no separate host CORS allow-list. When mounting Better Auth, reuse `browserOrigins` for its `trustedOrigins` option so provider CSRF checks use the same origins. Browser fetch calls must set `credentials: "include"`. Origins
|
|
213
|
+
Identity owns the browser origin declaration; there is no separate host CORS allow-list. When mounting Better Auth, reuse `browserOrigins` for its `trustedOrigins` option so provider CSRF checks use the same origins. Browser fetch calls must set `credentials: "include"`. Origins the auth declaration names in `nativeOrigins` continue to use bearer sessions with cookies removed and credentials off, even if the browser policy lists them too.
|
|
214
214
|
|
|
215
215
|
CORS does not change cookie attributes. HTTPS sibling subdomains on the same registrable domain are usually same-site and can keep the existing SameSite setting. A frontend on another registrable domain is cross-site: the app must configure Better Auth's `advanced.defaultCookieAttributes` with `{ sameSite: "none", secure: true }` and serve the API over HTTPS for its cookie to accompany cross-site requests. Browser third-party-cookie restrictions still apply.
|
|
216
216
|
|
|
@@ -240,7 +240,7 @@ const bearerToken = Redacted.value(local.token);
|
|
|
240
240
|
const machine = yield* local.machines.issue({ name: "reader agent", scope: "reader" });
|
|
241
241
|
```
|
|
242
242
|
|
|
243
|
-
Pass `sessions` to `appHost` and hand `bearerToken` directly from the launching process to its own client. Use the session host with contracts declaring `Authenticated`, `AuthenticatedUser` or permission middleware. Pass it to `makeClient` as `bearerToken: Effect.succeed(bearerToken)`, which sends it as the WebSocket's first authentication frame. Native HTTP callers send `Authorization: Bearer <token>`. Credentials are required even on loopback; the policy also requires a loopback Host and peer and the existing same-origin check. Authenticated handlers, query read policies and audit code receive the configured owner's id.
|
|
243
|
+
Pass `sessions` to `appHost` and hand `bearerToken` directly from the launching process to its own client. Use the session host with contracts declaring `Authenticated`, `AuthenticatedUser` or permission middleware. Pass it to `makeClient` as `bearerToken: Effect.succeed(bearerToken)`, which sends it as the WebSocket's first authentication frame. Native HTTP callers send `Authorization: Bearer <token>`. Credentials are required even on loopback; the policy also requires a loopback Host and peer and the existing same-origin check. A bundled native shell that talks to the local owner names its origins in `localOwner({ nativeOrigins })`; see [Bundled native clients](#bundled-native-clients). Authenticated handlers, query read policies and audit code receive the configured owner's id.
|
|
244
244
|
|
|
245
245
|
The owner credential lasts for this provider instance. Machine credentials persist in PostgreSQL as SHA-256 digests, and `issue` returns a redacted credential once. A machine acts on behalf of the owner, with `SessionUser.role` and `permissions` resolved solely from its scope through the application's `roleSet`. Use permission middleware for owner-only commands; an owner id alone does not distinguish machine rights. An undeclared scope cannot be issued. `machineTokens` from `server/machineTokens.ts` also exposes this store independently, taking `{ owner, roles }` and returning `issue`, `resolve` and `revoke`; resolved machine sessions include `{ machine: { id, name, scope }, user }`.
|
|
246
246
|
|
|
@@ -263,11 +263,11 @@ export const AppAuth = defineAuth({
|
|
|
263
263
|
});
|
|
264
264
|
```
|
|
265
265
|
|
|
266
|
-
`defineAuth` refuses at compile time a `defaultRole` that `roles` does not declare. The options hold no `database`, `secret` or `baseURL`: the mount opens Better Auth on the application's SQL client and reads `BETTER_AUTH_SECRET` and `PUBLIC_URL` itself. An application without stored roles declares `defineAuth({ options })`. The declaration is plain data; a story that needs another option spreads it, as in `{ ...AppAuth, options: { ...AppAuth.options, socialProviders } }`.
|
|
266
|
+
`defineAuth` refuses at compile time a `defaultRole` that `roles` does not declare. The options hold no `database`, `secret` or `baseURL`: the mount opens Better Auth on the application's SQL client and reads `BETTER_AUTH_SECRET` and `PUBLIC_URL` itself. An application without stored roles declares `defineAuth({ options })`. An application with a bundled native client also names its origins here, in `nativeOrigins` (see [Bundled native clients](#bundled-native-clients)). The declaration is plain data; a story that needs another option spreads it, as in `{ ...AppAuth, options: { ...AppAuth.options, socialProviders } }`.
|
|
267
267
|
|
|
268
268
|
### Mount Better Auth
|
|
269
269
|
|
|
270
|
-
`betterAuthMount(AppAuth, host?)` returns the Better Auth instance and a native route Layer for `/api/auth/*`. Its second argument holds only what the host adds: `emails`, `databaseHooks`, `onPasswordReset`, `
|
|
270
|
+
`betterAuthMount(AppAuth, host?)` returns the Better Auth instance and a native route Layer for `/api/auth/*`. Its second argument holds only what the host adds: `emails`, `databaseHooks`, `onPasswordReset`, `roleSeed`, `hardening`, `signIn`, `clientIp`, `preset`, `enabledPaths` and `accountPreferences`. Its scoped acquisition waits for the auth context and the provider’s schema check before returning; a provider initialization or schema-check failure logs the redacted cause and fails with `AuthUnavailable`. Building a Layer from this acquisition therefore completes only when authentication is ready. Merge `routes` into the HTTP host and use `auth.api.getSession` with `betterAuthSessions` for the application's RPC session provider.
|
|
271
271
|
|
|
272
272
|
```ts
|
|
273
273
|
import { betterAuthMount } from "@shivaedev/identity/server/better-auth/mount.ts";
|
|
@@ -502,23 +502,41 @@ Grant `ManageSessions` (`sessions.manage`) from `sessionPermissions.ts` to the r
|
|
|
502
502
|
|
|
503
503
|
### Bundled native clients
|
|
504
504
|
|
|
505
|
-
For a Capacitor or similar WebView whose page is served from the app bundle,
|
|
505
|
+
For a Capacitor or similar WebView whose page is served from the app bundle, name the bundle's exact origins once, in the auth declaration's `nativeOrigins`. List only bundled-client origins here, never browser origins. Every check reads that one list:
|
|
506
|
+
|
|
507
|
+
- the mount installs Better Auth's own `bearer({ requireSignature: true })` plugin from the existing dependency and adds the origins to Better Auth's `trustedOrigins`, whether the options give a list, a function or nothing; do not add a second bearer plugin or list the origins there again;
|
|
508
|
+
- only a sign-in answer to a request from one of these origins carries the signed credential in `set-auth-token`;
|
|
509
|
+
- the mount's `sessions` carries the list into `SessionPolicy`, whose session origin check admits it beside the `origin` policy;
|
|
510
|
+
- `appHost` reads the list from `SessionPolicy` to admit those origins through the RPC transport guard, the RPC socket upgrade and the auth routes.
|
|
511
|
+
|
|
512
|
+
Wildcards, patterns, `null` and URLs with paths fail the mount at startup with a config error. Without `nativeOrigins` the mount stays cookie-only and the host admits no bundled origin.
|
|
506
513
|
|
|
507
514
|
```ts
|
|
508
515
|
import { Layer } from "effect";
|
|
516
|
+
import { defineAuth } from "@shivaedev/identity/server/better-auth/define.ts";
|
|
509
517
|
import { SessionPolicy } from "@shivaedev/identity/server/SessionPolicy.ts";
|
|
510
|
-
|
|
511
|
-
const
|
|
512
|
-
|
|
513
|
-
{ bearerSessions: { origins: nativeOrigins } },
|
|
514
|
-
);
|
|
518
|
+
|
|
519
|
+
export const AppAuth = defineAuth({ nativeOrigins: ["capacitor://localhost", "https://localhost"], options: { trustedOrigins: [publicOrigin] } });
|
|
520
|
+
const mounted = yield* betterAuthMount(AppAuth);
|
|
515
521
|
const sessions = Layer.succeed(SessionPolicy, {
|
|
516
|
-
origin: trustedOrigins({ allow: [publicOrigin, ...nativeOrigins], missing: "allow" }),
|
|
517
522
|
...mounted.sessions,
|
|
523
|
+
origin: trustedOrigins({ allow: [publicOrigin], missing: "allow" }),
|
|
518
524
|
});
|
|
519
|
-
const host = appHost({ group, handlers, routes: mounted.routes, sessions
|
|
525
|
+
const host = appHost({ group, handlers, routes: mounted.routes, sessions });
|
|
520
526
|
```
|
|
521
527
|
|
|
528
|
+
Spread `mounted.sessions` into the policy even when you supply your own provider: `nativeOrigins` reaches the session origin check and the host only through it, and a policy without it admits no bundled origin.
|
|
529
|
+
|
|
530
|
+
The list goes where the session policy is made:
|
|
531
|
+
|
|
532
|
+
| Host | Where the list goes |
|
|
533
|
+
| -------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
534
|
+
| Better Auth | `defineAuth({ nativeOrigins, options })`, then spread `mounted.sessions` into `SessionPolicy` |
|
|
535
|
+
| Local owner | `localOwner({ nativeOrigins, owner, roles })`, then use its `sessions` as the policy |
|
|
536
|
+
| Hand-built `SessionPolicy` | `nativeOrigins: yield* Schema.decodeUnknownEffect(NativeOrigins)(origins)`, with `NativeOrigins` from `@shivaedev/identity/server/NativeOrigins.ts` |
|
|
537
|
+
|
|
538
|
+
`localOwner` refuses the same malformed origins at start with a config error, and `NativeOrigins` is a branded type, so a hand-built policy holds only a decoded list.
|
|
539
|
+
|
|
522
540
|
Always take the provider from the mount's `sessions`, or wrap a custom lookup in `admittedSessions`, even without a sign-in policy: both apply the mount's credential selection to the same request-local identity, profile and role middleware used by cookies. A same-origin request or a request without an Origin carrying the session cookie uses only that cookie, even if invalid or revoked; its bearer header cannot switch accounts or rescue it. Otherwise the signed bearer is resolved by Better Auth. Missing, unsigned, tampered, expired and revoked bearer sessions produce `Unauthorized` at protected RPCs.
|
|
523
541
|
|
|
524
542
|
A native client keeps its signed credential behind identity's credential port and hands its storage to one Layer. `SessionCredential` from `@shivaedev/identity/client/SessionCredential.ts` is shaped like `SessionMemory`: `read`, `write` and `clear` Effects that fail with `SessionCredentialUnavailable`. The application's Layer wraps the OS-backed secure storage of its shell's plugin, such as iOS Keychain or Android Keystore-backed storage, in its own `adapters/`; never use localStorage, sessionStorage or IndexedDB. For a Capacitor shell with a secure-storage plugin:
|
|
@@ -558,7 +576,7 @@ The plugin sends every auth request with `credentials: "omit"` and the stored cr
|
|
|
558
576
|
|
|
559
577
|
Native sign-out revokes the stored session. Signing in again while sending the current bearer replaces it and revokes the old session after successful sign-in. Streams keep their original request headers, so the old session ends with `Unauthorized` on the next revalidation; it never adopts the replacement. Keep cookie caching disabled for database-backed revocation and choose `streamRevalidationInterval` for the required delivery window.
|
|
560
578
|
|
|
561
|
-
|
|
579
|
+
Use `nativeOrigins` for bundled clients so their transport remains credential-free; other declared origins follow the sibling browser policy above.
|
|
562
580
|
|
|
563
581
|
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.
|
|
564
582
|
|
|
@@ -1182,36 +1200,37 @@ Register the Effect with a worker schedule, as the starter does at midnight UTC.
|
|
|
1182
1200
|
|
|
1183
1201
|
Import the module that defines the name; there is no package-root entry. Paths below follow `@shivaedev/identity/`.
|
|
1184
1202
|
|
|
1185
|
-
| Module | Names and purpose
|
|
1186
|
-
| ------------------------------------------------- |
|
|
1187
|
-
| `identity.ts` | `RequestId`, `Identity`, `OptionalIdentity`, `SessionUser`, `SessionUserWithProviderAccounts`, `SessionUserSchema`: request-local services and the shared user schema.
|
|
1188
|
-
| `middleware.ts` | `RequestTracing`, `Authenticated`, `AuthenticatedUser`, `AuthenticatedUserWithProviderAccounts`, `MaybeAuthenticated`, `IdentityFailures`: native RPC middleware declarations and their shared failure schema.
|
|
1189
|
-
| `server/providerFailure.ts` | `providerFailure(cause)`: log a redacted provider failure and fail with `AuthUnavailable`.
|
|
1190
|
-
| `permission.ts` | `permissionMiddleware`, `hasPermission`: native permission middleware declarations and predicates over resolved grants.
|
|
1191
|
-
| `server/permissionLayer.ts` | `permissionLayer`: permission middleware Layers.
|
|
1192
|
-
| `server/adapters/permissionRoute.ts` | `permissionRoute`: HTTP route guards.
|
|
1193
|
-
| `server/session.ts` | `authenticatedLayer`, `maybeAuthenticatedLayer`, `authenticatedUserLayer`, `authenticatedUserWithProviderAccountsLayer`, `withSessionUser`, `resolveSession`: session middleware implementations and the identity boundary.
|
|
1194
|
-
| `server/adapters/betterAuthSessions.ts` | `betterAuthSessions(getSession, getProviderAccounts?)`: a session provider from Better Auth lookups.
|
|
1195
|
-
| `server/trustedOrigins.ts` | `trustedOrigins({ allow, missing })`: an exact Origin allowlist.
|
|
1196
|
-
| `server/
|
|
1197
|
-
| `server/
|
|
1198
|
-
| `server/
|
|
1199
|
-
| `server/
|
|
1200
|
-
| `server/
|
|
1201
|
-
| `server/
|
|
1202
|
-
| `server/
|
|
1203
|
-
| `server/better-auth/
|
|
1204
|
-
| `server/better-auth/
|
|
1205
|
-
| `server/better-auth/
|
|
1206
|
-
| `server/better-auth/
|
|
1207
|
-
| `server/better-auth/
|
|
1208
|
-
| `server/better-auth/
|
|
1209
|
-
| `server/better-auth/adapters/
|
|
1210
|
-
| `server/better-auth/adapters/
|
|
1211
|
-
| `server/better-auth/
|
|
1212
|
-
| `server/better-auth/
|
|
1213
|
-
| `server/better-auth/
|
|
1214
|
-
| `server/better-auth/
|
|
1203
|
+
| Module | Names and purpose |
|
|
1204
|
+
| ------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
1205
|
+
| `identity.ts` | `RequestId`, `Identity`, `OptionalIdentity`, `SessionUser`, `SessionUserWithProviderAccounts`, `SessionUserSchema`: request-local services and the shared user schema. |
|
|
1206
|
+
| `middleware.ts` | `RequestTracing`, `Authenticated`, `AuthenticatedUser`, `AuthenticatedUserWithProviderAccounts`, `MaybeAuthenticated`, `IdentityFailures`: native RPC middleware declarations and their shared failure schema. |
|
|
1207
|
+
| `server/providerFailure.ts` | `providerFailure(cause)`: log a redacted provider failure and fail with `AuthUnavailable`. |
|
|
1208
|
+
| `permission.ts` | `permissionMiddleware`, `hasPermission`: native permission middleware declarations and predicates over resolved grants. |
|
|
1209
|
+
| `server/permissionLayer.ts` | `permissionLayer`: permission middleware Layers. |
|
|
1210
|
+
| `server/adapters/permissionRoute.ts` | `permissionRoute`: HTTP route guards. |
|
|
1211
|
+
| `server/session.ts` | `authenticatedLayer`, `maybeAuthenticatedLayer`, `authenticatedUserLayer`, `authenticatedUserWithProviderAccountsLayer`, `withSessionUser`, `resolveSession`: session middleware implementations and the identity boundary. |
|
|
1212
|
+
| `server/adapters/betterAuthSessions.ts` | `betterAuthSessions(getSession, getProviderAccounts?)`: a session provider from Better Auth lookups. |
|
|
1213
|
+
| `server/trustedOrigins.ts` | `trustedOrigins({ allow, missing })`: an exact Origin allowlist. |
|
|
1214
|
+
| `server/NativeOrigins.ts` | `NativeOrigins`: the validated, branded list of exact bundled-client origins that the mount puts on `SessionPolicy`. |
|
|
1215
|
+
| `server/adapters/local.ts` | `localRpcGuard`, `loopbackOnly`, `sameOrigin`, `trustedProxyPeer`: loopback and proxy guards. |
|
|
1216
|
+
| `server/trustedProxyRanges.ts` | `trustedProxyRanges(trustedProxy?)`: normalized proxy ranges. |
|
|
1217
|
+
| `server/adapters/proxyRanges.ts` | `proxyRanges(value)`: parse configured proxy ranges. |
|
|
1218
|
+
| `server/transportHeaders.ts` | `transportHeaders(rpcHeaders)`: the headers used for a transport-level decision. |
|
|
1219
|
+
| `server/tracing.ts` | `requestTracingLayer({ header?, sensitive? })`: the `RequestTracing` implementation. |
|
|
1220
|
+
| `server/resolveChanges.ts` | `resolveChanges`: authorized change subscriptions for custom change handlers. |
|
|
1221
|
+
| `server/better-auth/define.ts` | `defineAuth({ options, roles?, defaultRole?, nativeOrigins? })`, `AuthDeclaration`: the one declaration of an application's Better Auth options, roles, default role and bundled-client origins. |
|
|
1222
|
+
| `server/better-auth/mount.ts` | `betterAuthMount(declaration, { preset?, enabledPaths?, emails?, onPasswordReset?, signIn?, roleSeed? })`, returning `{ auth, profiles, routes, sessions, admittedSessions, admitsUser, revokeUnadmitted }`: native auth routes and the sign-in policy. |
|
|
1223
|
+
| `server/better-auth/provisionAdmin.ts` | `provisionAdmin(declaration, role)`: find or create the configured administrator and assign the role. |
|
|
1224
|
+
| `server/better-auth/adapters/database.ts` | `betterAuthDatabase()`: Better Auth storage on the application PostgreSQL client. |
|
|
1225
|
+
| `server/better-auth/emails.ts` | `AuthEmail`, `BetterAuthEmails`: typed delivery messages, app routes and per-account delivery windows for the mount. |
|
|
1226
|
+
| `server/better-auth/allowedAccounts.ts` | `ProviderAccounts`, `AllowedAccounts`, `allowedAccounts`: provider-account list Schemas and the non-empty `AUTH_ALLOWED_ACCOUNTS` Config. |
|
|
1227
|
+
| `server/better-auth/adapters/accountRoleSeed.ts` | `accountRoleSeed(declaration, role, accounts)`: grant a configured role at boot and sign-in through `assignRole`. |
|
|
1228
|
+
| `server/better-auth/adapters/signInGate.ts` | `SignInPolicy`: the `accounts`, `rule` and `recheckInterval` of a sign-in policy. |
|
|
1229
|
+
| `server/better-auth/adapters/revokeUnadmitted.ts` | `RevokedSessions`: the `{ users, sessions }` counts of a revocation. |
|
|
1230
|
+
| `server/better-auth/userProfiles.ts` | Public profile lookups for other users. |
|
|
1231
|
+
| `server/better-auth/sweepExpiredSessions.ts` | `sweepExpiredSessions`: delete expired sessions through the application's SQL client and return the number removed. |
|
|
1232
|
+
| `server/better-auth/userReference.ts` | `userReference`: the default auth user table and id column for application foreign keys. |
|
|
1233
|
+
| `server/better-auth/testDatabase.ts` | `authTestDatabase`: test-only identity/session readouts and faults for the default PostgreSQL auth schema. |
|
|
1215
1234
|
|
|
1216
1235
|
### Install, setup and limits
|
|
1217
1236
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountPreferences.d.ts","sourceRoot":"","sources":["../../src/generated/AccountPreferences.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAI7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;CAIjC,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"AccountPreferences.d.ts","sourceRoot":"","sources":["../../src/generated/AccountPreferences.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,IAAI,wBAAwB,EAAE,MAAM,wBAAwB,CAAC;AAI7F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;CAIjC,CAAC;AAEX,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;aAU7B,CAAC;AAEH,eAAO,MAAM,qCAAqC,EAAE,mBAAmB,CAAC,OAAO,kBAAkB,EAAE,OAAO,wBAAwB,CAAQ,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AccountPreferenceValues
|
|
1
|
+
import { AccountPreferenceValues } from "#accountPreferenceValues.ts";
|
|
2
2
|
import { selfSubject } from "#subject.ts";
|
|
3
3
|
import { clientContract } from "@shivaedev/contract/clientContract.ts";
|
|
4
4
|
import { AuthUnavailable } from "@shivaedev/errors/taxonomy.ts";
|
|
@@ -9,18 +9,13 @@ export const identityAccountPreferencesWire = {
|
|
|
9
9
|
set: { rejections: { AuthUnavailable }, success: Schema.Void },
|
|
10
10
|
};
|
|
11
11
|
export const AccountPreferences = clientContract({
|
|
12
|
-
commands:
|
|
13
|
-
capture: { invalidates: () => [accountPreferenceKeys.list] },
|
|
14
|
-
set: { invalidates: () => [accountPreferenceKeys.list] },
|
|
15
|
-
},
|
|
12
|
+
commands: ["capture", "set"],
|
|
16
13
|
name: "identity.accountPreferences",
|
|
17
14
|
payloads: {
|
|
18
15
|
capture: AccountPreferenceValues.fields,
|
|
19
16
|
set: AccountPreferenceValues.fields,
|
|
20
17
|
},
|
|
21
|
-
queries:
|
|
22
|
-
get: { reads: () => [accountPreferenceKeys.list] },
|
|
23
|
-
},
|
|
18
|
+
queries: ["get"],
|
|
24
19
|
subject: selfSubject,
|
|
25
20
|
wire: identityAccountPreferencesWire,
|
|
26
21
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccountPreferences.js","sourceRoot":"","sources":["../../src/generated/AccountPreferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,
|
|
1
|
+
{"version":3,"file":"AccountPreferences.js","sourceRoot":"","sources":["../../src/generated/AccountPreferences.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM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AwB,CAAC;AAG5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGvB,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Sessions.d.ts","sourceRoot":"","sources":["../../src/generated/Sessions.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,QAAQ,IAAI,cAAc,EAAE,MAAM,cAAc,CAAC;AAC/D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAG5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAGvB,CAAC;AAEX,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;uDAUnB,CAAC;AAEH,eAAO,MAAM,2BAA2B,EAAE,mBAAmB,CAAC,OAAO,QAAQ,EAAE,OAAO,cAAc,CAAQ,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SessionsPermission } from "#sessionPermissions.ts";
|
|
2
|
-
import { SessionListInput
|
|
2
|
+
import { SessionListInput } from "#signedInSessions.ts";
|
|
3
3
|
import { clientContract } from "@shivaedev/contract/clientContract.ts";
|
|
4
4
|
import { AuthUnavailable, Forbidden, NotFound } from "@shivaedev/errors/taxonomy.ts";
|
|
5
5
|
import { Schema } from "effect";
|
|
@@ -8,18 +8,14 @@ export const identitySessionsWire = {
|
|
|
8
8
|
revoke: { rejections: { AuthUnavailable, Forbidden, NotFound }, success: Schema.Void },
|
|
9
9
|
};
|
|
10
10
|
export const Sessions = clientContract({
|
|
11
|
-
commands:
|
|
12
|
-
revoke: { invalidates: () => [sessionKeys.list] },
|
|
13
|
-
},
|
|
11
|
+
commands: ["revoke"],
|
|
14
12
|
middleware: SessionsPermission,
|
|
15
13
|
name: "identity.sessions",
|
|
16
14
|
payloads: {
|
|
17
15
|
list: SessionListInput.fields,
|
|
18
16
|
revoke: { id: Schema.String },
|
|
19
17
|
},
|
|
20
|
-
queries:
|
|
21
|
-
list: { reads: () => [sessionKeys.list] },
|
|
22
|
-
},
|
|
18
|
+
queries: ["list"],
|
|
23
19
|
wire: identitySessionsWire,
|
|
24
20
|
});
|
|
25
21
|
export const identitySessionsMatchModule = true;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sessions.js","sourceRoot":"","sources":["../../src/generated/Sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,
|
|
1
|
+
{"version":3,"file":"Sessions.js","sourceRoot":"","sources":["../../src/generated/Sessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAC5D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,+BAA+B,CAAC;AACrF,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,CAAC,MAAM,oBAAoB,GAAG;IACnC,IAAI,EAAE,EAAE,UAAU,EAAE,EAAE,eAAe,EAAE,SAAS,EAAE,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Schema.brand<Schema.$Array<Schema.String>, "NativeOrigins">;
|
|
3
|
+
export type NativeOrigins = typeof NativeOrigins.Type;
|
|
4
|
+
export declare const declaredNativeOrigins: (origins: readonly string[] | undefined) => Effect.Effect<(readonly string[] & import("effect/Brand").Brand<"NativeOrigins">) | undefined, Config.ConfigError, never>;
|
|
5
|
+
//# sourceMappingURL=NativeOrigins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeOrigins.d.ts","sourceRoot":"","sources":["../../src/server/NativeOrigins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhD,eAAO,MAAM,aAAa,6DAWW,CAAC;AAEtC,MAAM,MAAM,aAAa,GAAG,OAAO,aAAa,CAAC,IAAI,CAAC;AAEtD,eAAO,MAAM,qBAAqB,uKAKhC,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Config, Effect, Schema } from "effect";
|
|
2
|
+
export const NativeOrigins = Schema.Array(Schema.String.check(Schema.makeFilter((origin) => {
|
|
3
|
+
if (!URL.canParse(origin)) {
|
|
4
|
+
return false;
|
|
5
|
+
}
|
|
6
|
+
const url = new URL(origin);
|
|
7
|
+
const authority = url.origin === "null" ? `${url.protocol}//${url.host}` : url.origin;
|
|
8
|
+
return url.host !== "" && !origin.includes("*") && authority === origin;
|
|
9
|
+
}))).pipe(Schema.brand("NativeOrigins"));
|
|
10
|
+
export const declaredNativeOrigins = Effect.fnUntraced(function* (origins) {
|
|
11
|
+
if (origins === undefined) {
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
return yield* Schema.decodeUnknownEffect(NativeOrigins)(origins).pipe(Effect.mapError((cause) => new Config.ConfigError(cause)));
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=NativeOrigins.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"NativeOrigins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C"}
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Context, type Duration } from "effect";
|
|
2
2
|
import type { RoleSet } from "@shivaedev/access/roleSet.ts";
|
|
3
|
+
import type { NativeOrigins } from "#server/NativeOrigins.ts";
|
|
3
4
|
import type { OriginPolicy } from "#server/origin.ts";
|
|
4
5
|
import type { SessionProvider, SessionShape } from "#server/session.ts";
|
|
5
6
|
declare const SessionPolicy_base: Context.ServiceClass<SessionPolicy, "@shivaedev/identity/SessionPolicy", {
|
|
7
|
+
readonly nativeOrigins?: NativeOrigins | undefined;
|
|
6
8
|
readonly origin: OriginPolicy;
|
|
7
9
|
readonly provider: SessionProvider<SessionShape>;
|
|
8
10
|
readonly roles?: RoleSet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionPolicy.d.ts","sourceRoot":"","sources":["../../src/server/SessionPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;;
|
|
1
|
+
{"version":3,"file":"SessionPolicy.d.ts","sourceRoot":"","sources":["../../src/server/SessionPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,QAAQ,CAAC;AAChD,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACtD,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;;6BAK7C,aAAa,GAAG,SAAS;qBACjC,YAAY;uBACV,eAAe,CAAC,YAAY,CAAC;qBAC/B,OAAO;0CACc,QAAQ,CAAC,KAAK,GAAG,SAAS;;AAPlE,qBAAa,aAAc,SAAQ,kBASK;CAAG"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionPolicy.js","sourceRoot":"","sources":["../../src/server/SessionPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"SessionPolicy.js","sourceRoot":"","sources":["../../src/server/SessionPolicy.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAiB,MAAM,QAAQ,CAAC;AAMhD,MAAM,OAAO,aAAc,SAAQ,OAAO,CAAC,OAAO,EAS/C,CAAC,mCAAmC,CAAC;CAAG"}
|
|
@@ -6,6 +6,6 @@ export declare function sameOrigin(request: Pick<TransportRequest, "headers">):
|
|
|
6
6
|
export declare const loopbackOnly: <E, R>(handler: Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R | HttpServerRequest.HttpServerRequest>;
|
|
7
7
|
export declare function trustedProxyPeer(trustedProxy?: string): (address: string) => boolean;
|
|
8
8
|
export declare function localTransport(trustedProxy?: string, nativeOrigins?: readonly string[]): (request: TransportRequest) => boolean;
|
|
9
|
-
export declare const localRpcGuard: <E, R>(effect: Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>, trustedProxy?: string | undefined
|
|
9
|
+
export declare const localRpcGuard: <E, R>(effect: Effect.Effect<HttpServerResponse.HttpServerResponse, E, R>, trustedProxy?: string | undefined) => Effect.Effect<HttpServerResponse.HttpServerResponse, E, R | HttpServerRequest.HttpServerRequest | RpcSerialization.RpcSerialization>;
|
|
10
10
|
export {};
|
|
11
11
|
//# sourceMappingURL=local.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAoB,MAAM,aAAa,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,KAAK,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;AAoB/F,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG,OAAO,CAW9E;AACD,eAAO,MAAM,YAAY,GAAgC,CAAC,EAAE,CAAC,0KAK3D,CAAC;AACH,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAGpF;AAkBD,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,GAAE,SAAS,MAAM,EAAO,aAEzE,gBAAgB,KAAG,OAAO,CAK3C;AACD,eAAO,MAAM,aAAa,GAAgC,CAAC,EAAE,CAAC
|
|
1
|
+
{"version":3,"file":"local.d.ts","sourceRoot":"","sources":["../../../src/server/adapters/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAU,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB,EAAoB,MAAM,aAAa,CAAC;AAEtF,OAAO,EAAE,gBAAgB,EAAE,MAAM,YAAY,CAAC;AAI9C,KAAK,gBAAgB,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,EAAE,SAAS,GAAG,eAAe,CAAC,CAAC;AAoB/F,wBAAgB,UAAU,CAAC,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,SAAS,CAAC,GAAG,OAAO,CAW9E;AACD,eAAO,MAAM,YAAY,GAAgC,CAAC,EAAE,CAAC,0KAK3D,CAAC;AACH,wBAAgB,gBAAgB,CAAC,YAAY,CAAC,EAAE,MAAM,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAGpF;AAkBD,wBAAgB,cAAc,CAAC,YAAY,CAAC,EAAE,MAAM,EAAE,aAAa,GAAE,SAAS,MAAM,EAAO,aAEzE,gBAAgB,KAAG,OAAO,CAK3C;AACD,eAAO,MAAM,aAAa,GAAgC,CAAC,EAAE,CAAC,gPAa5D,CAAC"}
|
|
@@ -70,11 +70,10 @@ export function localTransport(trustedProxy, nativeOrigins = []) {
|
|
|
70
70
|
return (local && (native || sameOrigin(request))) || proxyOrigin(request, isTrustedProxy, native);
|
|
71
71
|
};
|
|
72
72
|
}
|
|
73
|
-
export const localRpcGuard = Effect.fnUntraced(function* (effect, trustedProxy
|
|
73
|
+
export const localRpcGuard = Effect.fnUntraced(function* (effect, trustedProxy) {
|
|
74
74
|
const request = yield* HttpServerRequest.HttpServerRequest;
|
|
75
|
-
const policy = yield* Effect.serviceOption(SessionPolicy);
|
|
76
|
-
const
|
|
77
|
-
const allowed = localTransport(trustedProxy, [...nativeOrigins, ...origins]);
|
|
75
|
+
const policy = Option.getOrUndefined(yield* Effect.serviceOption(SessionPolicy));
|
|
76
|
+
const allowed = localTransport(trustedProxy, [...(policy?.nativeOrigins ?? []), ...(policy?.origin.trustedOrigins ?? [])]);
|
|
78
77
|
const serialization = yield* RpcSerialization.RpcSerialization;
|
|
79
78
|
const contentType = request.headers["content-type"]?.split(";")[0]?.trim().toLowerCase();
|
|
80
79
|
const legacyNdjson = serialization.contentType === RpcSerialization.ndjson.contentType && contentType === "application/ndjson";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"local.js","sourceRoot":"","sources":["../../../src/server/adapters/local.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,kBAAkB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AAK,CAAC,CAAC,MAAM,CAAC,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AACrD,CAAC,CAAC,CAAC"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type GetProviderAccounts, type GetSession, type SessionWithProviderAccounts } from "#server/adapters/betterAuthSessions.ts";
|
|
2
|
-
import { type BearerSessionsOptions } from "#server/better-auth/adapters/bearerSessions.ts";
|
|
3
2
|
import { type PolicyStorage, type SignInGate } from "#server/better-auth/adapters/signInGate.ts";
|
|
4
3
|
import type { SessionProvider, SessionShape } from "#server/session.ts";
|
|
5
4
|
interface SessionStorage extends PolicyStorage {
|
|
@@ -9,7 +8,7 @@ interface SessionStorage extends PolicyStorage {
|
|
|
9
8
|
};
|
|
10
9
|
};
|
|
11
10
|
}
|
|
12
|
-
export declare function admittedSessions<E>(gate: SignInGate<E>, storage: () => Promise<SessionStorage>, bearerSessions?:
|
|
11
|
+
export declare function admittedSessions<E>(gate: SignInGate<E>, storage: () => Promise<SessionStorage>, bearerSessions?: boolean): {
|
|
13
12
|
<TSession extends SessionShape>(getSession: GetSession<TSession>): SessionProvider<TSession>;
|
|
14
13
|
<TSession extends SessionShape>(getSession: GetSession<TSession>, getProviderAccounts: GetProviderAccounts): SessionProvider<SessionWithProviderAccounts<TSession>>;
|
|
15
14
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admittedSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/admittedSessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,MAAM,wCAAwC,CAAC;
|
|
1
|
+
{"version":3,"file":"admittedSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/admittedSessions.ts"],"names":[],"mappings":"AAEA,OAAO,EAEN,KAAK,mBAAmB,EACxB,KAAK,UAAU,EACf,KAAK,2BAA2B,EAChC,MAAM,wCAAwC,CAAC;AAEhD,OAAO,EAAe,KAAK,aAAa,EAAE,KAAK,UAAU,EAAE,MAAM,4CAA4C,CAAC;AAE9G,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAExE,UAAU,cAAe,SAAQ,aAAa;IAC7C,QAAQ,CAAC,WAAW,EAAE;QAAE,QAAQ,CAAC,YAAY,EAAE;YAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAC;CAC3E;AAED,wBAAgB,gBAAgB,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,EAAE,cAAc,UAAQ;KACvG,QAAQ,SAAS,YAAY,cAAc,UAAU,CAAC,QAAQ,CAAC,GAAG,eAAe,CAAC,QAAQ,CAAC;KAC3F,QAAQ,SAAS,YAAY,cAC/B,UAAU,CAAC,QAAQ,CAAC,uBACX,mBAAmB,GACtC,eAAe,CAAC,2BAA2B,CAAC,QAAQ,CAAC,CAAC;EA0BzD"}
|
|
@@ -4,13 +4,13 @@ import { betterAuthSessions, } from "#server/adapters/betterAuthSessions.ts";
|
|
|
4
4
|
import { sessionHeaders } from "#server/better-auth/adapters/bearerSessions.ts";
|
|
5
5
|
import { fromStorage } from "#server/better-auth/adapters/signInGate.ts";
|
|
6
6
|
import { providerFailure } from "#server/providerFailure.ts";
|
|
7
|
-
export function admittedSessions(gate, storage, bearerSessions) {
|
|
7
|
+
export function admittedSessions(gate, storage, bearerSessions = false) {
|
|
8
8
|
function admit(getSession, getProviderAccounts) {
|
|
9
9
|
const provider = getProviderAccounts === undefined ? betterAuthSessions(getSession) : betterAuthSessions(getSession, getProviderAccounts);
|
|
10
10
|
return {
|
|
11
11
|
get: Effect.fnUntraced(function* (headers) {
|
|
12
|
-
const auth = gate.active || bearerSessions
|
|
13
|
-
const selected = bearerSessions
|
|
12
|
+
const auth = gate.active || bearerSessions ? yield* fromStorage(storage) : undefined;
|
|
13
|
+
const selected = !bearerSessions || auth === undefined
|
|
14
14
|
? headers
|
|
15
15
|
: HttpHeaders.fromInput(sessionHeaders(new Headers(headers), auth.authCookies.sessionToken.name));
|
|
16
16
|
const session = yield* provider.get(selected);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admittedSessions.js","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/admittedSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACN,kBAAkB,GAIlB,MAAM,wCAAwC,CAAC;AAChD,OAAO,
|
|
1
|
+
{"version":3,"file":"admittedSessions.js","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/admittedSessions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AACxC,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EACN,kBAAkB,GAIlB,MAAM,wCAAwC,CAAC;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,gDAAgD,CAAC;AAChF,OAAO,EAAE,WAAW,EAAuC,MAAM,4CAA4C,CAAC;AAC9G,OAAO,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAC;AAO7D,MAAM,UAAU,gBAAgB,CAAI,IAAmB,EAAE,OAAsC,EAAE,cAAc,GAAG,KAAK;IAMtH,SAAS,KAAK,CAAgC,UAAgC,EAAE,mBAAyC;QACxH,MAAM,QAAQ,GAAG,mBAAmB,KAAK,SAAS,CAAC,CAAC,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,kBAAkB,CAAC,UAAU,EAAE,mBAAmB,CAAC,CAAC;QAC1I,OAAO;YACN,GAAG,EAAE,MAAM,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BAC5G,OAAO,MAAM,CAAC,IAAI,EAAE,CAAC;YACtB,CAAC,CAAC;SACF,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACd,CAAC"}
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { BetterAuthOptions } from "better-auth";
|
|
2
|
-
export interface BearerSessionsOptions {
|
|
3
|
-
readonly origins: readonly string[];
|
|
4
|
-
}
|
|
5
2
|
export declare function withBearerSessions<TOptions extends BetterAuthOptions>(options: TOptions, enabled: boolean): TOptions;
|
|
3
|
+
export declare function nativeTrustedOrigins(trusted: NonNullable<BetterAuthOptions["trustedOrigins"]>, nativeOrigins?: readonly string[]): NonNullable<BetterAuthOptions["trustedOrigins"]>;
|
|
6
4
|
export declare function hasSessionCookie(headers: Headers, cookieName: string): boolean;
|
|
7
5
|
export declare function sessionHeaders(headers: Headers, cookieName: string): Headers;
|
|
8
6
|
export declare function cookieSessionResponse(response: Response): Promise<Response>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearerSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/bearerSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,
|
|
1
|
+
{"version":3,"file":"bearerSessions.d.ts","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/bearerSessions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAIrD,wBAAgB,kBAAkB,CAAC,QAAQ,SAAS,iBAAiB,EAAE,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,GAAG,QAAQ,CAEpH;AAED,wBAAgB,oBAAoB,CACnC,OAAO,EAAE,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,EACzD,aAAa,GAAE,SAAS,MAAM,EAAO,GACnC,WAAW,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,CAAC,CAKlD;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAO9E;AAED,wBAAgB,cAAc,CAAC,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,GAAG,OAAO,CAQ5E;AAED,wBAAsB,qBAAqB,CAAC,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC,CAwBjF"}
|
|
@@ -3,6 +3,12 @@ import { Result } from "effect";
|
|
|
3
3
|
export function withBearerSessions(options, enabled) {
|
|
4
4
|
return enabled ? { ...options, plugins: [...(options.plugins ?? []), bearer({ requireSignature: true })] } : options;
|
|
5
5
|
}
|
|
6
|
+
export function nativeTrustedOrigins(trusted, nativeOrigins = []) {
|
|
7
|
+
if (nativeOrigins.length === 0) {
|
|
8
|
+
return trusted;
|
|
9
|
+
}
|
|
10
|
+
return typeof trusted === "function" ? async (request) => [...(await trusted(request)), ...nativeOrigins] : [...trusted, ...nativeOrigins];
|
|
11
|
+
}
|
|
6
12
|
export function hasSessionCookie(headers, cookieName) {
|
|
7
13
|
return (headers
|
|
8
14
|
.get("cookie")
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bearerSessions.js","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/bearerSessions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;
|
|
1
|
+
{"version":3,"file":"bearerSessions.js","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters/bearerSessions.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAC;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,MAAM,UAAU,kBAAkB,CAAqC,OAAiB,EAAE,OAAgB;IACzG,OAAO,OAAO,CAAC,CAAC,CAAC,EAA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AM,CAAC,KAAK,CAAC,EAAE,CAAC,GAAG,EAAE,KAAc,EAAE,EAAE,CAAC,CAAC,GAAG,KAAK,OAAO,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpJ,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5B,OAAO,IAAI,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IAClC,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;IACjC,OAAO,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;AAC1C,CAAC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { type Cause, Effect } from "effect";
|
|
2
2
|
import type { RoleSet } from "@shivaedev/access/roleSet.ts";
|
|
3
|
-
import { type BearerSessionsOptions } from "#server/better-auth/adapters/bearerSessions.ts";
|
|
4
3
|
import type { HookRefusal } from "#server/better-auth/adapters/hookRuntime.ts";
|
|
5
4
|
export interface MountedAuth {
|
|
6
5
|
readonly $context: Promise<{
|
|
@@ -14,9 +13,9 @@ export interface MountedAuth {
|
|
|
14
13
|
}
|
|
15
14
|
export interface MountRouteOptions {
|
|
16
15
|
readonly basePath?: string | undefined;
|
|
17
|
-
readonly bearerSessions?: BearerSessionsOptions | undefined;
|
|
18
16
|
readonly clientIpHeader: string;
|
|
19
17
|
readonly ipv6Subnet?: number | undefined;
|
|
18
|
+
readonly nativeOrigins?: readonly string[] | undefined;
|
|
20
19
|
readonly roles?: RoleSet | undefined;
|
|
21
20
|
readonly runRequest?: (<A>(request: (signal: AbortSignal) => Promise<A>) => Effect.Effect<A, Cause.UnknownError | HookRefusal>) | undefined;
|
|
22
21
|
readonly trustedProxy?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../../../../src/server/better-auth/adapters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