Skip to content

Commit 7eae0de

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/area-E2b-32948
2 parents 85a5bac + 34c0522 commit 7eae0de

140 files changed

Lines changed: 4794 additions & 373 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
'@objectstack/plugin-auth': patch
3+
---
4+
5+
fix(auth)!: an unmapped SAML sign-in reads the standard email and name claims before the NameID, and an SSO provider creates an account only for an email address
6+
7+
Clause-②: yes (narrowing) — narrowed: a new account a SAML or OIDC sign-in would create through an `@better-auth/sso` provider is refused `403 INVALID_EMAIL` (`error=INVALID_EMAIL` on the sign-in's error redirect) when the email the sign-in resolved to is not an email address, with SSO domain verification off as well as on, where it was created with that value as its email. Widened: for each SAML attribute-mapping member a provider leaves unset, the sign-in first reads the standard claim the assertion carries (`http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`, `givenname`, `surname`, `name`), where it read only `email` / `givenName` / `surname` / `displayName` and the NameID. No first-party composition in this repository registers a SAML or OIDC provider.
8+
Metadata-protocol: none
9+
Skills-docs: none — no skill under `skills/**` teaches the SAML attribute mapping or SSO account creation; `content/docs/permissions/sso.mdx` gains both rules in this change.
10+
11+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed, renamed or re-shaped, and no stored row changes: the provider's stored mapping is read as before, the added claims are read at sign-in only, and the moved answer is a runtime refusal at account creation, so there is nothing for a migration to rewrite and no tombstone. -->
12+
13+
**BREAKING** for a deployment whose SAML or OIDC provider resolves a person to a value that is not an email address: such a sign-in no longer creates an account. The common case is an identity provider that sends no email attribute, so the sign-in fell back to an opaque persistent or transient NameID (Microsoft Entra ID's IdP-initiated sign-in is one), or an OIDC mapping that names a claim holding a user name. With SSO domain verification on, such a value was already refused `EMAIL_DOMAIN_NOT_ALLOWED`, and still is. Also moved: for a SAML provider with no email mapping set whose assertion carries both a plain `email` attribute and the standard `emailaddress` claim, the standard claim now takes precedence, so where the two differ a new account is created at the claim's address rather than the `email` attribute's (an existing account still signs in by its account key).
14+
15+
Unchanged: an account that already exists signs in as before, whatever its email; linking; and every account creation that is not through an SSO provider.
16+
17+
What to do: nothing, unless a provider's users are created with a value that is not an address. For such a provider, map its email attribute (SAML) or claim (OIDC) to the one that carries the user's address.
18+
19+
The standard claims: Microsoft Entra ID and AD FS send them by default, and neither sends an `email` attribute, so an Entra ID provider with nothing mapped keyed its users on the NameID, an email-format user principal name when the sign-in started from the sign-in page and an opaque persistent id when it started from the identity provider's app portal. Both entries now resolve to the address in the `emailaddress` claim, so the second entry never creates another account: it finds the account the first one made and is refused `account_not_linked`, creating nothing, until that account is linked to it. A member an administrator mapped is always read as mapped, and a provider that sends `email` and none of these claims signs in exactly as before. A provider that encrypts its assertions reads only what it maps.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the `manifest.namespace` paragraph lists `runs` among the namespaces a package may never declare
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
`objectstack-platform` named `actions`, `connectors`, `global`, `hooks`, `oauth` and `trigger` as the route literals a package namespace may never spell, but the address grammar's refused set (`NAMESPACE_REFUSED_LITERALS`, derived from `NAMESPACE_POSITION_LITERALS` in `@objectstack/spec/kernel`) also holds `runs`, the literal in the inbound hook's namespace position. An AI author who picked `runs` met the refusal only at `os validate`, build or the install door. The list now names all seven, in the set's sorted order. No schema or runtime change.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
'@objectstack/spec': minor
3+
'@objectstack/core': patch
4+
'@objectstack/metadata-protocol': patch
5+
'@objectstack/rest': patch
6+
'@objectstack/runtime': patch
7+
---
8+
9+
feat(metadata-protocol): a metadata write's advisories and refusals come back in the caller's language
10+
11+
Clause-②: yes (widening) — `SaveMetaItemRequestSchema` and `PublishMetaItemRequestSchema` gain an optional, server-stated `userTextLocales` member (at most two locale codes; the doors build these requests member by member, so a wire body never sets it, like `client`), and `ExecutionContextSchema` gains an optional `workspaceLocale`. The batch publish body (`PublishPackageDraftsRequestSchema`) is unchanged; its door states the locales to the protocol call directly. Nothing that was accepted before is refused now; a request that states no locales composes in `en`, and a finding whose rule has no user sentence carries no `userMessage`, exactly as before.
12+
Metadata-protocol: added
13+
Skills-docs: none — `skills/**` and `content/docs/**` teach what a metadata author writes; `userTextLocales` and `workspaceLocale` are stated by the server from the caller's request and workspace, never authored or sent by a client, so no taught sentence moves. The generated reference pages (`content/docs/references/**`) are regenerated.
14+
15+
Ruling C on #32440: the producer of a finding writes its user-facing sentence in the request's language, else the workspace's default language, else English, and every client shows it as received. The authoring rules already carry a sentence in twelve languages for most findings (#32790); this change composes it on the server:
16+
17+
- Every `/meta` save, single-item publish and package publish now fills `userMessage` on each advisory, and on each issue of a 422 refusal, for a rule that has a user sentence. `rule`, `message`, `hint`, `path` and `where` are unchanged.
18+
- The door states the two languages it resolved: the request's own (its `Accept-Language` header or `locale` query) and the workspace default. The execution context used to fold them into one `locale`, so a request in a language the platform has no text in fell straight to English; it now carries the workspace default on its own as `workspaceLocale`, and the core helper `userTextLocalesOf(ctx)` reads the pair in order.
19+
- The REST server and the runtime dispatcher both state them, for saves, publishes and package publishes.
20+
21+
Not in this change: the refusal sentences written outside the authoring rules (the packaged permission-set lock, the permission middleware's denials) move onto the same ladder in a follow-up PR on #32656.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
---
2+
'@objectstack/metadata': patch
3+
---
4+
5+
fix(metadata)!: `unregisterPackage` keeps and reports the stored rows that name the package by the `_packageId` stamp alone unless forced, the boot and the operator migration bind no `package_id` column from such a row, and `detectStampOnlyRows` reports each with its history evidence (#32985)
6+
7+
Clause-②: yes (narrowing) — narrowed: `unregisterPackage(P)` keeps, until `{ force: true }`, items it used to remove (every item a loader stores in a row with an empty `package_id` whose body names P by `_packageId` alone, including every `DatabaseLoader`-stored `object`, `view`, `app` and `page` of P), and the boot's column-only bind and `migrateDatabaseLoaderRowPackages` leave such rows unbound where they bound them. Widened, additive in-process surface: `MetadataManager.unregisterPackage` takes an optional second argument `{ force }`, and the new `MetadataManager.unregisterPackageWithReport` takes the same and answers what it removed and what it kept (`unregisterPackage` still answers nothing, as the spec's `IMetadataService` declares); `@objectstack/metadata` exports the types `MetadataUnregisterPackageOptions`, `MetadataUnregisterPackageResult` and `MetadataStampOnlyRow`; the optional loader method `MetadataLoader.stampOnlyRows` is new (`DatabaseLoader` implements it); `@objectstack/metadata/migrations` exports `detectStampOnlyRows` and its types; `DatabaseLoaderRowLeftReason` gains `'stamp-only'`. No metadata an author writes is accepted or refused differently.
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 stored row is rewritten: what moves is which rows an uninstall removes and which rows the boot and the operator migration bind, so there is nothing for `objectstack migrate meta` to rewrite. -->
11+
12+
**BREAKING** for a caller of `MetadataManager.unregisterPackage` over a `DatabaseLoader`: items whose stored rows name the package by the `_packageId` stamp alone — every `object`, `view`, `app` and `page` item of the package among them, since `DatabaseLoader` writes no `package_id` for those types — are now kept and reported instead of removed. Run `detectStampOnlyRows` to see which rows are the environment's, then call `unregisterPackage(P, { force: true })` (or `unregisterPackageWithReport`) to remove the package's own items as before. Until then those items stay registered and stored.
13+
14+
**Upgrade note — environment rows stamped with the host by 17.0.0–18.3.0.** Every `@objectstack/metadata` from 17.0.0 through 18.3.0, in one composition — a `MetadataPlugin` that declares its `packageId`, an eager bootstrap with no `artifactSource`, and a `DatabaseLoader` on the metadata service — saved each package-less row its boot pass read back into the database stamped with the host's package (`_packageId`, `_provenance: 'package'`), with a new version and a history row. Those rows are the environment's own, but read as the host's: listed as the host's items; a phantom holder of a name a package also holds (a bare read of such a name refused `409`); and deleted, row and registry entry, by `unregisterPackage(host)` until this release. An 18.4.0 boot also bound the `package_id` column of each such row of a type stored per `(package, name)` (`agent`, `flow`, `tool`, `action` …) to the host. From the row alone such a row cannot be told from a row of the host's own item, which carries the same stamp; its history can. Measured on a database an 18.3.0 boot built (37 rows): 34 deleted by `unregisterPackage(host)` before this change, 0 after; a never-stamped control 0 both ways.
15+
16+
- **Find them:** `detectStampOnlyRows(driver, { packageId: 'com.acme.host' })` from `@objectstack/metadata/migrations` is read-only (`find` only). It lists each row whose body names a package by `_packageId` alone, its column empty or naming that package, with a verdict from the row's own history: `stamp-added` (a version that named no package, then one that added the stamp — the environment's row; `onlyStampAdded` marks the boot's signature), `stamped-since-create` (the package's own row), or `undetermined` (no history reaching back far enough).
17+
- **Repair one by hand,** for a row reported `stamp-added`, on a backup: remove `_packageId` and `_provenance` from its stored body and, if an 18.4.0 boot bound it, set its `package_id` back to empty, in one update. No migration rewrites these rows yet; one is deferred until an install reports a non-zero count.
18+
19+
**What moves.**
20+
21+
| Door | FROM | TO |
22+
|:---|:---|:---|
23+
| `unregisterPackage(P)` over an item a loader stores in a row whose `package_id` is empty and whose body names P by `_packageId` alone, any `source` | the item and its rows removed | kept — registry entry and rows — and reported in `unregisterPackageWithReport`'s `kept` (`reason: 'stamp-only-row'`, each row's loader, id and `source`) and in one `warn` naming the remedy; every row is checked before the first removal, so a failed check removes nothing |
24+
| `unregisterPackage(P, { force: true })` | — | removes those items too, as before this change |
25+
| `unregisterPackage(P)` over an item whose stored body names P by its own `packageId` (or the legacy `package`), or whose column is bound | removed | removed (unchanged) |
26+
| The boot's column-only bind (`DatabaseLoader.bindReadRowPackage`) of a legacy row whose body names its package by `_packageId` alone | `package_id` bound to that package | left empty; a row of a package's item whose code still ships is bound by that item's own save, the column only, on the same boot |
27+
| `migrateDatabaseLoaderRowPackages` over such a row | bound | left, reason `'stamp-only'` |
28+
29+
A false positive is the cost, and it is wide for one class: `DatabaseLoader` writes no `package_id` column for a type not stored per `(package, name)` (`object`, `view`, `app`, `page` …), so every row it stores for a package's item of such a type names the package by the stamp alone, and `unregisterPackage` now keeps all of them — item and row — until forced; the result and the `warn` name each one. A legacy row of a by-package type whose package's code no longer ships it stays unbound; reads of both are unchanged. An environment row is never removed or bound to the host by its stamp.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
'@object-ui/console': patch
3+
'@object-ui/i18n': patch
4+
---
5+
6+
fix(console): an `access_denied` sign-in return says the account has no access to this environment, with switch account and back to console
7+
8+
Clause-②: yes (widening) — the `@object-ui/i18n` locale packs gain four keys under `auth.login.errors` (`ssoAccessDenied`, `ssoSwitchAccount`, `ssoBackToConsole`, `ssoSwitchAccountHint`) in all eleven shipped locales; no key is renamed or removed.
9+
Metadata-protocol: none
10+
11+
When the control plane's identity provider refuses an account that is not a member of the environment's organization, it sends the browser back to the environment with `error=access_denied`, and the callback lands it on the Console sign-in page. That page had no sentence for the code and said the sign-in link had expired. It now says the account you signed in with does not have access to this environment, the same refusal the provider's own page states. On an environment the control plane runs (`features.cloudManaged` with the runtime config's `cloudUrl`), it also offers that page's two actions: **Switch account**, which opens the provider's end-session door (`/api/v1/auth/oauth2/end-session` on the control plane) in a new tab so the refused account is signed out there, and **Back to console**, the control plane's console. Elsewhere it shows the sentence alone, since the code may come from a provider the page cannot address. The technical code and description stay behind the details toggle, and every other refusal code keeps its sentence.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
---
2+
'@objectstack/runtime': patch
3+
---
4+
5+
fix(runtime)!: the action route answers by who holds the name on the route, and the environment's exact address answers its own item
6+
7+
Clause-②: yes (narrowing) — narrowed: the bare route `/api/v1/actions/lead/NAME`, where a disabled package's action owns `lead` (bound to it, or object-less) and the environment's own action of that name is on `lead` too, answered the environment's action when exactly one enabled package held the name on another object; it now answers no declaration there, as it already did with none or two. With an enabled package on another object and a disabled package's object-less action, the same route answered the environment's action or no declaration by registration order; it now answers no declaration in both orders. Widened: a served package's own route answers its own action beside the environment's or the platform's item on another object, and beside a disabled co-holder (was no declaration, or the environment's object-less item); and `/api/v1/actions/_env/OBJECT/NAME` answers the environment's own action while a package holds the name (was `404`).
8+
Metadata-protocol: none
9+
10+
<!-- adr-0087: not-required (no-migration-prescription) No schema key, accepted value or metadata type is added, removed, renamed or re-shaped. The moved answers are the runtime `/actions` route's declaration for a name several holders share, so there is nothing stored for a migration to rewrite and no tombstone. -->
11+
12+
**BREAKING** for one composition only: an action name held by a disabled package on an object (or with no object), by the environment's own action on that object, and by exactly one enabled package on another object. The route `/api/v1/actions/OBJECT/NAME` used to serve the environment's action there. It now answers that the action has no declaration, the answer it already gave when no enabled package, or two, held the name elsewhere. A disabled package that still binds the route is a holder there, so the route does not hand its call to another holder's declaration.
13+
14+
The route now decides from the holders of the name on the route itself: the items bound to the routed object, else the ones with no object. The protocol's by-name read cannot see the routed object, so its answer depended on which holders sat on other objects and on registration order. In order:
15+
16+
1. No enabled package's action is on the route and a disabled package's is: no declaration.
17+
2. The environment's own action is on the route: that action, with no package (ADR-0150 D3: the environment's own declaration answers first on one owner key).
18+
3. Exactly one enabled package's action is on the route and no platform action is there: that package's own action, read at its exact address and served with no package. A disabled co-holder, and the environment's or the platform's action on another object, do not change it.
19+
20+
Every other composition answers as before: one holder alone, two enabled packages on the route (refused naming both), the platform's action on the routed object, and every call that names its package. A store read that fails answers `503`, not a declaration.
21+
22+
The environment's exact address `/api/v1/actions/_env/OBJECT/NAME` answers the environment's own action whatever the other holders. The merged action listing leaves the environment's action out when a package holds the same name, so the address answered `404`. A package-less action with no row in the environment's store is the platform's and still answers `404` there.
23+
24+
Not changed: the registry keeps one package-less action per name, so a platform action and the environment's own action of one name replace each other, and the later registration stays. That rule is the registry's and is tracked separately.
25+
26+
What to do: nothing, unless a call relied on the environment's action answering a route that a disabled package's action still binds. Enable that package, or remove its action, or address the environment's action at `/api/v1/actions/_env/OBJECT/NAME`.

0 commit comments

Comments
 (0)