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
cite schema, samples, and templates and cover Do blocks, status
7
+
messages, custom parameters, and reserved variables. The http-api
8
+
recipe spans every auth shape the API documents — Basic/Digest via
9
+
HttpAuth, or Bearer / custom Authorization scheme / custom-header API
10
+
key via script-built Headers — plus one-step vs two-step token fetch.
11
+
Mandates the fast inner loop: local schema validation against schema/
12
+
before any appliance round-trip. SchemaOnly green is necessary but not
13
+
sufficient — cross-reference samples for analogous patterns before
14
+
declaring ready.
12
15
---
13
16
14
17
# script-authoring
@@ -19,13 +22,11 @@ Before drafting or revising any platform JSON, consult [`AGENTS.md`](../../../AG
19
22
20
23
## Scope
21
24
22
-
Six pattern sub-recipes cover the supported transports:
25
+
Four pattern sub-recipes cover the supported transports:
23
26
24
27
-[`ssh-interactive`](#ssh-interactive)
25
28
-[`ssh-batch`](#ssh-batch)
26
-
-[`http-api-basic`](#http-api-basic)
27
-
-[`http-api-bearer`](#http-api-bearer)
28
-
-[`http-api-key`](#http-api-key)
29
+
-[`http-api`](#http-api)
29
30
-[`http-form-fill`](#http-form-fill)
30
31
31
32
Telnet/TN3270 is out of scope (`agent-skills-plan.md` §2). The recipes below are starting points; pick one based on [`strategy-selection`](../strategy-selection/SKILL.md) output and adapt it.
@@ -63,7 +64,7 @@ A green local schema check proves the JSON parses and conforms to the schema. It
63
64
64
65
Before declaring a draft "ready to import," cross-reference an analogous sample from `samples-index.md`. If a sample uses a construct your draft does not (e.g., a `Try`/`Catch` around `Disconnect`, a `Receive` flush of the login banner, a `Headers` block before `HttpAuth`), surface that divergence to the operator rather than silently omitting it. The `agent-skills-plan.md` §5 rule is explicit: *"if a sample uses a construct the draft doesn't, surface the divergence."*
65
66
66
-
## Conventions all six patterns share
67
+
## Conventions all four patterns share
67
68
68
69
-**Top-level shape.**`Id`, `BackEnd: "Scriptable"`, optional `Meta`, optional `Imports`, then one object per operation (`CheckSystem`, `CheckPassword`, `ChangePassword`, …). Operation objects contain `Parameters` (array of single-key objects) and `Do` (array of command objects). See [`schema/custom-platform-script.schema.json`](../../../schema/custom-platform-script.schema.json) lines 14–80 for the top-level fields, and [`docs/reference/script-structure.md`](../../../docs/reference/script-structure.md) for prose.
69
70
-**Reserved parameters** are not declared by the script — SPP injects them. Custom parameters are declared in `Parameters` and addressed as `%Name%`. See [`docs/reference/reserved-parameters.md`](../../../docs/reference/reserved-parameters.md) and [`docs/reference/custom-parameters.md`](../../../docs/reference/custom-parameters.md).
**Use when**vendor docs or a `WWW-Authenticate: Basic …` response indicate HTTP Basic on every call.
150
+
**Use when**the target exposes a documented HTTP/REST API and the script presents a credential the operator already holds (token, password, API key, anything else).
The script shape is the same regardless of auth scheme: `BaseAddress` → `NewHttpRequest` → (auth setup) → `Request` → `ExtractJsonObject` → `Status`. What varies is two orthogonal choices the recipe makes you spell out: **auth shape** and **one-step vs two-step**.
152
153
153
-
**Closest production sample:**[`samples/http/wordpress/WordPressHttp.json`](../../../samples/http/wordpress/WordPressHttp.json). The pattern is `BaseAddress` → `NewHttpRequest` → `HttpAuth` → `Request`; verified at lines 33–40 and again at 78–82, 128–132 of that sample.
154
+
#### Auth shape — pick a bucket, then a specific scheme
154
155
155
-
**Key shapes (verified in the sample):**
156
+
The first decision is *who handles the auth dance*:
157
+
158
+
| Bucket | What the script does | Auth schemes |
159
+
| --- | --- | --- |
160
+
|**HttpAuth-managed**| Hand SPP a username/password and an auth `Type`; the runtime builds the header. |`Basic`, `Digest`|
161
+
|**Script-managed header**| Build the header value yourself and attach it via `Headers`/`AddHeaders`. |`Authorization: Bearer <token>`, custom `Authorization` schemes (`PVEAPIToken=…`, `Token …`, vendor-specific), custom-header API keys (`X-API-Key`, `X-Vault-Token`, `X-Auth-Token`, …) |
162
+
163
+
**HttpAuth-managed (Basic, Digest).** Set per-request, not once globally; this matches the existing samples and avoids leaking the service-account credential into requests that should target the managed account.
Set Basic auth per-request, not once globally. This matches the sample and avoids leaking the service-account credential into requests that should target the managed account.
**Closest production sample:**[`samples/http/onelogin-jit/OneLogin_GRC_JIT_addon.json`](../../../samples/http/onelogin-jit/OneLogin_GRC_JIT_addon.json). It interleaves `HttpAuth Basic` (when calling the token endpoint with client credentials, lines 2275–2278) with `Authorization: Bearer %AccessToken%` headers on subsequent calls (lines 1228, 1361, 1510, 1672, 1834, 2002, 2135).
175
-
176
-
**Key shapes:**
177
-
178
-
- POST to the token endpoint (often `HttpAuth``Basic` with client id/secret, sometimes form-encoded body).
179
-
- Parse the response with `ExtractJsonObject` to capture `AccessToken` (or vendor-specific field).
180
-
- Build a fresh `NewHttpRequest` for each subsequent call; attach `Authorization: Bearer %AccessToken%` via the `Headers.AddHeaders` map.
172
+
Closest production sample for Basic: [`samples/http/wordpress/WordPressHttp.json`](../../../samples/http/wordpress/WordPressHttp.json) (lines 33–40, 78–82, 128–132). Starter template: [`templates/Pattern-GenericRestApiBasicAuth.json`](../../../templates/Pattern-GenericRestApiBasicAuth.json). For Digest the shape is identical with `Type: "Digest"`; clean self-hostable Digest targets are rare in 2025, so verify the runtime supports the scheme against the deployed appliance version before committing.
181
173
182
-
Do not reuse the same `RequestObjectName` for token-fetch and operation calls — Basic auth and Bearer auth have different `HttpAuth`/`Headers` configurations and crossing them is a common source of 401s.
**Use when** the API takes a static key in a custom header (e.g., `X-API-Key`, `X-Auth-Token`) instead of `Authorization`.
189
-
190
-
**Starter:**[`templates/Pattern-GenericRestApiKeyRotation.json`](../../../templates/Pattern-GenericRestApiKeyRotation.json) — also covers the `CheckApiKey` / `ChangeApiKey` operation pair. The custom-header shape lives at lines 184–190 of that file:
174
+
**Script-managed header (Bearer, custom Authorization scheme, custom-header API key).** Use `Headers`/`AddHeaders`, not `HttpAuth`. There is no `HttpAuth``Type` for arbitrary header shapes.
191
175
192
176
```jsonc
193
177
{ "Headers": {
194
-
"RequestObjectName":"CheckApiKeyRequest",
178
+
"RequestObjectName":"CheckRequest",
195
179
"AddHeaders": {
196
180
"Accept":"application/json",
197
-
"X-API-Key":"%ApiKey%" } } }
181
+
"Authorization":"Bearer %AccessToken%" } } }
198
182
```
199
183
200
-
**Key shapes:**
184
+
Swap `Authorization: Bearer <token>` for whatever the vendor actually uses. Two common variants:
-**Custom-header API key** (`X-API-Key: %ApiKey%`, `X-Vault-Token: %Token%`, `X-Auth-Token: …`). See lines 184–190 of [`templates/Pattern-GenericRestApiKeyRotation.json`](../../../templates/Pattern-GenericRestApiKeyRotation.json). That template also covers the `CheckApiKey` / `ChangeApiKey` operation pair for when the script must rotate the key itself; pair with [`docs/guides/api-key-management.md`](../../../docs/guides/api-key-management.md).
188
+
189
+
Whichever bucket you're in, declare the credential as `Type: "Secret"` in `Parameters` so SPP redacts it in task logs.
190
+
191
+
#### One-step vs two-step
192
+
193
+
Orthogonal to the bucket above:
194
+
195
+
-**One-step** — the operator already holds the credential the script presents on every operation call. HttpAuth-managed shapes are almost always one-step. Script-managed-header shapes are one-step when the credential is a long-lived API key or PAT.
196
+
-**Two-step** — the script POSTs credentials (often HttpAuth-managed `Basic` with client id/secret, sometimes form-encoded) to a token endpoint, parses the response with `ExtractJsonObject` to capture an access token, then attaches that token via script-managed `Headers` on every subsequent operation call. The `samples/http/onelogin-jit/` sample is the canonical example, interleaving `HttpAuth Basic` on the token call (lines 2275–2278) with `Authorization: Bearer %AccessToken%` on the operation calls.
201
197
202
-
- Use `Headers` / `AddHeaders` rather than `HttpAuth` — there is no `HttpAuth` type for arbitrary header schemes.
203
-
- Declare the key as `Type: "Secret"` in `Parameters` so SPP redacts it in task logs.
204
-
- For rotation, pair with [`docs/guides/api-key-management.md`](../../../docs/guides/api-key-management.md) — the script must implement `CheckApiKey` + `ChangeApiKey`, and the operations the platform exposes change accordingly.
198
+
Two-step gotcha: do **not** reuse the same `RequestObjectName` for the token-fetch and the operation calls. The two have different `HttpAuth`/`Headers` configurations and crossing them is a common source of 401s. Build a fresh `NewHttpRequest` for each.
Copy file name to clipboardExpand all lines: .agents/skills/strategy-selection/SKILL.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,8 +4,11 @@ description: >-
4
4
Use to decide the implementation approach for a custom platform from
5
5
protocol, vendor documentation, and probe evidence. Maps inputs to a
6
6
recommendation across SSH (interactive vs batch) and HTTP (form-fill
7
-
vs API; basic / bearer / api-key; password vs key vs API key;
8
-
self-managed vs service-account). Accepts both fetched URLs and
7
+
vs api). For http-api, also picks the auth shape — HttpAuth-managed
8
+
(Basic, Digest) vs script-managed header (Bearer, custom Authorization
9
+
scheme, custom-header API key) — and one-step vs two-step token fetch.
10
+
Plus credential intent (password / SSH key / API key / bearer token)
11
+
and self-managed vs service-account. Accepts both fetched URLs and
9
12
vendor-doc excerpts the user pasted into the conversation.
10
13
---
11
14
@@ -17,16 +20,20 @@ Before recommending a pattern, consult [`AGENTS.md`](../../../AGENTS.md) for the
17
20
18
21
## Scope
19
22
20
-
Map `(protocol, vendor docs, probe evidence)` to one of the six authoring patterns covered by [`script-authoring`](../script-authoring/SKILL.md):
23
+
Map `(protocol, vendor docs, probe evidence)` to one of the four authoring patterns covered by [`script-authoring`](../script-authoring/SKILL.md):
21
24
22
25
-`ssh-interactive`
23
26
-`ssh-batch`
24
-
-`http-api-basic`
25
-
-`http-api-bearer`
26
-
-`http-api-key`
27
+
-`http-api`
27
28
-`http-form-fill`
28
29
29
-
Plus two orthogonal dimensions: **credential intent** (password / SSH key / API key / bearer token) and **self-managed vs service-account**.
30
+
When `http-api` is the recommendation, also pick:
31
+
32
+
-**Auth shape bucket.***HttpAuth-managed* (Basic, Digest) vs *script-managed header* (Bearer, custom `Authorization` scheme, custom-header API key).
33
+
-**Specific scheme** within the bucket (e.g., `Bearer` vs `PVEAPIToken=…` vs `X-API-Key`).
34
+
-**One-step vs two-step** — does the operator already hold the credential the script presents on every call (one-step), or must the script POST credentials to a token endpoint first (two-step)?
35
+
36
+
Plus two orthogonal dimensions that apply to every pattern: **credential intent** (password / SSH key / API key / bearer token) and **self-managed vs service-account**.
30
37
31
38
## Modes
32
39
@@ -80,17 +87,18 @@ The detailed rules per branch are in the decision tree. The skill-level meta-rul
80
87
81
88
## Self-managed vs service-account
82
89
83
-
Orthogonal to the six patterns. Decide based on vendor docs and probe evidence, not assumption (see the "Self-managed vs service-account" section of the decision tree). When in doubt, ask the operator which mode the deployment will use — the answer changes which operations the script must implement and may bring `service-account` parameters (like a separate `FuncUsername`/`FuncPassword`) into scope.
90
+
Orthogonal to the four patterns. Decide based on vendor docs and probe evidence, not assumption (see the "Self-managed vs service-account" section of the decision tree). When in doubt, ask the operator which mode the deployment will use — the answer changes which operations the script must implement and may bring `service-account` parameters (like a separate `FuncUsername`/`FuncPassword`) into scope.
84
91
85
92
## Output
86
93
87
94
The skill emits a short structured recommendation to whichever caller asked, typically `script-authoring` next:
88
95
89
-
-**Recommended pattern** — one of the six.
96
+
-**Recommended pattern** — one of the four.
97
+
-**For `http-api`:** auth shape bucket + specific scheme + one-step vs two-step.
90
98
-**Credential intent** — one of the schema-defined kinds.
91
99
-**Self-managed vs service-account** — pick or "ask operator".
92
100
-**Citations** — the decision-tree row that drove the choice, the vendor-doc record, and the relevant `probeRecord.id`s from the evidence artifact.
93
101
-**Open questions** — anything the agent could not decide with the available evidence. Surface these to the operator before authoring rather than after.
94
102
95
-
When evidence is incomplete, the recommendation is allowed to be conditional ("`http-api-bearer` if vendor confirms the token endpoint at `/oauth/token`; otherwise re-probe and revisit"). A conditional recommendation is preferable to a confident guess.
103
+
When evidence is incomplete, the recommendation is allowed to be conditional ("`http-api` with two-step Bearer if vendor confirms the token endpoint at `/oauth/token`; otherwise re-probe and revisit"). A conditional recommendation is preferable to a confident guess.
Copy file name to clipboardExpand all lines: .agents/skills/target-probing/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ Every probing session produces one evidence artifact, conforming to [`.agents/sc
50
50
51
51
Protocol-specific findings live under `sshFindings` or `httpFindings`. The v0 schema marks the internal shapes of these as TODO and intentionally permissive; this skill is the first consumer to populate them. When the playbooks below settle on a final shape, propose a schema bump as a follow-up — do not silently invent fields the schema rejects.
52
52
53
-
`strategyHints` is optional. Use it sparingly: it signals to `strategy-selection` that probing strongly favours one of the six authoring patterns. The `rationale` must cite a specific `probeRecord.id`, not a generic statement.
53
+
`strategyHints` is optional. Use it sparingly: it signals to `strategy-selection` that probing strongly favours one of the four authoring patterns. The `rationale` must cite a specific `probeRecord.id`, not a generic statement.
Copy file name to clipboardExpand all lines: .agents/skills/task-log-analysis/SKILL.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ Hand the result back to the right skill:
92
92
93
93
-`connect` failures with host-key / SSL mismatches → re-run probes via [`target-probing`](../target-probing/SKILL.md) to capture the new fingerprint, then update the script.
94
94
-`connect` / `auth` failures with credential issues → confirm the seed credential with the operator before any further appliance call. Do not retry blindly (credential lockout risk; the probe-safety contract in [`target-probing`](../target-probing/SKILL.md) applies even outside probing).
95
-
-`auth` failures with HTTP 401 after a token exchange → revisit [`script-authoring`](../script-authoring/SKILL.md) for `http-api-bearer` token-handling shape; common cause is reusing a single `RequestObjectName` across token-fetch and operation calls.
95
+
-`auth` failures with HTTP 401 after a token exchange → revisit [`script-authoring`](../script-authoring/SKILL.md) for the `http-api` two-step token-handling shape; common cause is reusing a single `RequestObjectName` across token-fetch and operation calls.
96
96
-`parse` failures → revisit `script-authoring`; cross-reference the failing `Receive`/regex against the analogous sample.
97
97
-`operation` failures (target accepted but state did not change) → revisit [`strategy-selection`](../strategy-selection/SKILL.md). The wrong pattern may have been chosen (e.g., interactive `passwd` over batch SSH succeeds visibly but does not actually rotate).
0 commit comments