@jskit-ai/agent-docs 0.1.325 → 0.1.327
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/guide/agent/app-setup/authentication.md +121 -1
- package/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +1 -1
- package/patterns/shell-foundation/example/package.json +1 -1
- package/reference/autogen/PATTERN_INDEX.md +13 -13
- package/reference/autogen/README.md +1 -0
- package/reference/autogen/packages/auth-pass.md +42 -0
- package/reference/autogen/packages/auth-provider-local-core.md +19 -1
- package/reference/autogen/packages/auth-provider-local-db-core.md +9 -0
- package/reference/autogen/packages/auth-web.md +6 -0
- package/skills/jskit/references/pattern-index.md +13 -13
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +1 -1
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +1 -1
- package/skills/jskit/references/patterns/auth/oidc-sign-in/example/package.json +2 -2
- package/skills/jskit/references/patterns/auth/supabase-auth/example/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +2 -2
|
@@ -100,7 +100,7 @@ request over it is refused with status 429, the code `kernel.http.rateLimited`
|
|
|
100
100
|
defaults, per minute: `login`, `register`, `registerConfirm`,
|
|
101
101
|
`loginOtpRequest` and `loginOtpVerify` 10; `registerConfirmationResend` and
|
|
102
102
|
`passwordForgot` 5;
|
|
103
|
-
`oauthStart`, `oauthComplete`, `passwordRecovery` and `passwordReset` 20;
|
|
103
|
+
`oauthStart`, `oauthComplete`, `passSignIn`, `passwordRecovery` and `passwordReset` 20;
|
|
104
104
|
`devLoginAs` 30. Change one in the application's server configuration;
|
|
105
105
|
`false` removes it:
|
|
106
106
|
|
|
@@ -510,6 +510,126 @@ and on every server, writes no `first-account-setup-code` file, and logs only
|
|
|
510
510
|
that the code is in `AUTH_LOCAL_SETUP_CODE`, never the code itself. Outside
|
|
511
511
|
production the variable is ignored.
|
|
512
512
|
|
|
513
|
+
## One-time pass sign-in (local auth)
|
|
514
|
+
|
|
515
|
+
An application whose people already signed in somewhere else, such as a
|
|
516
|
+
hosting site that opens each person's own server, can let that site sign them
|
|
517
|
+
in with no second password. The site, the issuer, signs a pass with its
|
|
518
|
+
Ed25519 private key; the application holds only the public key. A pass names
|
|
519
|
+
one person (`sub`), the application it is for (`aud`), one resource of that
|
|
520
|
+
application (`resource`, such as the one server it runs on) and its own id
|
|
521
|
+
(`jti`), and lasts a minute. The person's browser posts it to the application,
|
|
522
|
+
which signs in the account the pass names, once.
|
|
523
|
+
|
|
524
|
+
Three settings turn it on; without the key nothing changes: there is no pass
|
|
525
|
+
route and password sign-in stays as it is.
|
|
526
|
+
|
|
527
|
+
| Env | Meaning |
|
|
528
|
+
| --- | --- |
|
|
529
|
+
| `AUTH_PASS_PUBLIC_KEY` | The issuer's Ed25519 public key: a PEM block, or its base64 DER on one line (the PEM body without its header lines). |
|
|
530
|
+
| `AUTH_PASS_AUDIENCE` | The application every pass must name, such as `editor`. Required with the key. |
|
|
531
|
+
| `AUTH_PASS_RESOURCE` | The one resource every pass must name, such as this server's name. Required with the key. |
|
|
532
|
+
|
|
533
|
+
The application says which account a pass signs in with the
|
|
534
|
+
`auth.local.pass-identity` capability, a function given the verified pass
|
|
535
|
+
(`{ id, subject, audience, resource, issuedAt, expiresAt, usableUntil }`) that
|
|
536
|
+
answers the local account's id, or null when its subject has none here. With
|
|
537
|
+
the key set and no mapping installed, startup stops saying so.
|
|
538
|
+
|
|
539
|
+
```js
|
|
540
|
+
import { defineProvider } from "@jskit-ai/kernel/shared/capabilities";
|
|
541
|
+
|
|
542
|
+
export const PassIdentityProvider = defineProvider({
|
|
543
|
+
id: "app.pass-identity",
|
|
544
|
+
requires: { accounts: "auth.local.accounts" },
|
|
545
|
+
provides: { passIdentity: "auth.local.pass-identity" },
|
|
546
|
+
/** @param {{ accounts: import("@jskit-ai/auth-provider-local-db-core/server/types").AuthLocalAccounts }} capabilities */
|
|
547
|
+
setup({ accounts }) {
|
|
548
|
+
/** @type {import("@jskit-ai/auth-provider-local-core/server/types").AuthLocalPassIdentity} */
|
|
549
|
+
async function passIdentity(pass) {
|
|
550
|
+
// This issuer names each person by the email of their account here.
|
|
551
|
+
return (await accounts.findByEmail(pass.subject))?.id ?? null;
|
|
552
|
+
}
|
|
553
|
+
return { passIdentity };
|
|
554
|
+
}
|
|
555
|
+
});
|
|
556
|
+
```
|
|
557
|
+
|
|
558
|
+
For direct library composition, pass it as `passIdentity` to
|
|
559
|
+
`createLocalAuthService()`, whose `signInWithPass({ pass })` signs in and
|
|
560
|
+
answers as `login` does.
|
|
561
|
+
|
|
562
|
+
The browser posts the pass as the form field `pass` to `POST /api/login/pass`,
|
|
563
|
+
from a page of the issuer's that submits itself, so the pass never sits in an
|
|
564
|
+
address, a history or a log:
|
|
565
|
+
|
|
566
|
+
```html
|
|
567
|
+
<form method="post" action="https://app.example.com/api/login/pass">
|
|
568
|
+
<input type="hidden" name="pass" value="PASS">
|
|
569
|
+
</form>
|
|
570
|
+
<script>document.forms[0].submit();</script>
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
A pass that signs in sets the session cookies and answers `303` to `/`. The pass
|
|
574
|
+
authenticates the post, so the route takes no CSRF token, and it is limited per
|
|
575
|
+
client address like the other sign-in routes (`passSignIn`, 20 a minute). A
|
|
576
|
+
refused pass answers `303` to `/auth/login` with `error=sign_in_unavailable`,
|
|
577
|
+
the reason in `error_description` and its code in `error_code`, and the sign-in
|
|
578
|
+
page shows the reason:
|
|
579
|
+
|
|
580
|
+
| Code | Status | Reason |
|
|
581
|
+
| --- | --- | --- |
|
|
582
|
+
| `auth.pass.malformed` | 401 | Not a pass, issued over 30 seconds ahead of this server's clock, or meant to last over five minutes. |
|
|
583
|
+
| `auth.pass.badSignature` | 401 | Not signed by the issuer's key, or changed after signing. |
|
|
584
|
+
| `auth.pass.wrongAudience` | 401 | For another application. |
|
|
585
|
+
| `auth.pass.wrongResource` | 401 | For another resource. |
|
|
586
|
+
| `auth.pass.expired` | 401 | Expired (30 seconds of clock difference are allowed). |
|
|
587
|
+
| `auth.pass.replayed` | 401 | Already used, on this server or another sharing its store. |
|
|
588
|
+
| `auth.pass.unmapped` | 403 | The mapping names no account, or a disabled one. |
|
|
589
|
+
|
|
590
|
+
Each pass signs in once. Local auth records each pass it accepts, by the hash
|
|
591
|
+
of its id, until it could no longer be used anyway (30 seconds after it
|
|
592
|
+
expired), before it asks the mapping: an unmapped pass is used up too. The
|
|
593
|
+
database backend keeps them in `auth_local_used_passes` (run
|
|
594
|
+
`npm run db:migrate`), so every server on the database refuses a pass another
|
|
595
|
+
accepted; the file backend keeps them in `passes.passwd` in its store. A pass
|
|
596
|
+
signs in an ordinary session: it does not prove a second factor, which a route
|
|
597
|
+
that asks for one still asks for.
|
|
598
|
+
|
|
599
|
+
The pass itself is `@jskit-ai/auth-pass`, a package that installs no providers.
|
|
600
|
+
The issuer signs passes with `signPass` from `@jskit-ai/auth-pass/server`, or
|
|
601
|
+
with any JOSE library: a pass is a compact JWS with the header
|
|
602
|
+
`{ "alg": "EdDSA", "typ": "pass+jwt" }` and the claims above plus `iat` and
|
|
603
|
+
`exp`, in seconds.
|
|
604
|
+
|
|
605
|
+
```js
|
|
606
|
+
import { signPass } from "@jskit-ai/auth-pass/server";
|
|
607
|
+
|
|
608
|
+
// On the issuer's server, which alone holds the private key (a KeyObject or PEM).
|
|
609
|
+
const pass = signPass({ privateKey, subject: "ada@example.com", audience: "editor", resource: "machine-7" });
|
|
610
|
+
```
|
|
611
|
+
|
|
612
|
+
Make the key pair with
|
|
613
|
+
`openssl genpkey -algorithm ed25519 -out pass-issuer.pem`, and the public key
|
|
614
|
+
the application is given with
|
|
615
|
+
`openssl pkey -in pass-issuer.pem -pubout`. The application trusts one key: to
|
|
616
|
+
change it, the issuer starts signing with the new key as the application
|
|
617
|
+
starts with it, and passes signed with the old key are refused. A person who
|
|
618
|
+
holds a valid pass of their own could post it from another person's browser
|
|
619
|
+
and sign that browser in as themselves, as with any sign-in link, so an issuer
|
|
620
|
+
signs passes only for its signed-in person, just before posting them.
|
|
621
|
+
|
|
622
|
+
An application with a sign-in of its own, not local auth, checks passes with
|
|
623
|
+
`@jskit-ai/auth-pass/server` alone. Depending on it installs nothing, while
|
|
624
|
+
depending on auth-core would install auth-core's auth policy, CSRF and auth
|
|
625
|
+
actions in that application. `resolvePassSignInFromEnv(env)` reads the same
|
|
626
|
+
three settings (null without the key). `verifyPass(token, settings)` answers
|
|
627
|
+
the verified pass or throws one of the refusals above. Single use and the
|
|
628
|
+
mapping are then the application's: it records `pass.id` until
|
|
629
|
+
`pass.usableUntil` and throws `createPassError(PASS_TEXTS.passReplayed)` for a
|
|
630
|
+
pass it saw before, then `createPassError(PASS_TEXTS.passUnmapped)` for a
|
|
631
|
+
subject it does not know.
|
|
632
|
+
|
|
513
633
|
## Application-owned recovery email
|
|
514
634
|
|
|
515
635
|
Local auth owns recovery tokens, expiry and recovery-scoped sessions. The
|
package/package.json
CHANGED
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
19
19
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](../../skills/jskit/references/patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
30
30
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](../../skills/jskit/references/patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -48,7 +48,7 @@ Run one OpenID Connect sign-in for all of an owner's apps as its own JSKIT proje
|
|
|
48
48
|
|
|
49
49
|
- Id: `auth/accounts-hub`
|
|
50
50
|
- Keywords: `accounts hub`, `auth`, `authentication`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
51
|
-
- Owner: `@jskit-ai/oidc-issuer-core@0.1.
|
|
51
|
+
- Owner: `@jskit-ai/oidc-issuer-core@0.1.40`
|
|
52
52
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/accounts-hub/PATTERN.md)
|
|
53
53
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/accounts-hub/example/)
|
|
54
54
|
- Requires: `@jskit-ai/oidc-issuer-core`
|
|
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
|
|
|
59
59
|
|
|
60
60
|
- Id: `auth/auth-surface`
|
|
61
61
|
- Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
|
|
62
|
-
- Owner: `@jskit-ai/auth-web@0.2.
|
|
62
|
+
- Owner: `@jskit-ai/auth-web@0.2.42`
|
|
63
63
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/auth-surface/PATTERN.md)
|
|
64
64
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/auth-surface/example/)
|
|
65
65
|
- Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
|
|
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
|
|
|
70
70
|
|
|
71
71
|
- Id: `auth/oidc-sign-in`
|
|
72
72
|
- Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
73
|
-
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.
|
|
73
|
+
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.46`
|
|
74
74
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/oidc-sign-in/PATTERN.md)
|
|
75
75
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/oidc-sign-in/example/)
|
|
76
76
|
- Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
|
|
@@ -81,7 +81,7 @@ Add Supabase authentication through normal npm composition, explicit environment
|
|
|
81
81
|
|
|
82
82
|
- Id: `auth/supabase-auth`
|
|
83
83
|
- Keywords: `auth`, `authentication`, `oauth`, `sessions`, `supabase`
|
|
84
|
-
- Owner: `@jskit-ai/auth-provider-supabase-core@0.2.
|
|
84
|
+
- Owner: `@jskit-ai/auth-provider-supabase-core@0.2.32`
|
|
85
85
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/auth/supabase-auth/PATTERN.md)
|
|
86
86
|
- Examples: [example/](../../skills/jskit/references/patterns/auth/supabase-auth/example/)
|
|
87
87
|
- Requires: `@jskit-ai/auth-provider-supabase-core`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.274`
|
|
250
250
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](../../skills/jskit/references/patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
345
345
|
|
|
346
346
|
- Id: `rewards/google-rewarded`
|
|
347
347
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
348
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
348
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.51`
|
|
349
349
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/rewards/google-rewarded/PATTERN.md)
|
|
350
350
|
- Examples: [example/](../../skills/jskit/references/patterns/rewards/google-rewarded/example/)
|
|
351
351
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
356
356
|
|
|
357
357
|
- Id: `server/feature-package`
|
|
358
358
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
359
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
359
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
360
360
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/server/feature-package/PATTERN.md)
|
|
361
361
|
- Examples: [example/](../../skills/jskit/references/patterns/server/feature-package/example/)
|
|
362
362
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/account-settings`
|
|
391
391
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
392
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-web@0.2.57`
|
|
393
393
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/users/account-settings/PATTERN.md)
|
|
394
394
|
- Examples: [example/](../../skills/jskit/references/patterns/users/account-settings/example/)
|
|
395
395
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -400,7 +400,7 @@ Expose user administration and workspace-scoped member operations through app-ow
|
|
|
400
400
|
|
|
401
401
|
- Id: `users/user-administration-server`
|
|
402
402
|
- Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
|
|
403
|
-
- Owner: `@jskit-ai/users-core@0.2.
|
|
403
|
+
- Owner: `@jskit-ai/users-core@0.2.44`
|
|
404
404
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/users/user-administration-server/PATTERN.md)
|
|
405
405
|
- Examples: [example/](../../skills/jskit/references/patterns/users/user-administration-server/example/)
|
|
406
406
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
|
|
@@ -411,7 +411,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
|
|
|
411
411
|
|
|
412
412
|
- Id: `workspaces/workspace-server`
|
|
413
413
|
- Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
|
|
414
|
-
- Owner: `@jskit-ai/workspaces-core@0.2.
|
|
414
|
+
- Owner: `@jskit-ai/workspaces-core@0.2.44`
|
|
415
415
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-server/PATTERN.md)
|
|
416
416
|
- Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-server/example/)
|
|
417
417
|
- Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
|
|
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
422
422
|
|
|
423
423
|
- Id: `workspaces/workspace-surfaces`
|
|
424
424
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
425
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
425
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.57`
|
|
426
426
|
- Read: [PATTERN.md](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
427
427
|
- Examples: [example/](../../skills/jskit/references/patterns/workspaces/workspace-surfaces/example/)
|
|
428
428
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
|
@@ -20,6 +20,7 @@ AI-first source patterns are indexed in `PATTERN_INDEX.md`.
|
|
|
20
20
|
- [assistant-voice](/packages/agent-docs/reference/autogen/packages/assistant-voice.md)
|
|
21
21
|
- [assistant-voice-sherpa](/packages/agent-docs/reference/autogen/packages/assistant-voice-sherpa.md)
|
|
22
22
|
- [auth-core](/packages/agent-docs/reference/autogen/packages/auth-core.md)
|
|
23
|
+
- [auth-pass](/packages/agent-docs/reference/autogen/packages/auth-pass.md)
|
|
23
24
|
- [auth-provider-local-core](/packages/agent-docs/reference/autogen/packages/auth-provider-local-core.md)
|
|
24
25
|
- [auth-provider-local-db-core](/packages/agent-docs/reference/autogen/packages/auth-provider-local-db-core.md)
|
|
25
26
|
- [auth-provider-oidc-core](/packages/agent-docs/reference/autogen/packages/auth-provider-oidc-core.md)
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# packages/auth-pass
|
|
2
|
+
|
|
3
|
+
Generated by `npm run agent-docs:build`.
|
|
4
|
+
Do not edit manually.
|
|
5
|
+
|
|
6
|
+
Generated inventory for `packages/auth-pass`.
|
|
7
|
+
Use this on demand; do not load the full index at startup.
|
|
8
|
+
|
|
9
|
+
## Scope
|
|
10
|
+
- Source: `packages/auth-pass/**/*{.js,.mjs,.cjs,.vue}`
|
|
11
|
+
- Excludes: `.build/`, `.git/`, `.jscpd/`, `.jskit/`, `coverage/`, `dist/`, `docs/`, `node_modules/`, `test/`, `tests/`, `__tests__/`, `.vitepress/cache/`, `.vitepress/dist/`, `skills/jskit/references/patterns/`, `*.test.*`, `*.spec.*`, `*.vitest.*`
|
|
12
|
+
|
|
13
|
+
## Sections
|
|
14
|
+
|
|
15
|
+
### src
|
|
16
|
+
|
|
17
|
+
### `src/server/index.js`
|
|
18
|
+
Exports
|
|
19
|
+
- `resolvePassSignInFromEnv`
|
|
20
|
+
- `signPass`
|
|
21
|
+
- `verifyPass`
|
|
22
|
+
- `PASS_TEXTS`
|
|
23
|
+
- `createPassError`
|
|
24
|
+
- `type AuthPass`
|
|
25
|
+
|
|
26
|
+
### `src/server/passSignIn.js`
|
|
27
|
+
Exports
|
|
28
|
+
- `resolvePassSignInFromEnv(env)`
|
|
29
|
+
- `signPass({ privateKey, subject, audience, resource, id = randomBytes(18).toString("base64url"), lifetimeSeconds = PASS_LIFETIME_SECONDS, now = Date.now() })`
|
|
30
|
+
- `verifyPass(token, { publicKey, audience, resource }, now = Date.now())`
|
|
31
|
+
- `type AuthPass`
|
|
32
|
+
Local functions
|
|
33
|
+
- `base64urlJson(value)`
|
|
34
|
+
- `parseBase64urlJson(part)`
|
|
35
|
+
- `isClaimText(value)`
|
|
36
|
+
- `isClaimSeconds(value)`
|
|
37
|
+
- `readPassPublicKey(text)`
|
|
38
|
+
|
|
39
|
+
### `src/server/passTexts.js`
|
|
40
|
+
Exports
|
|
41
|
+
- `PASS_TEXTS`
|
|
42
|
+
- `createPassError(entry)`
|
|
@@ -93,6 +93,7 @@ Local functions
|
|
|
93
93
|
Exports
|
|
94
94
|
- `parseIdentities(content)`
|
|
95
95
|
- `parseOAuthAttempts(content)`
|
|
96
|
+
- `parsePasses(content)`
|
|
96
97
|
- `parseRecovery(content)`
|
|
97
98
|
- `parseRegistrations(content)`
|
|
98
99
|
- `parseSecondFactors(content)`
|
|
@@ -101,6 +102,7 @@ Exports
|
|
|
101
102
|
- `parseUsers(content)`
|
|
102
103
|
- `serializeIdentities(identities)`
|
|
103
104
|
- `serializeOAuthAttempts(attempts)`
|
|
105
|
+
- `serializePasses(records)`
|
|
104
106
|
- `serializeRecovery(records)`
|
|
105
107
|
- `serializeRegistrations(records)`
|
|
106
108
|
- `serializeSecondFactors(records)`
|
|
@@ -156,6 +158,11 @@ Local functions
|
|
|
156
158
|
Exports
|
|
157
159
|
- `createLocalOAuthFlows({ backend, config, firstAccountSetup, logger, oauthProvidersById, profileProjector, securityStatus, sessions })`
|
|
158
160
|
|
|
161
|
+
### `src/server/lib/passSignIn.js`
|
|
162
|
+
Exports
|
|
163
|
+
- `createLocalPassSignIn({ backend, config, passIdentity, profileProjector, sessions })`
|
|
164
|
+
- `noPassIdentities()`
|
|
165
|
+
|
|
159
166
|
### `src/server/lib/passwordFlows.js`
|
|
160
167
|
Exports
|
|
161
168
|
- `createLocalPasswordFlows({ backend, config, passwords, profileProjector, recoverySender, sessions })`
|
|
@@ -218,7 +225,7 @@ Exports
|
|
|
218
225
|
|
|
219
226
|
### `src/server/lib/service.js`
|
|
220
227
|
Exports
|
|
221
|
-
- `createLocalAuthService({ backend, config, confirmationMode = confirmEveryRegistrationByLink, confirmationSender, firstAccountSetup: givenFirstAccountSetup = null, invitationContextResolver, logger, passwordStrategy, profileProjector, recoverySender, secondFactorEvents })`
|
|
228
|
+
- `createLocalAuthService({ backend, config, confirmationMode = confirmEveryRegistrationByLink, confirmationSender, firstAccountSetup: givenFirstAccountSetup = null, invitationContextResolver, logger, passIdentity = noPassIdentities, passwordStrategy, profileProjector, recoverySender, secondFactorEvents })`
|
|
222
229
|
|
|
223
230
|
### `src/server/lib/sessions.js`
|
|
224
231
|
Exports
|
|
@@ -265,6 +272,7 @@ Exports
|
|
|
265
272
|
### `src/server/types.js`
|
|
266
273
|
Exports
|
|
267
274
|
- `type AuthLocalBackendTransaction`
|
|
275
|
+
- `type AuthLocalPassIdentity`
|
|
268
276
|
- `type AuthLocalRegistration`
|
|
269
277
|
- `type AuthLocalSecondFactor`
|
|
270
278
|
- `type AuthLocalSecondFactorEvent`
|
|
@@ -307,6 +315,16 @@ Exports
|
|
|
307
315
|
Local functions
|
|
308
316
|
- `readBody(req)`
|
|
309
317
|
|
|
318
|
+
### `test-support/passSignInScenario.js`
|
|
319
|
+
Exports
|
|
320
|
+
- `createPassIssuer()`
|
|
321
|
+
- `exercisePassSignIn(service, { backend, issuer })`
|
|
322
|
+
- `passIdentityByEmail(backend)`
|
|
323
|
+
- `passwordlessAccount({ id, email, displayName, disabled = false })`
|
|
324
|
+
- `sessionCookies(session)`
|
|
325
|
+
Local functions
|
|
326
|
+
- `refused(code, status = 401)`
|
|
327
|
+
|
|
310
328
|
### `test-support/secondFactorScenario.js`
|
|
311
329
|
Exports
|
|
312
330
|
- `SCENARIO_START`
|
|
@@ -74,6 +74,7 @@ Exports
|
|
|
74
74
|
- `localAuthSecondFactorResource`
|
|
75
75
|
- `localAuthSessionResource`
|
|
76
76
|
- `localAuthSignInFailureResource`
|
|
77
|
+
- `localAuthUsedPassResource`
|
|
77
78
|
- `localAuthUserResource`
|
|
78
79
|
Local functions
|
|
79
80
|
- `idStartsWith(query, prefix, { column })`
|
|
@@ -98,6 +99,10 @@ Exports
|
|
|
98
99
|
- `requiredDateTime(value, fallback = nowIso())`
|
|
99
100
|
- `text(value)`
|
|
100
101
|
|
|
102
|
+
### `src/server/lib/usedPassRecords.js`
|
|
103
|
+
Exports
|
|
104
|
+
- `usedPassRecords(usedPasses, options)`
|
|
105
|
+
|
|
101
106
|
### `src/server/providers/AuthLocalDatabaseBackendProvider.js`
|
|
102
107
|
Exports
|
|
103
108
|
- `AuthLocalDatabaseBackendProvider`
|
|
@@ -124,6 +129,10 @@ Exports
|
|
|
124
129
|
Exports
|
|
125
130
|
- None
|
|
126
131
|
|
|
132
|
+
### `migrations/auth_local_db_used_passes.cjs`
|
|
133
|
+
Exports
|
|
134
|
+
- None
|
|
135
|
+
|
|
127
136
|
### `migrations/auth_local_db_users_email_verified.cjs`
|
|
128
137
|
Exports
|
|
129
138
|
- None
|
|
@@ -411,6 +411,12 @@ Local functions
|
|
|
411
411
|
Exports
|
|
412
412
|
- `buildRoutes(controller, { includeDevLoginAs = false, rateLimits = DEFAULT_AUTH_RATE_LIMITS } = {})`
|
|
413
413
|
|
|
414
|
+
### `src/server/routes/passSignInRoutes.js`
|
|
415
|
+
Exports
|
|
416
|
+
- `registerPassSignInRoutes(fastify, { service, rateLimit })`
|
|
417
|
+
Local functions
|
|
418
|
+
- `parseForm(_request, body, done)`
|
|
419
|
+
|
|
414
420
|
### `src/server/routes/secondFactorRoutes.js`
|
|
415
421
|
Exports
|
|
416
422
|
- `registerSecondFactorRoutes(router, { rateLimits })`
|
|
@@ -15,7 +15,7 @@ A concrete Fastify, Vue, and JSKIT application foundation for products that do n
|
|
|
15
15
|
|
|
16
16
|
- Id: `app/minimal-foundation`
|
|
17
17
|
- Keywords: `app`, `fastify`, `foundation`, `minimal`, `server`, `vite`, `vue`
|
|
18
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
18
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
19
19
|
- Read: [PATTERN.md](patterns/app/minimal-foundation/PATTERN.md)
|
|
20
20
|
- Examples: [example/](patterns/app/minimal-foundation/example/)
|
|
21
21
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`
|
|
@@ -26,7 +26,7 @@ A concrete JSKIT web application foundation with responsive shell navigation, se
|
|
|
26
26
|
|
|
27
27
|
- Id: `app/shell-foundation`
|
|
28
28
|
- Keywords: `app`, `foundation`, `material`, `navigation`, `placements`, `shell`, `vite`, `vue`
|
|
29
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
29
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
30
30
|
- Read: [PATTERN.md](patterns/app/shell-foundation/PATTERN.md)
|
|
31
31
|
- Examples: [example/](patterns/app/shell-foundation/example/)
|
|
32
32
|
- Requires: `@jskit-ai/http-runtime`, `@jskit-ai/kernel`, `@jskit-ai/shell-web`
|
|
@@ -48,7 +48,7 @@ Run one OpenID Connect sign-in for all of an owner's apps as its own JSKIT proje
|
|
|
48
48
|
|
|
49
49
|
- Id: `auth/accounts-hub`
|
|
50
50
|
- Keywords: `accounts hub`, `auth`, `authentication`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
51
|
-
- Owner: `@jskit-ai/oidc-issuer-core@0.1.
|
|
51
|
+
- Owner: `@jskit-ai/oidc-issuer-core@0.1.40`
|
|
52
52
|
- Read: [PATTERN.md](patterns/auth/accounts-hub/PATTERN.md)
|
|
53
53
|
- Examples: [example/](patterns/auth/accounts-hub/example/)
|
|
54
54
|
- Requires: `@jskit-ai/oidc-issuer-core`
|
|
@@ -59,7 +59,7 @@ Compose JSKIT authentication routes, views, profile controls, and public surface
|
|
|
59
59
|
|
|
60
60
|
- Id: `auth/auth-surface`
|
|
61
61
|
- Keywords: `account`, `auth`, `login`, `logout`, `password`, `placement`, `profile`, `reset`, `surface`
|
|
62
|
-
- Owner: `@jskit-ai/auth-web@0.2.
|
|
62
|
+
- Owner: `@jskit-ai/auth-web@0.2.42`
|
|
63
63
|
- Read: [PATTERN.md](patterns/auth/auth-surface/PATTERN.md)
|
|
64
64
|
- Examples: [example/](patterns/auth/auth-surface/example/)
|
|
65
65
|
- Requires: `@jskit-ai/auth-core`, `@jskit-ai/auth-web`, `@jskit-ai/shell-web`
|
|
@@ -70,7 +70,7 @@ Let people sign in with the accounts they already have in an accounts hub or ano
|
|
|
70
70
|
|
|
71
71
|
- Id: `auth/oidc-sign-in`
|
|
72
72
|
- Keywords: `accounts hub`, `auth`, `authentication`, `back-channel logout`, `dynamic client registration`, `issuer`, `master login`, `oidc`, `openid connect`, `single sign-on`, `sso`
|
|
73
|
-
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.
|
|
73
|
+
- Owner: `@jskit-ai/auth-provider-oidc-core@0.2.46`
|
|
74
74
|
- Read: [PATTERN.md](patterns/auth/oidc-sign-in/PATTERN.md)
|
|
75
75
|
- Examples: [example/](patterns/auth/oidc-sign-in/example/)
|
|
76
76
|
- Requires: `@jskit-ai/auth-provider-oidc-core`, `@jskit-ai/auth-web`
|
|
@@ -81,7 +81,7 @@ Add Supabase authentication through normal npm composition, explicit environment
|
|
|
81
81
|
|
|
82
82
|
- Id: `auth/supabase-auth`
|
|
83
83
|
- Keywords: `auth`, `authentication`, `oauth`, `sessions`, `supabase`
|
|
84
|
-
- Owner: `@jskit-ai/auth-provider-supabase-core@0.2.
|
|
84
|
+
- Owner: `@jskit-ai/auth-provider-supabase-core@0.2.32`
|
|
85
85
|
- Read: [PATTERN.md](patterns/auth/supabase-auth/PATTERN.md)
|
|
86
86
|
- Examples: [example/](patterns/auth/supabase-auth/example/)
|
|
87
87
|
- Requires: `@jskit-ai/auth-provider-supabase-core`
|
|
@@ -246,7 +246,7 @@ Add a protected administration surface, settings shell, and semantic navigation
|
|
|
246
246
|
|
|
247
247
|
- Id: `console/console-surface`
|
|
248
248
|
- Keywords: `admin`, `console`, `navigation`, `owner`, `placement`, `settings`, `surface`
|
|
249
|
-
- Owner: `@jskit-ai/console-web@0.1.
|
|
249
|
+
- Owner: `@jskit-ai/console-web@0.1.274`
|
|
250
250
|
- Read: [PATTERN.md](patterns/console/console-surface/PATTERN.md)
|
|
251
251
|
- Examples: [example/](patterns/console/console-surface/example/)
|
|
252
252
|
- Requires: `@jskit-ai/console-core`, `@jskit-ai/console-web`, `@jskit-ai/shell-web`
|
|
@@ -345,7 +345,7 @@ Compose application-owned Google Publisher Tag delivery with the generic rewarde
|
|
|
345
345
|
|
|
346
346
|
- Id: `rewards/google-rewarded`
|
|
347
347
|
- Keywords: `ads`, `google`, `publisher tag`, `rewarded`, `unlock`
|
|
348
|
-
- Owner: `@jskit-ai/rewarded-web@0.2.
|
|
348
|
+
- Owner: `@jskit-ai/rewarded-web@0.2.51`
|
|
349
349
|
- Read: [PATTERN.md](patterns/rewards/google-rewarded/PATTERN.md)
|
|
350
350
|
- Examples: [example/](patterns/rewards/google-rewarded/example/)
|
|
351
351
|
- Requires: `@jskit-ai/rewarded-web`
|
|
@@ -356,7 +356,7 @@ Define a server feature through explicit capabilities and first-class actions, a
|
|
|
356
356
|
|
|
357
357
|
- Id: `server/feature-package`
|
|
358
358
|
- Keywords: `actions`, `aggregate`, `feature`, `handle`, `orchestration`, `owns`, `package`, `provider`, `repository`, `routes`, `server`, `table resource`
|
|
359
|
-
- Owner: `@jskit-ai/agent-docs@0.1.
|
|
359
|
+
- Owner: `@jskit-ai/agent-docs@0.1.327`
|
|
360
360
|
- Read: [PATTERN.md](patterns/server/feature-package/PATTERN.md)
|
|
361
361
|
- Examples: [example/](patterns/server/feature-package/example/)
|
|
362
362
|
- Requires: `@jskit-ai/kernel`
|
|
@@ -389,7 +389,7 @@ Compose an account settings route and profile, preference, notification, and sig
|
|
|
389
389
|
|
|
390
390
|
- Id: `users/account-settings`
|
|
391
391
|
- Keywords: `account`, `link provider`, `notifications`, `oauth`, `preferences`, `profile`, `settings`, `sign-in methods`, `user`, `vue`
|
|
392
|
-
- Owner: `@jskit-ai/users-web@0.2.
|
|
392
|
+
- Owner: `@jskit-ai/users-web@0.2.57`
|
|
393
393
|
- Read: [PATTERN.md](patterns/users/account-settings/PATTERN.md)
|
|
394
394
|
- Examples: [example/](patterns/users/account-settings/example/)
|
|
395
395
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/users-core`, `@jskit-ai/users-web`
|
|
@@ -400,7 +400,7 @@ Expose user administration and workspace-scoped member operations through app-ow
|
|
|
400
400
|
|
|
401
401
|
- Id: `users/user-administration-server`
|
|
402
402
|
- Keywords: `account`, `admin`, `member`, `repository`, `resource`, `routes`, `service`, `user`, `workspace`
|
|
403
|
-
- Owner: `@jskit-ai/users-core@0.2.
|
|
403
|
+
- Owner: `@jskit-ai/users-core@0.2.44`
|
|
404
404
|
- Read: [PATTERN.md](patterns/users/user-administration-server/PATTERN.md)
|
|
405
405
|
- Examples: [example/](patterns/users/user-administration-server/example/)
|
|
406
406
|
- Requires: `@jskit-ai/crud-core`, `@jskit-ai/users-core`
|
|
@@ -411,7 +411,7 @@ Configure roles, workspace access policy, invitations, and app-owned invitation
|
|
|
411
411
|
|
|
412
412
|
- Id: `workspaces/workspace-server`
|
|
413
413
|
- Keywords: `access`, `invite`, `membership`, `multitenancy`, `policy`, `role`, `tenancy`, `workspace`
|
|
414
|
-
- Owner: `@jskit-ai/workspaces-core@0.2.
|
|
414
|
+
- Owner: `@jskit-ai/workspaces-core@0.2.44`
|
|
415
415
|
- Read: [PATTERN.md](patterns/workspaces/workspace-server/PATTERN.md)
|
|
416
416
|
- Examples: [example/](patterns/workspaces/workspace-server/example/)
|
|
417
417
|
- Requires: `@jskit-ai/users-core`, `@jskit-ai/workspaces-core`
|
|
@@ -422,7 +422,7 @@ Compose workspace selection, invitation, member administration, settings, and re
|
|
|
422
422
|
|
|
423
423
|
- Id: `workspaces/workspace-surfaces`
|
|
424
424
|
- Keywords: `admin`, `invite`, `member`, `navigation`, `settings`, `surface`, `switcher`, `workspace`
|
|
425
|
-
- Owner: `@jskit-ai/workspaces-web@0.2.
|
|
425
|
+
- Owner: `@jskit-ai/workspaces-web@0.2.57`
|
|
426
426
|
- Read: [PATTERN.md](patterns/workspaces/workspace-surfaces/PATTERN.md)
|
|
427
427
|
- Examples: [example/](patterns/workspaces/workspace-surfaces/example/)
|
|
428
428
|
- Requires: `@jskit-ai/shell-web`, `@jskit-ai/workspaces-core`, `@jskit-ai/workspaces-web`
|
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
"dependencies": {
|
|
13
13
|
"@jskit-ai/crud-core": "0.2.37",
|
|
14
14
|
"@jskit-ai/resource-crud-core": "0.1.219",
|
|
15
|
-
"@jskit-ai/users-core": "0.2.
|
|
16
|
-
"@jskit-ai/workspaces-core": "0.2.
|
|
15
|
+
"@jskit-ai/users-core": "0.2.44",
|
|
16
|
+
"@jskit-ai/workspaces-core": "0.2.44"
|
|
17
17
|
},
|
|
18
18
|
"peerDependencies": {
|
|
19
19
|
"@jskit-ai/kernel": "0.2.26",
|