@jskit-ai/agent-docs 0.1.372 → 0.1.374
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 +34 -18
- package/guide/agent/app-setup/existing-application-migration.md +3 -2
- package/guide/agent/app-setup/initial-scaffolding.md +3 -2
- package/guide/agent/app-setup/package-with-nix.md +4 -2
- package/guide/agent/framework/crud-form-actions.md +3 -1
- package/guide/agent/framework/material-3.md +9 -9
- package/guide/agent/framework/security-pass.md +2 -1
- package/package.json +1 -1
- package/patterns/feature-package/example/booking-engine/package.json +1 -1
- package/patterns/minimal-foundation/example/package.json +3 -3
- package/patterns/minimal-foundation/example/server.js +2 -2
- package/patterns/shell-foundation/example/package.json +4 -4
- package/patterns/shell-foundation/example/packages/main/package.json +1 -1
- package/patterns/shell-foundation/example/server.js +2 -2
- package/reference/autogen/PATTERN_INDEX.md +39 -39
- package/reference/autogen/packages/kernel.md +2 -0
- package/skills/jskit/references/crud-form-actions.md +3 -1
- package/skills/jskit/references/existing-application-migration.md +3 -2
- package/skills/jskit/references/material-3.md +9 -9
- package/skills/jskit/references/package-with-nix.md +4 -2
- package/skills/jskit/references/pattern-index.md +39 -39
- package/skills/jskit/references/patterns/app/minimal-foundation/example/package.json +3 -3
- package/skills/jskit/references/patterns/app/minimal-foundation/example/server.js +2 -2
- package/skills/jskit/references/patterns/app/shell-foundation/example/package.json +4 -4
- package/skills/jskit/references/patterns/app/shell-foundation/example/packages/main/package.json +1 -1
- package/skills/jskit/references/patterns/app/shell-foundation/example/server.js +2 -2
- package/skills/jskit/references/patterns/auth/accounts-hub/example/package.json +3 -3
- 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/connectors/calendar-cli/example/package.json +5 -5
- package/skills/jskit/references/patterns/crud/crud-feature-package/example/packages/books/package.json +3 -3
- package/skills/jskit/references/patterns/database/mysql-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/database/postgres-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/realtime/realtime-application/example/package.json +2 -2
- package/skills/jskit/references/patterns/server/feature-package/example/booking-engine/package.json +1 -1
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users/package.json +3 -3
- package/skills/jskit/references/patterns/users/user-administration-server/example/packages/users-workspace/package.json +6 -6
- package/skills/jskit/references/security-pass.md +2 -1
|
@@ -133,17 +133,30 @@ The address is Fastify's `request.ip`. Behind a reverse proxy every request
|
|
|
133
133
|
comes from the proxy, so all clients would share one count. The app's
|
|
134
134
|
`server.js` creates Fastify with
|
|
135
135
|
`trustProxy: resolveTrustedProxies(runtimeEnv)` (from
|
|
136
|
-
`@jskit-ai/kernel/server/http`), which
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
136
|
+
`@jskit-ai/kernel/server/http`), which names the proxies in front of the
|
|
137
|
+
server. Only those proxies' `X-Forwarded-For` (and `-Host` and `-Proto`) is
|
|
138
|
+
believed, so each client behind them has its own count and a client that sends
|
|
139
|
+
the header itself changes nothing.
|
|
140
|
+
|
|
141
|
+
- **On mobilynet, nothing needs setting.** mobilynet gives every app it runs
|
|
142
|
+
`MOBILYNET_EDGE_ADDRESSES`: the addresses its edge connects to the app's
|
|
143
|
+
machine from, comma-separated. With `TRUSTED_PROXIES` unset, the server
|
|
144
|
+
believes those addresses and `loopback`. Each entry must be one IPv4 or IPv6
|
|
145
|
+
address; a range, a range name, `true` or a hop count there stops startup
|
|
146
|
+
with an error naming `MOBILYNET_EDGE_ADDRESSES` and the entry, because what
|
|
147
|
+
the hosting provider sets must never make the server believe more than the
|
|
148
|
+
addresses it lists.
|
|
149
|
+
- **Elsewhere, set `TRUSTED_PROXIES`:** the addresses or ranges of the proxies
|
|
150
|
+
in front of the server, comma-separated, in Fastify's `trustProxy` syntax
|
|
151
|
+
(`10.0.0.5`, `10.0.0.0/24`, `fd00::/8`, or `loopback`, `linklocal` or
|
|
152
|
+
`uniquelocal`), for example `TRUSTED_PROXIES=loopback,10.0.0.5`. It is the
|
|
153
|
+
app owner's choice: when it is set, it is the whole list, also on mobilynet,
|
|
154
|
+
and `MOBILYNET_EDGE_ADDRESSES` is not read. `true` and hop counts stop
|
|
155
|
+
startup, because they believe a header any client can send. Name the
|
|
156
|
+
narrowest addresses that are only your proxies: a private range shared with
|
|
157
|
+
other machines lets each of them choose its address.
|
|
158
|
+
|
|
159
|
+
With neither set, only a proxy on the same machine (`loopback`) is believed.
|
|
147
160
|
|
|
148
161
|
**Per account (local auth).** After 5 failed sign-ins in a row for one email,
|
|
149
162
|
that email must wait 30 seconds before its next attempt; each further failure
|
|
@@ -374,12 +387,14 @@ caller in, beside `request.secondFactorAt`:
|
|
|
374
387
|
- `request.sessionSignIn` is `{ at, ip, userAgent, purpose }`: when the
|
|
375
388
|
session was signed in (`at`, its creation, which refreshing the session
|
|
376
389
|
never renews), the address (`request.ip` of the request that signed it in,
|
|
377
|
-
so
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
390
|
+
so behind a proxy other than mobilynet's edge set `TRUSTED_PROXIES`, as
|
|
391
|
+
[sign-in protection](#sign-in-protection) says) and browser (its
|
|
392
|
+
`User-Agent`, at most 512 characters) it was signed in from, and why
|
|
393
|
+
(`purpose`: `normal` for an ordinary sign-in, by password, registration, a
|
|
394
|
+
confirmation link, a provider or a one-time pass; `dev-auth` for a
|
|
395
|
+
development sign-in; or what an application's own `auth.local.sessions`
|
|
396
|
+
`update` set). They are written once, when the session is created, and
|
|
397
|
+
never again: the session's `ip` and
|
|
383
398
|
`userAgent` (where it was last seen) move with later requests, these do not.
|
|
384
399
|
- `request.credentialsChangedAt` is `{ password, email }`: when the account's
|
|
385
400
|
password last changed (a reset or a change, also `auth.local.accounts`'
|
|
@@ -608,7 +623,8 @@ account out: its sessions work again after `enable`, unless
|
|
|
608
623
|
`auth.local.sessions`' `revokeForUser` ended them.
|
|
609
624
|
|
|
610
625
|
Every session keeps where and when it was last seen: `ip` (the request's
|
|
611
|
-
address, Fastify's `request.ip`, so
|
|
626
|
+
address, Fastify's `request.ip`, so behind a proxy other than mobilynet's edge
|
|
627
|
+
set `TRUSTED_PROXIES`, as [sign-in protection](#sign-in-protection) says),
|
|
612
628
|
`userAgent` (the browser's `User-Agent`, at most 512 characters) and
|
|
613
629
|
`lastSeenAt`. Signing in sets them from the sign-in's request, and a request
|
|
614
630
|
that finds the session more than five minutes after it was last seen sets them
|
|
@@ -155,7 +155,7 @@ import SerializerSelector from "@fastify/fast-json-stringify-compiler";
|
|
|
155
155
|
import { createCachedResponseSerializerFactory, resolveTrustedProxies } from "@jskit-ai/kernel/server/http";
|
|
156
156
|
|
|
157
157
|
const app = Fastify({
|
|
158
|
-
// TRUSTED_PROXIES: the proxies whose X-Forwarded-For is believed (loopback
|
|
158
|
+
// TRUSTED_PROXIES: the proxies whose X-Forwarded-For is believed (without it, loopback and MOBILYNET_EDGE_ADDRESSES).
|
|
159
159
|
trustProxy: resolveTrustedProxies(runtimeEnv),
|
|
160
160
|
schemaController: {
|
|
161
161
|
compilersFactory: {
|
|
@@ -169,7 +169,8 @@ Keep the application's other Fastify options, including serializer options and
|
|
|
169
169
|
validator configuration, but replace an application's own `trustProxy` setting
|
|
170
170
|
with `resolveTrustedProxies(runtimeEnv)` (`runtimeEnv` is the environment the
|
|
171
171
|
server starts with, `process.env` if it has no other), and its environment
|
|
172
|
-
variable with `TRUSTED_PROXIES
|
|
172
|
+
variable with `TRUSTED_PROXIES` (on mobilynet none is needed: the server reads
|
|
173
|
+
the `MOBILYNET_EDGE_ADDRESSES` mobilynet sets); see
|
|
173
174
|
[sign-in protection](https://mobily-enterprises.github.io/jskit-ai/guide/app-setup/authentication#sign-in-protection)
|
|
174
175
|
for the setting. This setup wraps the native default serializer builder;
|
|
175
176
|
retain any deliberately chosen custom compiler instead of replacing or wrapping
|
|
@@ -208,8 +208,9 @@ answers it, so people, links and search engines end up at one address:
|
|
|
208
208
|
APP_PUBLIC_URL=https://example.com APP_REDIRECT_HOSTS=www.example.com,example.net npm start
|
|
209
209
|
```
|
|
210
210
|
|
|
211
|
-
The name is the request's Host, or the `X-Forwarded-Host` of a proxy
|
|
212
|
-
`TRUSTED_PROXIES` names
|
|
211
|
+
The name is the request's Host, or the `X-Forwarded-Host` of a proxy the
|
|
212
|
+
server believes, the ones `TRUSTED_PROXIES` names or, on mobilynet, its edge
|
|
213
|
+
(see [Authentication](/guide/app-setup/authentication#sign-in-protection));
|
|
213
214
|
a client's own `X-Forwarded-Host` changes nothing. `APP_PUBLIC_URL`'s own name
|
|
214
215
|
and every name the setting doesn't list, such as the instance's own name or
|
|
215
216
|
address a load balancer's health check uses, are served as before. Each name
|
|
@@ -119,8 +119,10 @@ environment's. The option is not called `--env-file` because Node reads an
|
|
|
119
119
|
package never guesses it, and a server without one refuses to start. The
|
|
120
120
|
programs default `NODE_ENV` to `production`, the build the package holds.
|
|
121
121
|
- Behind a load balancer or proxy, `TRUSTED_PROXIES` names its addresses, as
|
|
122
|
-
the [authentication](/guide/app-setup/authentication)
|
|
123
|
-
|
|
122
|
+
the [authentication](/guide/app-setup/authentication#sign-in-protection)
|
|
123
|
+
guide says (on mobilynet nothing needs setting: mobilynet sets
|
|
124
|
+
`MOBILYNET_EDGE_ADDRESSES`, its edge's addresses, which the server reads),
|
|
125
|
+
and `APP_PUBLIC_URL` is the address people use. `APP_REDIRECT_HOSTS` lists the
|
|
124
126
|
app's other names, such as `www.example.com`, which the server sends on to
|
|
125
127
|
`APP_PUBLIC_URL` with a 301
|
|
126
128
|
([Other names](/guide/app-setup/initial-scaffolding#other-names)).
|
|
@@ -8,7 +8,9 @@ description: Customize shared CRUD form actions and local validation guidance.
|
|
|
8
8
|
# Record form actions and validation
|
|
9
9
|
|
|
10
10
|
`CrudAddEditScreen` provides an optional `actions` slot with Cancel and Save as
|
|
11
|
-
its default content
|
|
11
|
+
its default content; where the bar has no Up arrow, that Cancel is the page's
|
|
12
|
+
way out, a `ShellPageAction` marked `close`, which the bar never folds. The slot
|
|
13
|
+
exposes `screen`, `mode`, `formRuntime`,
|
|
12
14
|
`formState`, `addEdit`, `saveLabel`, the resolved
|
|
13
15
|
`cancelTo` route target, and `submit`. Custom actions call `submit()` and bind
|
|
14
16
|
their disabled state to `addEdit.isSubmitDisabled` and their pending state to
|
|
@@ -276,15 +276,15 @@ dialog, chip or FAB.
|
|
|
276
276
|
- **Actions:** a screen's actions go in the bar inside `ShellPageActions`
|
|
277
277
|
(`@jskit-ai/shell-web/client/components/ShellPageActions`), each a
|
|
278
278
|
`ShellPageAction` with `icon`, `label` (also its accessible name and compact
|
|
279
|
-
tooltip), and `primary`, `
|
|
280
|
-
file, such as a CSV export),
|
|
281
|
-
(`error` for a destructive one);
|
|
282
|
-
|
|
283
|
-
Save) and
|
|
284
|
-
actions always are; medium bars keep
|
|
285
|
-
title, wider bars beside 200px of it (a longer title truncates);
|
|
286
|
-
there, last first, then top-right items that don't fit, after
|
|
287
|
-
the account's name. Put the most used
|
|
279
|
+
tooltip), and `primary`, `close` (a page's way out with no Up arrow), `to`,
|
|
280
|
+
`replace`, `href` (with `download` for a file, such as a CSV export),
|
|
281
|
+
`disabled`, `pending`, `loading` or `color` (`error` for a destructive one);
|
|
282
|
+
attributes such as `target` reach its button. Bars show the single `primary`
|
|
283
|
+
(a form's Save) and `close`; compact ones put the rest in "More actions",
|
|
284
|
+
where `overflow` actions always are; medium bars keep those that fit beside
|
|
285
|
+
the whole title, wider bars beside 200px of it (a longer title truncates);
|
|
286
|
+
the rest go there, last first, then top-right items that don't fit, after
|
|
287
|
+
wider bars hide the account's name. Put the most used first.
|
|
288
288
|
- **Window size classes:** compact under 600 (navigation bar), medium 600–839
|
|
289
289
|
(navigation rail), expanded 840–1199 and large from 1200 (drawer), read from
|
|
290
290
|
`useShellWindowSizeClass()`
|
|
@@ -75,7 +75,8 @@ a JSKIT app. The rules it applies are already in [Typed features](/guide/framewo
|
|
|
75
75
|
account wait after repeated failures; both are on by default.
|
|
76
76
|
`config.auth.rateLimits` changes a limit and `false` removes one: a removed
|
|
77
77
|
limit is a finding unless the person chose it. Behind a proxy,
|
|
78
|
-
`TRUSTED_PROXIES` names it
|
|
78
|
+
`TRUSTED_PROXIES` names it (on mobilynet, the `MOBILYNET_EDGE_ADDRESSES`
|
|
79
|
+
mobilynet sets names its edge), or every client shares one count
|
|
79
80
|
([Sign-in protection](/guide/app-setup/authentication#sign-in-protection)).
|
|
80
81
|
- Any other route that repetition can abuse (sending email or codes,
|
|
81
82
|
invitations, costly reads, calls to a paid service) declares
|
package/package.json
CHANGED
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@local/main": "0.1.0",
|
|
36
36
|
"@fastify/static": "^10.1.3",
|
|
37
|
-
"@jskit-ai/kernel": "0.2.
|
|
37
|
+
"@jskit-ai/kernel": "0.2.37",
|
|
38
38
|
"@jskit-ai/material-web": "0.1.17",
|
|
39
39
|
"@tanstack/vue-query": "^5.101.0",
|
|
40
40
|
"fastify": "^5.12.7",
|
|
@@ -44,13 +44,13 @@
|
|
|
44
44
|
"vue": "^3.5.44",
|
|
45
45
|
"vue-router": "^5.3.1",
|
|
46
46
|
"vuetify": "^4.3.0",
|
|
47
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
47
|
+
"@jskit-ai/http-runtime": "0.2.38",
|
|
48
48
|
"@fastify/fast-json-stringify-compiler": "^5.1.0",
|
|
49
49
|
"@vue/devtools-api": "^8.2.1"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
52
|
"@jskit-ai/config-eslint": "0.1.255",
|
|
53
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
53
|
+
"@jskit-ai/jskit-catalog": "0.2.126",
|
|
54
54
|
"@playwright/test": "1.61.1",
|
|
55
55
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
56
56
|
"eslint": "^10.8.0",
|
|
@@ -94,8 +94,8 @@ function canServeStaticFile(distRoot, relativePath) {
|
|
|
94
94
|
async function createServer({ runtimeEnv }) {
|
|
95
95
|
const app = Fastify({
|
|
96
96
|
logger: buildLoggerOptions(runtimeEnv),
|
|
97
|
-
// The proxies in front of the server (TRUSTED_PROXIES;
|
|
98
|
-
// counted by it are each client's address behind them.
|
|
97
|
+
// The proxies in front of the server (TRUSTED_PROXIES; without it, loopback and the MOBILYNET_EDGE_ADDRESSES
|
|
98
|
+
// mobilynet sets), so request.ip and the rate limits counted by it are each client's address behind them.
|
|
99
99
|
trustProxy: resolveTrustedProxies(runtimeEnv),
|
|
100
100
|
schemaController: {
|
|
101
101
|
compilersFactory: {
|
|
@@ -34,7 +34,7 @@
|
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@local/main": "0.1.0",
|
|
36
36
|
"@fastify/static": "^10.1.3",
|
|
37
|
-
"@jskit-ai/kernel": "0.2.
|
|
37
|
+
"@jskit-ai/kernel": "0.2.37",
|
|
38
38
|
"@jskit-ai/material-web": "0.1.17",
|
|
39
39
|
"@tanstack/vue-query": "^5.101.0",
|
|
40
40
|
"fastify": "^5.12.7",
|
|
@@ -44,14 +44,14 @@
|
|
|
44
44
|
"vue": "^3.5.44",
|
|
45
45
|
"vue-router": "^5.3.1",
|
|
46
46
|
"vuetify": "^4.3.0",
|
|
47
|
-
"@jskit-ai/http-runtime": "0.2.
|
|
48
|
-
"@jskit-ai/shell-web": "0.2.
|
|
47
|
+
"@jskit-ai/http-runtime": "0.2.38",
|
|
48
|
+
"@jskit-ai/shell-web": "0.2.62",
|
|
49
49
|
"@fastify/fast-json-stringify-compiler": "^5.1.0",
|
|
50
50
|
"@vue/devtools-api": "^8.2.1"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
53
|
"@jskit-ai/config-eslint": "0.1.255",
|
|
54
|
-
"@jskit-ai/jskit-catalog": "0.2.
|
|
54
|
+
"@jskit-ai/jskit-catalog": "0.2.126",
|
|
55
55
|
"@playwright/test": "1.61.1",
|
|
56
56
|
"@vitejs/plugin-vue": "^6.0.7",
|
|
57
57
|
"eslint": "^10.8.0",
|
|
@@ -94,8 +94,8 @@ function canServeStaticFile(distRoot, relativePath) {
|
|
|
94
94
|
async function createServer({ runtimeEnv }) {
|
|
95
95
|
const app = Fastify({
|
|
96
96
|
logger: buildLoggerOptions(runtimeEnv),
|
|
97
|
-
// The proxies in front of the server (TRUSTED_PROXIES;
|
|
98
|
-
// counted by it are each client's address behind them.
|
|
97
|
+
// The proxies in front of the server (TRUSTED_PROXIES; without it, loopback and the MOBILYNET_EDGE_ADDRESSES
|
|
98
|
+
// mobilynet sets), so request.ip and the rate limits counted by it are each client's address behind them.
|
|
99
99
|
trustProxy: resolveTrustedProxies(runtimeEnv),
|
|
100
100
|
schemaController: {
|
|
101
101
|
compilersFactory: {
|