Skip to main content

Module client

Module client 

Source
Expand description

The gateway HTTP seam: a coarse GatewayApi trait so actions never touch reqwest types, plus the production ReqwestGatewayApi.

LOCKED: the trait uses async_trait (research Open Question 2, resolved) — dyn-compatible today, ubiquitous. The trait stays COARSE — one method per capability, not per endpoint — so Phase 2 grows it without churn.

Auth-header rule (verified against a live 8.3.6 gateway, 02-RESEARCH §Auth Model): a token credential sends X-Ignition-API-Token; a basic credential sends Authorization: Basic <b64>; NEVER both — enforced by a match in ReqwestGatewayApi::apply_auth, the ONE place [Secret::expose] is called outside the secret module (the grep-auditable redaction boundary; CORE-02).

Basic is loudly demoted there: valid Basic credentials → 401 on every 8.3 /data route (verified), so each use warns — never silently retried. Note gateway-info itself DOES require auth under 8.3 default security (header-less → 401, re-verified live 2026-08-21 — the 83-api collection’s auth: none tag does not hold); a None credential proceeds header-less and classifies the answer.

Redirects are never followed (Policy::none()): an uncommissioned gateway 302s EVERYTHING to /welcome and the default follow would render the wizard’s HTML as a 200 (02-RESEARCH Pitfall 6). The 3xx is classified by [classify] instead.

Every request runs the pipeline: build URL → apply auth (opt-in) → send (transport error → Network) → [classify] → parse the body. Nothing ever calls .json() on a response that skipped classify().

Modules§

apicall
The raw api-call capability (09-03, EXT-01) — ign api call’s client half: the request model, the gateway-verbatim data envelope, and the two usage-class guards the CLI runs PRE-resolution (and the action re-runs).
backup
Backup capability constants + query builders (04-04, RIG-04) — the gwbk wire: stream down, octet up (04-RESEARCH §Backup endpoints, 83-api postman primary).
connections
DB/OPC connection capability models (02-03, HLTH-05/06).
diagnostics
Diagnostics-bundle capability (09-05, EXT-02; 09-07 Invalid capture) — the support-bundle slice of GET/POST /data/api/v1/diagnostics/bundle/*, wire-shaped STRICTLY from the live captures (09-LIVE-CAPTURES §5 — the Pitfall-2 capture: observed, never guessed).
eam
EAM capability constants + models (07-02, BKUP-02) — the Enterprise Administration Module’s wire, live-proven on 8.3.3 during 07-RESEARCH (trimmed openapi extract in the phase dir).
gan
Gateway Area Network overview model (09-04, EXT-02) — GET /data/api/v1/overview/gan, the ZERO-CONNECTION body live-captured identically on both rigs (09-LIVE-CAPTURES §4: 8.3.6 rig A + 8.3.3 rig B). A fresh non-GAN gateway’s zero-connection shape IS the canonical capture — 5 flat scalars, no arrays, no nesting.
idp
Native OIDC login + CSRF flow (04-03, tier 1 of the trial-reset ladder) — the internal IdP’s challenge dance, live-probed during 04-RESEARCH and live-verified END-TO-END on 8.3.3 during this plan’s spike: login → session → CSRF → POST /data/api/v1/trial flipped expired:true → false (trialSecondsLeft 0 → 7199).
license
License capability model (09-04, EXT-02) — GET /data/api/v1/licenses, field names + nesting exactly as live-captured on both rigs (09-LIVE-CAPTURES §1: 8.3.6 rig A + 8.3.3 rig B, 2026-09-07). The version-tolerance recipe is TrialWire’s (client/trial.rs): every rename + snake_case alias + default, unknown keys never refuse the parse, and the remainder rides #[serde(flatten)].
logs
Log capability models (02-04, HLTH-03/04) — log entries, the query (with the tail cursor), the logger registry, and the archive download. Field names match the live 8.3.6 captures (02-RESEARCH §Logs + loggers) and the gateway’s openapi schema; every model rides #[serde(flatten)] extra passthrough so --json stays complete as gateway responses evolve.
metrics
Metrics capability models (02-02, HLTH-07) — the verified /data/api/v1/systemPerformance/ endpoints (02-RESEARCH §Metrics).
projects
Project-family capability models (03-01, PROJ-01/02) — the native /data/api/v1/projects/* CRUD family: wire-faithful camelCase models, verified path constants/builders, and the ONE per-segment encoder.
query
The standard 8.3 list envelope + query (02-RESEARCH §Verified Endpoint Catalog): every list-capable endpoint takes the same limit/offset/sortBy/search/filter params and answers {items, metadata} — ONE generic pair covers them all.
redundancy
Redundancy capability model (09-04, EXT-02) — GET /data/api/v1/redundancy, the FLAT 11-field body live-captured on both rigs (09-LIVE-CAPTURES §3: 8.3.6 rig A + 8.3.3 rig B). The TrialWire recipe throughout: rename + snake_case alias + default on every camelCase key, unknown keys never refuse the parse, flatten remainder.
resources
Project-resource ZIP-member surgery (05-02) — the resource family re-pointed onto project-export zips, closing the Phase 3 cross-phase defect: the /projects/{p}/resources/** REST routes the family originally targeted DO NOT EXIST on real 8.3 gateways (openapi-evidenced twice — 575 paths, zero matches — plus the EAM probe and the gateway-scripting API audit; 05-RESEARCH). The native steer’s honest endpoint: export/import round-trip. These helpers are the surgery half.
restart
Restart + diagnostics-probe capabilities (02-05, HLTH-09/10/11).
scripts_codec
The Ignition Flint script codec (07-04, INTR-01) — decode/encode of the scripts EMBEDDED inside JSON resource members (Perspective view.json component scripts, tag event scripts, …) into editable .py sidecars, with a byte-exact unedited round-trip.
sessions
Session-family capability models (02-03, HLTH-08) — designer sessions, Perspective sessions, and Vision clients, field names matching the live 8.3.6 captures (02-RESEARCH §Sessions + terminate) and the gateway’s openapi schema.
status
Status/info capability models (02-02, HLTH-01/02) — field names match the live 8.3.6 gateway captures (02-RESEARCH §Status/info, §Modules) and the gateway’s own openapi schema.
tags
Tag capability models (05-04, TAGS-01..04) — TWO seams, one file per the family’s wire split (05-RESEARCH):
trial
Trial-license capability models (04-03, RIG-02/03) — field names match the live-captured 8.3.x bodies (04-RESEARCH §Code Examples, re-verified live on BOTH minor versions during this plan’s spike: expired shape on ign-research 8.3.6, active shape on the ignition-devops rig 8.3.3).
version
Gateway-info model + the minimum-version gate (CORE-08).
webdev
The WebDev client seam (05-03) — the CLI’s own gateway-side surface at /system/webdev/{project}/cli/{route} (NOT /data/webdev/* — that prefix does not exist; 05-RESEARCH wire protocol, live-proven on 8.3.3).
workspace
The workspace engine’s pure core (13-02) — the injective user-path → local-fs-path mapping, plus (Task 3) the MemberSource abstraction that lets the proven v1.0 member engine (crate::client::resources) speak EITHER a gateway export zip OR a checked-out directory tree.

Structs§

ReqwestGatewayApi
Production GatewayApi over reqwest.

Traits§

GatewayApi
One capability per method — coarse on purpose. Phase 2 adds status, modules, metrics, … as methods here; actions never see reqwest types.