@storyshelf/auth 0.6.2 → 0.7.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/README.md +13 -6
- package/package.json +9 -8
package/README.md
CHANGED
|
@@ -34,10 +34,17 @@ const app = createShelfApp({ database, storage, auth: shelf.adapter });
|
|
|
34
34
|
|
|
35
35
|
## Recipes
|
|
36
36
|
|
|
37
|
-
- `githubPreset`, `gitlabPreset`, `googlePreset`, `entraPreset`, `cognitoPreset`
|
|
38
|
-
- `keycloakPreset`, `oktaPreset`, `auth0Preset`
|
|
39
|
-
- `ssoKeycloakPreset`, `ssoOktaPreset`, `ssoAuth0Preset`, `ssoGooglePreset`, `ssoEntraPreset
|
|
40
|
-
- `issueInvite` / `verifyInvite` / `acceptInvite` (
|
|
41
|
-
- `ensurePasswordAdmin
|
|
37
|
+
- **Social** — `githubPreset`, `gitlabPreset`, `googlePreset`, `entraPreset`, `cognitoPreset` (native provider integrations — see [social providers](https://www.better-auth.com/docs/reference/social-providers)).
|
|
38
|
+
- **Enterprise OIDC** — `keycloakPreset`, `oktaPreset`, `auth0Preset` (configs via [generic OAuth](https://www.better-auth.com/docs/plugins/generic-oauth)).
|
|
39
|
+
- **Enterprise SSO** — `ssoKeycloakPreset`, `ssoOktaPreset`, `ssoAuth0Preset`, `ssoGooglePreset`, `ssoEntraPreset` (domain-routed OIDC via IdP discovery) and `samlPreset` (explicit IdP fields or metadata XML) via the [SSO plugin](https://www.better-auth.com/docs/plugins/sso). IdP callback URLs via `ssoCallbackUrls(baseURL, providerId)`.
|
|
40
|
+
- **Invites** — `issueInvite` / `verifyInvite` / `acceptInvite` (single-use, 7-day, hashed at rest; re-invite is password recovery). Minimum password length is 12.
|
|
41
|
+
- **Dev bootstrap** — `ensurePasswordAdmin(database, { email, password })` provisions the env-driven local admin.
|
|
42
|
+
- **Sessions/passkeys inventory** — `listUserSessions`, `listUserPasskeys`, `hasPasswordCredential` (drive the `/profile` Devices and Passkeys sections).
|
|
42
43
|
|
|
43
|
-
|
|
44
|
+
Secrets stay out of code with `{env:NAME}` refs (resolved from `process.env`, then your `resolveSecrets` hook for Vault/AWS/GCP). Precedence: explicit literal > `{env}` ref > schema default; code recipes > DB rows > plugin defaults.
|
|
45
|
+
|
|
46
|
+
See the [authentication guide](https://storyshelf.js.org/guides/auth/) and [auth concepts](https://storyshelf.js.org/concepts/auth/) for the invite playbook, passkey prerequisites, secrets, and the engine→shelf user mirror.
|
|
47
|
+
|
|
48
|
+
## Plugin contract
|
|
49
|
+
|
|
50
|
+
Custom [Better Auth](https://www.better-auth.com/docs) plugins ride `plugins: [...]`. Two boot-time guards: login method ids must be unique across providers, and custom endpoints must not shadow shelf-reserved engine paths (`/sign-in/*`, `/sign-up/email`, session revocation — see [endpoints](https://www.better-auth.com/docs/reference/endpoints)). Runtime SSO provider management is blocked — providers are code-driven recipes.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storyshelf/auth",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.7.0",
|
|
4
4
|
"description": "Better Auth engine for StoryShelf: opaque DBAdapter bridge, shelf factory, and auth presets.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"auth",
|
|
@@ -26,9 +26,6 @@
|
|
|
26
26
|
"dist"
|
|
27
27
|
],
|
|
28
28
|
"type": "module",
|
|
29
|
-
"engines": {
|
|
30
|
-
"node": ">=24"
|
|
31
|
-
},
|
|
32
29
|
"sideEffects": false,
|
|
33
30
|
"types": "./dist/index.d.mts",
|
|
34
31
|
"exports": {
|
|
@@ -51,18 +48,19 @@
|
|
|
51
48
|
"fmt": "oxfmt ./src",
|
|
52
49
|
"lint": "oxlint --type-aware --type-check ./src",
|
|
53
50
|
"test": "vitest run",
|
|
54
|
-
"prepublishOnly": "nub run build"
|
|
51
|
+
"prepublishOnly": "nub run build",
|
|
52
|
+
"test:flake": "vitest run --repeats=10 --maxWorkers=1 --no-file-parallelism src/engine.test.ts"
|
|
55
53
|
},
|
|
56
54
|
"dependencies": {
|
|
57
55
|
"@better-auth/passkey": "1.7.6",
|
|
58
56
|
"@better-auth/sso": "1.7.6",
|
|
59
|
-
"@storyshelf/core": "0.
|
|
57
|
+
"@storyshelf/core": "0.7.0",
|
|
60
58
|
"better-auth": "1.7.6",
|
|
61
59
|
"zod": "^4.2.0"
|
|
62
60
|
},
|
|
63
61
|
"devDependencies": {
|
|
64
|
-
"@storyshelf/db-postgres": "0.
|
|
65
|
-
"@storyshelf/db-sqlite": "0.
|
|
62
|
+
"@storyshelf/db-postgres": "0.7.0",
|
|
63
|
+
"@storyshelf/db-sqlite": "0.7.0",
|
|
66
64
|
"@types/node": "^26.0.0",
|
|
67
65
|
"@vitest/coverage-v8": "^4.0.0",
|
|
68
66
|
"oxfmt": "^0.65.0",
|
|
@@ -72,6 +70,9 @@
|
|
|
72
70
|
"typescript": "^7.0.2",
|
|
73
71
|
"vitest": "^5.0.0"
|
|
74
72
|
},
|
|
73
|
+
"engines": {
|
|
74
|
+
"node": ">=24"
|
|
75
|
+
},
|
|
75
76
|
"jsr": {
|
|
76
77
|
"runtimeCompat": {
|
|
77
78
|
"node": true,
|