Skip to content

Commit 5e9d280

Browse files
committed
Merge remote-tracking branch 'origin/main' into claude/project-thread-2rp7qk
2 parents 425cef8 + 4894cfe commit 5e9d280

37 files changed

Lines changed: 940 additions & 35 deletions
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
---
2+
'@objectstack/cloud-connection': patch
3+
'@objectstack/plugin-audit': patch
4+
---
5+
6+
feat(cloud-connection,plugin-audit): the hosted install door forwards the install mode and the installing user, an unmanaged grant is copied by the environment's own install-local door, and every unmanaged copy writes a `package_unmanaged_import` audit row
7+
8+
Clause-②: yes (widening) — `POST /api/v1/cloud-connection/install` accepts `install_mode` (or `installMode`) and sends the control plane's `sys_package.install_package` action `install_mode` and `installer_user_id`; on an unmanaged grant it answers the install-local door's answer; the install-local plugin registers the in-process `marketplace-install-local` service; `sys_audit_log.action` gains `package_unmanaged_import`, and plugin-audit's package lifecycle writer accepts that event; `@objectstack/plugin-audit` newly exports `PACKAGE_UNMANAGED_IMPORT_AUDIT_ACTION`, `PackageUninstallAuditEvent` and `PackageUnmanagedImportAuditEvent`, `PackageLifecycleAuditEvent` is now the union of the two event types (narrow it on `action`), and `PackageLifecycleAuditAction` gains `package_unmanaged_import`
9+
Metadata-protocol: none
10+
11+
- **The install mode, forwarded.** `POST /api/v1/cloud-connection/install` reads `install_mode` (the control plane's spelling) or `installMode` (the install-local door's), parsed against `InstallModeSchema`. A value the schema refuses, or two spellings that disagree, answers 400 `INVALID_REQUEST` before the control plane is called. When the caller names a mode, it is sent as the action's `install_mode` body param; when the caller names none, nothing is sent, and the control plane reads that as `managed`, as before.
12+
- **The installing user, forwarded.** Every install now sends `installer_user_id`, a body param on the same action, never a header. Its value is the id of the session this door admitted, never a value from the request body. The control plane reads it only for a member of the environment's organization, and records its service principal otherwise (the cloud half, cloud#3624).
13+
- **An unmanaged grant is copied by the environment.** When the control plane grants an unmanaged install, this door hands the copy to the environment's own install-local door: `installMode: 'unmanaged'`, the granted `version_id`, `seedSampleData` only when the caller asked for it, and the caller's own headers, so the door admits and gates the same person. The answer is that door's answer. The copy keeps every gate the install-local door applies: the installer's install capability, the protocol handshake, the namespace holds, the copy record, and sample rows owned by the installer. A grant this door cannot read (no `install_mode: 'unmanaged'` echoed, or no `version_id`) answers 502 and copies nothing; a `data.manifest` in the answer is never read. When the answer has no `install_mode` at all, the 502 adds that a control plane that does not read the param may already have installed the package managed, and to check Installed before retrying. An environment without the install-local plugin answers 503 and copies nothing. A control-plane refusal, and every managed install, is answered exactly as before.
14+
- **Cross-repo, not measured here.** The grant's shape (the control plane skips its own install on an unmanaged grant and answers `data.install_mode: 'unmanaged'` with `data.version_id`) is assumed from the cloud half's design; cloud PR #3683 is not readable from this repository. So is the install-local plugin being mounted in a hosted environment's kernel at all: this repo's hosted Console reads a cloud base as having no install-local door (the 30963 changeset), and without the door an unmanaged grant answers 503 (#31482). The namespace a copy is renamed into (`targetNamespace`, #30794) is not forwarded to the control plane yet (#31482): whether its action accepts an unknown param is not known here.
15+
- **The in-process install door.** The install-local plugin registers the `marketplace-install-local` service at `init`. Its `install(request)` runs `POST /api/v1/marketplace/install-local` for a Fetch `Request` and answers that route's `Response`, through the same handler.
16+
- **New plugin-audit exports.** `@objectstack/plugin-audit` exports `PACKAGE_UNMANAGED_IMPORT_AUDIT_ACTION`, `PackageUninstallAuditEvent` and `PackageUnmanagedImportAuditEvent`. `PackageLifecycleAuditEvent` is now `PackageUninstallAuditEvent | PackageUnmanagedImportAuditEvent`, so a reader narrows it on `action`; `PackageLifecycleAuditAction` gains `package_unmanaged_import`.
17+
- **The environment's audit row of each unmanaged copy.** The install-local door's unmanaged branch hands the `audit` slot one `package_unmanaged_import` event per copy it attempted, whether it landed or not, from both doors that reach it. plugin-audit's package lifecycle writer stores it as a deployment-level `sys_audit_log` row (no record, no organization), with `metadata` naming the source package and version, the new base, its namespace, the namespace a rename came from, the items copied and `outcome` (`success` or `failure`; a failure adds its error code and HTTP status, never its message). `environment_id` is null on this row: the door does not know it. The ledger's `action` select gains the value writer-first, with its labels regenerated by `os i18n extract`; the new label is filled from English in every locale until a translator replaces it. An audit slot that throws changes no answer.

‎docs/adr/0143-outbound-connector-auth-is-open-tier.md‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,21 @@ cloud-repository record with a `## Provenance` pointer back to this number. That
4848
filed by the PR that lands this file**; the cloud repository is outside its reach. Until it exists,
4949
the maintainer's ruling quoted above is the commercial decision of record.
5050

51+
> **Amended (2026-11-08, #28262) — the commercial half is cloud ADR-0115.** The cloud-repository record
52+
> the paragraph above calls owed exists: `cloud ADR-0115`,
53+
> [`docs/adr/0115-outbound-connector-auth-open-tier-commercial-boundary.md`](https://github.com/objectstack-ai/cloud/blob/main/docs/adr/0115-outbound-connector-auth-open-tier-commercial-boundary.md)
54+
> in `objectstack-ai/cloud`. The maintainer merged it on 2026-10-30 through objectstack-ai/cloud#3354, as
55+
> cloud commit `d4c97b39`. Its header names it the commercial half of this record, and its
56+
> `## Provenance` points back here and to #26768 item 3. Its own status line reads Proposed (2026-10-28).
57+
>
58+
> - **What it decides.** Open tier, with no paid gate set by cloud: the in-environment connector
59+
> credential object, outbound OAuth with its refresh and connection record, the app-credential exchange
60+
> and request signing. Commercial, as "may be charged, no delivery promised": vault / KMS backends,
61+
> BYOK, key rotation, credential access-audit export and premium hand-built connectors.
62+
> - **The record of decision.** The sentence above that begins "Until it exists" records the state before
63+
> that merge. The commercial decision of record is now cloud ADR-0115, and the warning below applies to
64+
> it. Nothing this file decides changes.
65+
5166
⚠️ Where a cloud record and this document disagree about the *commercial* boundary, the cloud record
5267
decides. What this document decides, and cloud does not, is where the **code** lives and what its
5368
contract is.
@@ -551,3 +566,7 @@ Each slice is its own card and lands after this record is accepted.
551566
| providers: MCP authorization flow, OpenAPI `securitySchemes`, REST; the `RequestSigner` seam and first signers | `domain:server` | #26702 item 6, #26710 items 3–4 |
552567
| Console Connect / Reconnect and connection status | `domain:ui` | #26702 item 7 |
553568
| the cloud-repository record ([Provenance](#provenance--read-this-before-citing-this-file)) | the commercial repository | #26702 item 1, #26768 item 3 |
569+
570+
> **Amended (2026-11-08, #28262).** The last row's record exists: cloud ADR-0115, merged on 2026-10-30
571+
> through objectstack-ai/cloud#3354 as cloud commit `d4c97b39`. That slice is done; see the 2026-11-08
572+
> note under [Provenance](#provenance--read-this-before-citing-this-file).

0 commit comments

Comments
 (0)