@protobase/cli 0.40.6 → 0.40.7

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.
@@ -1,4 +1,4 @@
1
1
  //#region package.json
2
- var version = "0.40.6";
2
+ var version = "0.40.7";
3
3
  //#endregion
4
4
  export { version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@protobase/cli",
3
- "version": "0.40.6",
3
+ "version": "0.40.7",
4
4
  "description": "The protobase command: scaffold, doctor, dev, build and serve a Protobase project.",
5
5
  "license": "Apache-2.0",
6
6
  "repository": {
@@ -36,11 +36,11 @@
36
36
  "@better-auth/core": "^1.7.12",
37
37
  "@hono/node-server": "^2.1.3",
38
38
  "@hono/vite-dev-server": "^0.26.1",
39
- "@protobase/layout": "0.40.6",
40
- "@protobase/query": "0.40.6",
41
- "@protobase/schema": "0.40.6",
42
- "@protobase/server": "0.40.6",
43
- "@protobase/ui": "0.40.6",
39
+ "@protobase/layout": "0.40.7",
40
+ "@protobase/query": "0.40.7",
41
+ "@protobase/schema": "0.40.7",
42
+ "@protobase/server": "0.40.7",
43
+ "@protobase/ui": "0.40.7",
44
44
  "@react-email/render": "^2.1.0",
45
45
  "@scalar/hono-api-reference": "^0.12.10",
46
46
  "@tailwindcss/vite": "^4.3.3",
@@ -57,7 +57,7 @@ Under `/api/v1`:
57
57
  | `POST /api/files:cleanup` | runs the [scheduled file deletes](files.md#deleting-files)) that are due, for an admin; `{ deleted, kept }` |
58
58
  | `GET /api/openapi.json`, `GET /api/docs` | OpenAPI 3.1 for the caller (only the resources, fields and operations their roles allow), and the Scalar reference |
59
59
 
60
- Every response carries `X-Meta-Version`, the hash of the models and of the caller's roles; a client that sees it change (a model edit, a role change) refetches `/meta`.
60
+ Every response carries `X-Meta-Version`, the hash of the models, the Protobase version and the caller's roles; a client that sees it change (a model edit, an upgrade, a role change) refetches `/meta`.
61
61
 
62
62
  `show_deleted=true` on list, `:search` (body) and get also returns soft-deleted records (soft-delete resources only, `400` otherwise).
63
63
 
@@ -108,7 +108,7 @@ Get responses carry `permissions: { update, delete, fields }`, where `fields` ma
108
108
 
109
109
  ### `/meta` and OpenAPI per caller
110
110
 
111
- `/meta` returns, per caller: the resources they can do anything with as restricted models (hidden fields absent, `readOnly` unless writable), the view for their roles ([`pickView`](https://docs.protobase.net/api/schema/functions/pickview/))) with every reference to a hidden field removed (columns, sort, search, filters, layout, chart, title, search result) and the [related sections](ui-config.md#related-records)) they cannot use, `permissions[resource]` as `{ read, create, update, delete, conditional }`, the [user menu](user-menu.md)) as `userMenu` and the [bottom bar](bottom-bar.md)) of their active role as `bottomBar`, each without the resources and pages they cannot see, and the [composed pages](layouts.md#access)) as `pages`, each without the elements that name what they cannot see or do, and, for a caller with the `admin` or `ai` role, the [assistant](assistant.md#who-sees-it)) backend as `assistant: { url }` when the app has one, and, for a caller with the `admin` role, the [runtime updates](versioning.md#runtime-updates)) endpoint as `runtime: { url }` when the app has one, and, for everyone, the style of the record page's [maps](ui-config.md#maps)) as `maps: { style }` when the app has one and the [language](languages.md)) of its screens as `locale` when it sets one. `conditional` lists the operations allowed only for some records (a row filter or a record-level rule decides). A view's sidebar group ([`nav.recent`](sidebar.md#recent-records))) is dropped when it uses a field they cannot read. The ETag hashes all of it, so it differs per user and per roles. The OpenAPI document is generated the same way: record and body schemas have only the readable and writable fields, and methods the caller may not use are left out. Its `servers` are relative to the document (`v1` for the resources, `.` for the system endpoints), and `/api/docs` loads `openapi.json` beside it, so both are right on any host and under any prefix the API is reached at.
111
+ `/meta` returns, per caller: the resources they can do anything with as restricted models (hidden fields absent, `readOnly` unless writable), the view for their roles ([`pickView`](https://docs.protobase.net/api/schema/functions/pickview/))) with every reference to a hidden field removed (columns, sort, search, filters, layout, chart, title, search result) and the [related sections](ui-config.md#related-records)) they cannot use, `permissions[resource]` as `{ read, create, update, delete, conditional }`, the [user menu](user-menu.md)) as `userMenu` and the [bottom bar](bottom-bar.md)) of their active role as `bottomBar`, each without the resources and pages they cannot see, and the [composed pages](layouts.md#access)) as `pages`, each without the elements that name what they cannot see or do, and, for a caller with the `admin` or `ai` role, the [assistant](assistant.md#who-sees-it)) backend as `assistant: { url }` when the app has one, and, for a caller with the `admin` role, the [runtime updates](versioning.md#runtime-updates)) endpoint as `runtime: { url }` when the app has one, and, for everyone, the style of the record page's [maps](ui-config.md#maps)) as `maps: { style }` when the app has one, the [language](languages.md)) of its screens as `locale` when it sets one, and the Protobase version the server runs as `protobaseVersion`. When that version changes under an open page, the admin app keeps what the page shows, stops reading `/meta`, and offers to reload the page, asking first while a form holds unsaved changes or a save is under way. `conditional` lists the operations allowed only for some records (a row filter or a record-level rule decides). A view's sidebar group ([`nav.recent`](sidebar.md#recent-records))) is dropped when it uses a field they cannot read. The ETag hashes all of it, so it differs per user and per roles. The OpenAPI document is generated the same way: record and body schemas have only the readable and writable fields, and methods the caller may not use are left out. Its `servers` are relative to the document (`v1` for the resources, `.` for the system endpoints), and `/api/docs` loads `openapi.json` beside it, so both are right on any host and under any prefix the API is reached at.
112
112
 
113
113
  ## Sensitive fields and audit
114
114
 
@@ -519,12 +519,13 @@ createAuth({ ..., mcp: { path: '/api/mcp', connectPage: '/-/connect' } })
519
519
  - `path` is the MCP endpoint's path on the origin of `baseURL`, its OAuth resource (default `/api/mcp`); `connectPage` is the connect page's path (default `/-/connect`, for a UI at the root); `fetchClientMetadata` replaces how a client's metadata document is fetched (default a transport that refuses private and reserved addresses). `auth.mcp` is `{ resource, path, scope }`, for the endpoint.
520
520
  - It needs an https `baseURL`, or localhost, and the OAuth tables: run `protobase auth migration` after turning it on (see [migrations](#migrations)). Turning it off is a migration too: `protobase auth migration` writes the drop of the OAuth tables, and the app does not start until it is applied. That disconnects every client and forgets every grant, so turning MCP on again starts from nothing and each client has to be allowed again. With `PROTOBASE_STARTUP_CHECKS=false` the tables and their grants stay until the migration is applied. Clients connect through `baseURL`'s origin only, whatever [other origins](#several-origins) the app has. Changing `path` makes every client connect again.
521
521
  - Clients find the provider at `/.well-known/oauth-protected-resource` and `/.well-known/oauth-authorization-server`, register at `/api/auth/oauth2/register` (dynamic registration) or are known by an https client id that names their metadata document (CIMD), and are asked for nothing per client. Back-channel logout, a key set URL at registration (`jwks_uri`) and the client credentials grant are refused, though a client with a metadata document may publish its keys on its own origin, and the provider's client management, userinfo, logout and consent endpoints are closed.
522
- - The scopes are `mcp` and `offline_access`, which is added when a client leaves it out. Access tokens last 15 minutes, carry the MCP resource as their audience and `typ: at+jwt`, and work for MCP only: the app's API refuses them, and the MCP endpoint refuses the app's own tokens. Refresh tokens roll for 30 days. `betterAuthAuthenticator(...).forAudience(auth.mcp.resource)` verifies them; a client that binds its tokens to a key (DPoP) sends a proof with each, checked against the resource's URL.
522
+ - The scopes are `mcp` and `offline_access`, which is added when a client leaves it out. Access tokens last 15 minutes, carry the MCP resource as their audience and `typ: at+jwt`, and work for MCP only: the app's API refuses them, and the MCP endpoint refuses the app's own tokens. Refresh tokens roll for 30 days. `betterAuthAuthenticator(...).forAudience(auth.mcp.resource)` verifies them, and with `auth` checks on every request that the person still allows the client, so a disconnected client's access tokens stop at the next request rather than at their expiry; a lookup that fails refuses the request. A client that binds its tokens to a key (DPoP) sends a proof with each, checked against the resource's URL.
523
523
  - A grant keeps the role and organization the person worked in when they allowed the client. A refresh is refused once they no longer hold that role or may no longer enter that organization, once the [sign-in policy](#sign-in-policy) requires something they have not set up, and while they are banned; access tokens already issued last out their 15 minutes. A grant made without a role is refused.
524
524
  - Someone who has not set up what the sign-in policy requires is sent to the setup page first. Staff signed in as a person cannot allow a client, nor disconnect one. An account whose address is not verified cannot connect a client until it signs in once with an emailed code: a provider sign-up whose provider did not vouch for the address, or a password account created before Protobase created accounts verified. With password-only sign-in, or without mail, it cannot.
525
525
  - The connect page shows the client's name as the client's own claim, who published it for a client with an https id, where the code goes (a website by its host, an app on this computer by its port, or an app on the device by its whole address), and the signed-in address. It cannot be used inside another site's frame, and Allow takes a click only once the page has been in front for half a second. `protobase serve` and `protobase dev` send `X-Frame-Options: DENY` and `Content-Security-Policy: frame-ancestors 'none'` with every page of the UI; a host that serves `public/` itself should send them too.
526
- - The account page lists the clients a person allowed, under Connected apps, and disconnects any one: its consent is forgotten and its tokens revoked, so it has to ask again. A client published at a URL has one id for everyone, so two copies of it allowed on one account with the same role show as one entry, and disconnecting it disconnects both.
526
+ - The account page lists the clients a person allowed, under Connected apps, and disconnects any one: its consent is forgotten and its tokens revoked, access tokens already issued included, so it has to ask again. A client published at a URL has one id for everyone, so two copies of it allowed on one account with the same role show as one entry, and disconnecting it disconnects both.
527
527
  - Signing out everywhere, signing out the other devices, a password change that signs out the other devices, a password reset, an admin ending the person's sessions, banning them, setting their password or marking their address unverified, and `protobase users disable` disconnect every client and forget which were allowed, so each has to ask again; enabling a disabled user brings none back. Through the [endpoints for supabase-js](#supabase-js-and-supabasessr) the same holds for signing out with the `global` or `others` scope and for every new password set with `PUT /user`, since a password reset ends there too. Signing out of one browser, or a session expiring, disconnects nothing.
528
+ - A refresh token presented again after it was rotated, outside the provider's 30-second window for a retried request, is taken for stolen: that client is disconnected for the person, its access tokens stop at the next request, and it has to ask again. Their other clients keep working.
528
529
 
529
530
  ## Several origins
530
531