Import the wilm agent store and WINC adoption work, with four fixes
Eleven commits from the sister site: a reversible Maximo/WINC machine-adoption import, a versioned agent binary store with upload and rollback, remote-BuildKit CI, tray version reporting, and UI fixes. Applied as a patch again - the published mirror rewrites hashes, so the branches have unrelated histories and git refuses to merge them. Reviewed by three agents before merging. Four things fixed here. THE PUBLISH WORKFLOW WAS DEAD. The new remote-BuildKit step in publish-images.yml sits at column 0 instead of indented under steps:, so the whole file is invalid YAML and GitHub would refuse it. Their entire GHCR distribution channel - which Start-ShopDBDev.ps1 and the compose files consume - was broken at the source and clearly never run. Indented; all five workflows now parse. THE IMPORT'S APPROVAL CHECK COULD NOT FAIL. commit() built the plan and the approval packet from the same upload and then asked the writer whether they matched, so packet_matches_plan compared a hash against itself. The documented contract - "a human approves a specific, frozen plan, and the writer can prove nothing drifted" - did not exist in the web path: an admin could preview file A and commit file B, gated only by the needs-create group NAMES they ticked. The preview's planhash is now required at commit and checked against a freshly rebuilt plan. Their tests committed without previewing, which is what let this through; they go through the real flow now, and three new tests pin it - all confirmed to fail with the check stubbed out. endpoints.agentpackage QUIETLY GREW. It used to mean "wrap the staged exe in a ZIP"; with the upload routes it also means "choose the executable every future package installs and runs as SYSTEM". Before this, staging needed filesystem access to the server. The permission description still said only "generate and download a package", so an admin granting it could not see what they were granting. Reworded. NOTHING RECORDED WHAT WAS STAGED, OR BY WHOM. The manifest held version, size and timestamp; re-uploading a version replaces the bytes in place under the same label. A sha256 of the stored file is now recorded, and the upload is audit-logged with it - after an incident there was previously no answer to who put that binary on the fleet. Also documented the nine new routes in docs/api-inventory.json (that gate cannot run on the mirror, so it falls to us at promotion time again), regenerated the spec and the project map, and kept our own docs where they conflicted: docs/ is scrubbed from the mirror, so their DEV-BUILD-TEST.md still had the dev-be channel mapping we corrected, and their PLUGIN-HOOKS.md was a new 45-line file rather than our 737-line canonical one. Their journal section is appended to ours. Contract version comes across as 0.30.0 for a genuinely additive surface. Suite 2369, frontend 324, gate green. Scope: product
This commit is contained in:
@@ -305,6 +305,38 @@
|
||||
"params": "multipart: one file per table; form: commit (false = validate only)",
|
||||
"purpose": "Validate uploaded CSVs and, only when commit=true, load them. The default is a dry run that reports what WOULD change; a committing run writes an AuditLog row with the reconciled count",
|
||||
"example": "curl -X POST -H \"Authorization: Bearer $TOKEN\" -F \"assets=@assets.csv\" -F \"commit=true\" http://localhost:5001/api/settings/asset-import/import"
|
||||
},
|
||||
{
|
||||
"path": "/api/settings/asset-import/winc/preview",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_role admin",
|
||||
"params": "multipart/form-data: files (one WINC/Maximo CSV export)",
|
||||
"purpose": "Dry run a WINC machine-adoption import. Writes nothing; returns the plan, a summary, the needs-create groups an admin must acknowledge, and the planhash that authorises the matching commit",
|
||||
"example": "curl -X POST http://localhost:5001/api/settings/asset-import/winc/preview -H \"Authorization: Bearer $TOK\" -F files=@winc.csv"
|
||||
},
|
||||
{
|
||||
"path": "/api/settings/asset-import/winc/commit",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_role admin",
|
||||
"params": "multipart/form-data: files (the same export); form: planhash (REQUIRED, from the preview), acknowledge (comma-separated needs-create group names)",
|
||||
"purpose": "Apply a previewed WINC plan in one transaction, journalled so it can be undone. planhash is required and must match a freshly rebuilt plan: without it the drift check compared a packet against the plan it was built from and could never fail, so an admin could approve one plan and apply another",
|
||||
"example": "curl -X POST http://localhost:5001/api/settings/asset-import/winc/commit -H \"Authorization: Bearer $TOK\" -F files=@winc.csv -F planhash=$HASH -F acknowledge=businessunit"
|
||||
},
|
||||
{
|
||||
"path": "/api/settings/asset-import/winc/batches",
|
||||
"method": "GET",
|
||||
"auth": "jwt + require_role admin",
|
||||
"params": "none",
|
||||
"purpose": "List applied and undone import batches, newest first, with kind, row count, who applied it and when",
|
||||
"example": "curl http://localhost:5001/api/settings/asset-import/winc/batches -H \"Authorization: Bearer $TOK\""
|
||||
},
|
||||
{
|
||||
"path": "/api/settings/asset-import/winc/undo",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_role admin",
|
||||
"params": "body: batchid (required)",
|
||||
"purpose": "Reverse an applied batch by replaying its journal backwards. Conservative: a cell is put back only if it still holds what the import wrote, and a created row is deleted only when nothing outside the batch references it",
|
||||
"example": "curl -X POST http://localhost:5001/api/settings/asset-import/winc/undo -H \"Authorization: Bearer $TOK\" -H 'Content-Type: application/json' -d '{\"batchid\":\"...\"}'"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -4140,6 +4172,46 @@
|
||||
"params": "body: as for the site agent package",
|
||||
"purpose": "Bundle the agentless adoption tool, for taking an inventory of a machine that will not run the service",
|
||||
"example": "curl -X POST http://localhost:5001/api/endpoints/adoptiontool/package -H \"Authorization: Bearer $TOK\" -o shopdb-adoption.zip"
|
||||
},
|
||||
{
|
||||
"path": "/api/endpoints/siteagent/binaries/<binkey>",
|
||||
"method": "GET",
|
||||
"auth": "jwt + require_permission endpoints.agentpackage",
|
||||
"params": "path: binkey (agent|tray)",
|
||||
"purpose": "List the staged versions of one agent binary, newest first, with the current one marked",
|
||||
"example": "curl http://localhost:5001/api/endpoints/siteagent/binaries/agent -H \"Authorization: Bearer $TOK\""
|
||||
},
|
||||
{
|
||||
"path": "/api/endpoints/siteagent/binaries/<binkey>",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_permission endpoints.agentpackage",
|
||||
"params": "path: binkey (agent|tray); multipart/form-data: file (a Windows PE, 64 MB cap), version (strict dotted-numeric), makecurrent (default true)",
|
||||
"purpose": "Stage an uploaded binary as a new version. This supplies the executable every future package installs and runs as SYSTEM on the fleet, so it is audit-logged with the stored file's sha256",
|
||||
"example": "curl -X POST http://localhost:5001/api/endpoints/siteagent/binaries/agent -H \"Authorization: Bearer $TOK\" -F file=@shopdbagent.exe -F version=1.6.3"
|
||||
},
|
||||
{
|
||||
"path": "/api/endpoints/siteagent/binaries/<binkey>/detect",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_permission endpoints.agentpackage",
|
||||
"params": "path: binkey; multipart/form-data: file",
|
||||
"purpose": "Read the version out of an uploaded PE's resource table so the upload form can prefill it. Stores nothing",
|
||||
"example": "curl -X POST http://localhost:5001/api/endpoints/siteagent/binaries/agent/detect -H \"Authorization: Bearer $TOK\" -F file=@shopdbagent.exe"
|
||||
},
|
||||
{
|
||||
"path": "/api/endpoints/siteagent/binaries/<binkey>/adopt",
|
||||
"method": "POST",
|
||||
"auth": "jwt + require_permission endpoints.agentpackage",
|
||||
"params": "path: binkey; body: version",
|
||||
"purpose": "Adopt a binary already staged on disk into the version manifest, for a build that predates the store",
|
||||
"example": "curl -X POST http://localhost:5001/api/endpoints/siteagent/binaries/agent/adopt -H \"Authorization: Bearer $TOK\" -H 'Content-Type: application/json' -d '{\"version\":\"1.6.2\"}'"
|
||||
},
|
||||
{
|
||||
"path": "/api/endpoints/siteagent/binaries/<binkey>/current",
|
||||
"method": "PUT",
|
||||
"auth": "jwt + require_permission endpoints.agentpackage",
|
||||
"params": "path: binkey; body: version (must already be staged)",
|
||||
"purpose": "Point the current staged build at another version, so a package rolls back to it. The retention sweep never prunes the current one",
|
||||
"example": "curl -X PUT http://localhost:5001/api/endpoints/siteagent/binaries/agent/current -H \"Authorization: Bearer $TOK\" -H 'Content-Type: application/json' -d '{\"version\":\"1.6.2\"}'"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user