Bring the wilm branch into main: endpoints plugin, agent, policies, CSV import
Ports the corporate-GitHub wilm branch onto main, keeping the two branches
separate. Thirteen upstream commits arrive with their authorship intact; the
review fixes and the portability work below are on top.
What arrives:
endpoints plugin - a ShopDB agent reporting endpoint state, telemetry,
services and interfaces, with a command channel the agent
long-polls. Ingest stays on the generic collector route
(ADR-006); the agent key is a UI-managed single-scope
token whose revocation is an instant kill switch.
computers policies - Configuration and Business Policies (RMM-style), scope
trees validated at write time, actions checked against
the endpoints command allowlist. Feature-gated: every
route 404s while the setting is off, so enabling it can
never half-expose the surface.
asset CSV import - templates, a collector script carrying the site path, and
a validate-then-commit import. A plugin can own a virtual
column plus a post-write row hook, which is how a PC's
machine number becomes a controls link without a
hand-built relationships sheet.
agent/ - the Windows agent and its installer.
Contract 0.21.0 -> 0.24.0, additive throughout: register_import_hook (0.22),
mint/list/revoke_service_token (0.23), collector_authorized (0.24). The stability
table had no rows for any of them and now does.
MySQL 5.6 portability. The branch stored three policy columns as sa.JSON, the
only JSON columns in the product, and 5.6 has no JSON type: the migration failed
with a bare syntax error near the word JSON. They are TEXT now, through a
JSONText type decorator, so all seventeen call sites still read and write dicts.
The convention elsewhere is already TEXT (guides.blocksjson,
geenforce.manifestjson).
Review fixes carried on top:
- six policy GETs were jwt_required(optional=True), which authenticates a
caller without checking anything; they require computers.view now, and six
redundant jwt_required decorators are gone
- the agent installer took a default BaseUrl and CollectorKey, so a mistyped
run silently pointed an endpoint at the wrong instance; both are mandatory
and a non-https BaseUrl throws unless -AllowInsecureHttp is passed
- a committing CSV import wrote no audit row
Documentation: the 34 new routes are described in docs/api-inventory.json, which
is hand-maintained on purpose, and the generated spec now covers 331 paths and
477 operations across 22 surfaces. DEVELOPMENT-SETUP's 1071 troubleshooting row
said "use MySQL 8 for dev" and now gives the actual fix, including the trap that
5.6 downgrades ROW_FORMAT=DYNAMIC to Compact with a warning instead of an error.
Full suite 2123 passed, vitest 260 passed, all seventeen plugin chains migrate
clean on MySQL 5.6 and the naming, docs, parity and read-surface gates are green.
This commit is contained in:
@@ -57,7 +57,31 @@ from .plugins import plugin_manager
|
||||
# permission / empty / position. BREAKING for any plugin still using the old
|
||||
# shape, which is why it is recorded here: the change itself shipped earlier
|
||||
# without a bump, and a contract that changes silently is not a contract.
|
||||
__contract_version__ = '0.21.0'
|
||||
# 0.21.0: added require_any_permission beside require_permission and require_role
|
||||
# on shopdb.api so a plugin can gate a route on holding ANY of several
|
||||
# permissions (an OR check) instead of one. Part of the read-permission rework
|
||||
# where nav items and GET routes declare the permission they need. Additive name
|
||||
# on the authz surface, minor bump.
|
||||
# 0.22.0: added register_import_hook to shopdb.api so a plugin can own a VIRTUAL
|
||||
# COLUMN on an importable CSV table - a header the bulk importer accepts but
|
||||
# never writes - and a post-write row hook that turns that value into a plugin
|
||||
# concept. The computers plugin uses it for a machineassetnumber column on
|
||||
# computers.csv that builds the PC->machine controls link, so a site writes the
|
||||
# machine number in the PC row instead of hand-building a relationships sheet.
|
||||
# Core stays ignorant of the column's meaning. Additive name on the import
|
||||
# surface, minor bump.
|
||||
# 0.23.0: added mint_service_token, list_service_tokens and revoke_service_tokens
|
||||
# to shopdb.api so a plugin can provision, list, and revoke a single-scope
|
||||
# managed service token (an endpoint agent key) without importing core token
|
||||
# internals. The endpoints plugin uses them for a UI-managed, regenerable
|
||||
# collector.ingest.endpoints key whose revocation is an instant kill switch.
|
||||
# Additive names on the surface, minor bump.
|
||||
# 0.24.0: added collector_authorized to shopdb.api so a plugin can gate an
|
||||
# agent-facing route that lives OUTSIDE the generic collector blueprint (the
|
||||
# endpoints command claim/result long-poll callbacks) on the same per-plugin
|
||||
# collector key + managed-token check the ingest route uses, without importing
|
||||
# core collector internals. Additive name on the surface, minor bump.
|
||||
__contract_version__ = '0.24.0'
|
||||
|
||||
# Product release version (see ADR-007). The product version and the
|
||||
# plugin-contract version above are distinct series with independent
|
||||
|
||||
Reference in New Issue
Block a user