Skip to content

Commit aa08d0e

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-nonee9
2 parents ac07f92 + 4b71a82 commit aa08d0e

25 files changed

Lines changed: 1638 additions & 413 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
feat(plugin-auth): the mobile sign-in hand-off — a sign-in completed in the system browser is handed to a registered app scheme as a single-use token, over better-auth's own `one-time-token` plugin
6+
7+
Clause-②: yes (widening)
8+
Metadata-protocol: none
9+
10+
Some identity providers (Google among them) refuse to sign a user in inside an embedded WebView, so a mobile shell signs in in the platform's system auth session, where the session lands in the system browser rather than in the WebView the Console runs in. A deployment that lists its app's custom URL scheme in `trustedAppSchemes` now gets a way to carry that session across, once:
11+
12+
- **`GET /api/v1/auth/one-time-token/handoff`** (session required). Query: `redirect_uri` (an app callback), `code_challenge` (RFC 7636 S256: `BASE64URL(SHA-256(code_verifier))`, 43 characters) and optionally `code_challenge_method=S256`; no other parameter is accepted. It answers `302` to `redirect_uri` with a `token` query parameter added, uncacheable. A `redirect_uri` whose scheme is not registered answers `400 VALIDATION_ERROR` with no redirect, so the route is never an open redirect; a missing or malformed challenge also answers `400`, and a signed-out caller `401 UNAUTHENTICATED`.
13+
- **The hand-off carries only a fresh sign-in.** A session signed in more than five minutes ago answers `401 UNAUTHENTICATED` (sign in again), so an app cannot silently carry away a session the browser has held for days; and a navigation the browser reports as `Sec-Fetch-Site: cross-site` answers `400 VALIDATION_ERROR` (the header is checked only when the browser sends it).
14+
- **`POST /api/v1/auth/one-time-token/verify`** (better-auth's route, no session needed). Body: `{ "token": "TOKEN.code_verifier" }`. It answers better-auth's `{ session, user }` with the session cookie, once, within one minute.
15+
- **An intercepted callback cannot be redeemed.** Another app on the device can register the same scheme and receive the callback, so the token is stored under a hash of the token and the challenge, and redemption recomputes it from the verifier the shell kept. A token presented without that verifier answers better-auth's `400 Invalid token` and consumes nothing, so the shell that started the hand-off still redeems it.
16+
- **`GET /api/v1/auth/one-time-token/generate`** is published by the plugin and refuses every client request (`400` with a session, `401` without); the hand-off is the only place a token is minted.
17+
- **`trustedAppSchemes`** (the spec's `AuthConfig.trustedAppSchemes`) entries must be lowercase reverse-domain private-use schemes with no `:` suffix (RFC 8252 §7.1, e.g. `com.example.app`, no empty or trailing label); `http`, `https`, `javascript`, `data`, `file`, `blob`, `about`, `vbscript`, `ws` and `wss` are refused. A bad entry fails the auth manager's construction (and `applyConfigPatch`), naming the entry. With no scheme registered, the plugin is not mounted and the hand-off refuses every target.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
---
2+
'@objectstack/spec': minor
3+
---
4+
5+
feat(spec): a plugin-driver datasource can declare its row cap, `external.rowCap`, up to a platform maximum of 10,000 (#29762)
6+
7+
Clause-②: yes (widening) — one optional, bounded key joins the external datasource settings; the default keeps today's 1,000
8+
Metadata-protocol: added
9+
10+
`ExternalDatasourceSettingsSchema` declares one optional key, `rowCap`: a whole number from 1 to `EXTERNAL_ROW_CAP_CEILING` (10,000). It is the most rows the engine reads from a plugin driver for one request, and so the most rows one read on such a datasource may match before it is refused with `EXTERNAL_ROW_CAP_EXCEEDED` (422). Absent, the cap is `EXTERNAL_ROW_CAP_DEFAULT` (1,000), today's fixed value, so no existing datasource changes. Both constants are exported from `@objectstack/spec/data`.
11+
12+
- **Refused where it would do nothing.** On a built-in driver (which runs the whole query itself and is never capped) the key is refused at `external.rowCap`, naming the driver. On a managed datasource it is refused by the existing managed-block refusal, which names it among the keys to remove. A value above the ceiling, zero, a negative or a fraction is refused at parse. `maxRows` and `rowLimit` are folded onto `rowCap` in the refusal's suggestion.
13+
- **Not acted on yet.** This is the contract half. The engine's floor over a plugin driver reads the key in a following change; until then a datasource that sets it still reads at 1,000 rows. The liveness ledger grades it `planned` until that reader lands.
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
'@objectstack/plugin-approvals': patch
3+
---
4+
5+
fix(plugin-approvals)!: a request with no submitter is recalled, reminded or resubmitted only by the system or the override actor
6+
7+
Clause-②: no (narrowing) — `recall`, `remind` and `resubmit` on a request whose `submitter_id` is empty (a run whose trigger resolved no user) refuse every caller except a system context and the override actor, where each door admits them; they admitted every caller who could read the request before. Nothing is widened.
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export or type changes: the three submitter doors apply their existing submitter rule to a request that has no submitter. The refusal is each door's existing non-submitter refusal, so there is nothing for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** accept-set narrowing at three approval doors (`@objectstack/plugin-approvals`), served by `POST /approvals/requests/:id/recall`, `/remind` and `/resubmit` and the request page's actions that forward to them.
13+
14+
- **Before (FROM).** On a request with no submitter, `recall`, `remind` and `resubmit` admitted any caller who could read the request: a pending approver, a past actor, or a reader at the opt-in record-reader level.
15+
- **Now (TO).** On such a request, `recall` admits a system context and the override actor on a `pending` request; `remind` and `resubmit` admit a system context. Every other caller gets the door's existing non-submitter refusal: `403 FORBIDDEN`, with the same sentence as before.
16+
- **Unchanged.** A request that has a submitter is judged exactly as before. Who may read a request, decide it, send it back, reassign it, ask for information or comment on it is unchanged.
17+
18+
**The remedy.** None for a person. A job that has to recall, remind or resubmit a request nobody submitted does it through a system context. An administrator recalls a stuck pending one through the override.

‎content/docs/references/data/datasource.mdx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ const result = DatasourceSchema.parse(data);
7777
| **credentialsRef** | `string` | optional | Reference into the secrets store; never inline credentials. Valid in every schemaMode — the one `external` key a managed datasource may carry. |
7878
| **connector** | `string` | optional | Name of a declared connector instance (a `connectors` entry with a `provider`) whose credential this API-backed datasource borrows — whichever kind the instance's `auth` declares (`bearer`, `api-key` or `basic`; ADR-0143 D2 adds the grant-bearing kinds), resolved the way the connector resolves it. One Connect serves both the connector's actions and this datasource's records. Exclusive with `credentialsRef`; refused on a built-in database driver and on a managed datasource. |
7979
| **queryTimeoutMs** | `number` | optional (default: `30000`) | Hard cap on per-query execution time. |
80+
| **rowCap** | `integer` | optional | Plugin-driver datasources only (a non-managed datasource whose `driver` is not a built-in id): the most rows the engine reads from the driver for one request, and so the most rows one read may match before it is refused with EXTERNAL_ROW_CAP_EXCEEDED (422). Absent: 1000. At most 10000. Each list page reads every match up to this cap from the remote, twice (the rows and the total), so raise it only as far as the widest read needs. |
8081

8182

8283
---
@@ -119,6 +120,7 @@ External datasource settings: federation policy (schemaMode != "managed") plus t
119120
| **credentialsRef** | `string` | optional | Reference into the secrets store; never inline credentials. Valid in every schemaMode — the one `external` key a managed datasource may carry. |
120121
| **connector** | `string` | optional | Name of a declared connector instance (a `connectors` entry with a `provider`) whose credential this API-backed datasource borrows — whichever kind the instance's `auth` declares (`bearer`, `api-key` or `basic`; ADR-0143 D2 adds the grant-bearing kinds), resolved the way the connector resolves it. One Connect serves both the connector's actions and this datasource's records. Exclusive with `credentialsRef`; refused on a built-in database driver and on a managed datasource. |
121122
| **queryTimeoutMs** | `number` | optional (default: `30000`) | Hard cap on per-query execution time. |
123+
| **rowCap** | `integer` | optional | Plugin-driver datasources only (a non-managed datasource whose `driver` is not a built-in id): the most rows the engine reads from the driver for one request, and so the most rows one read may match before it is refused with EXTERNAL_ROW_CAP_EXCEEDED (422). Absent: 1000. At most 10000. Each list page reads every match up to this cap from the remote, twice (the rows and the total), so raise it only as far as the widest read needs. |
122124

123125
### Nested Shape: `ExternalDatasourceSettings.validation`
124126

0 commit comments

Comments
 (0)