You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 5e9d280
Browse filesBrowse the repository at this point in the historyBrowse files
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.
0 commit comments