hookstride-cli 0.3.2__tar.gz → 0.3.3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of hookstride-cli might be problematic. Click here for more details.
- hookstride_cli-0.3.2/README.md → hookstride_cli-0.3.3/PKG-INFO +51 -48
- hookstride_cli-0.3.2/PKG-INFO → hookstride_cli-0.3.3/README.md +34 -61
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/pyproject.toml +11 -2
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/src/hookstride_cli/__init__.py +1 -1
- hookstride_cli-0.3.2/scripts/check.sh +0 -25
- hookstride_cli-0.3.2/tests/test_actions.py +0 -157
- hookstride_cli-0.3.2/tests/test_cli.py +0 -547
- hookstride_cli-0.3.2/tests/test_console.py +0 -600
- hookstride_cli-0.3.2/tests/test_event_send.py +0 -174
- hookstride_cli-0.3.2/tests/test_listen.py +0 -350
- hookstride_cli-0.3.2/tests/test_metrics.py +0 -167
- hookstride_cli-0.3.2/tests/test_mutations.py +0 -186
- hookstride_cli-0.3.2/uv.lock +0 -323
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/.gitignore +0 -0
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/src/hookstride_cli/console.py +0 -0
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/src/hookstride_cli/listen.py +0 -0
- {hookstride_cli-0.3.2 → hookstride_cli-0.3.3}/src/hookstride_cli/main.py +0 -0
|
@@ -1,11 +1,33 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: hookstride-cli
|
|
3
|
+
Version: 0.3.3
|
|
4
|
+
Summary: Manage webhook delivery, monitor events, and automate Hookstride workflows from your terminal.
|
|
5
|
+
Project-URL: Homepage, https://hookstride.com
|
|
6
|
+
Project-URL: Documentation, https://hookstride.com/docs
|
|
7
|
+
Project-URL: Support, https://hookstride.com/support
|
|
8
|
+
Project-URL: Service status, https://status.hookstride.com
|
|
9
|
+
License: Proprietary
|
|
10
|
+
Requires-Python: >=3.11
|
|
11
|
+
Requires-Dist: click<9,>=8.1
|
|
12
|
+
Requires-Dist: httpx<1,>=0.28
|
|
13
|
+
Requires-Dist: prompt-toolkit<4,>=3.0.52
|
|
14
|
+
Requires-Dist: rich<15,>=14
|
|
15
|
+
Requires-Dist: typer<1,>=0.20
|
|
16
|
+
Description-Content-Type: text/markdown
|
|
17
|
+
|
|
1
18
|
# Hookstride CLI
|
|
2
19
|
|
|
3
|
-
Hookstride CLI
|
|
20
|
+
Hookstride CLI is the command-line interface for [Hookstride](https://hookstride.com), a hosted webhook delivery and routing platform. Manage projects and destinations, inspect delivery activity, and automate supported workflows from your terminal.
|
|
4
21
|
|
|
5
|
-
|
|
22
|
+
- **Deliver:** send signed events, monitor delivery results, and replay eligible events.
|
|
23
|
+
- **Manage:** configure projects, destinations, incoming connections, team access, and alerts through authorized commands.
|
|
24
|
+
- **Observe:** inspect delivery attempts, queue health, pipeline readiness, and redacted JSON exports.
|
|
25
|
+
- **Develop:** preview verified incoming webhooks on a local HTTP receiver where local forwarding is enabled.
|
|
26
|
+
- **Automate:** use structured JSON output and explicit confirmation for supported actions.
|
|
6
27
|
|
|
7
|
-
|
|
28
|
+
Feature availability depends on your account permissions and the connected API. Local forwarding is a restricted preview, not a generally available production feature.
|
|
8
29
|
|
|
30
|
+
## Installation
|
|
9
31
|
|
|
10
32
|
Requires Python 3.11 or later.
|
|
11
33
|
|
|
@@ -112,17 +134,17 @@ The command securely prompts for a project delivery API key (`whrk_`). It cannot
|
|
|
112
134
|
Control API token (`whrctl_`); these credentials have different permissions.
|
|
113
135
|
|
|
114
136
|
```bash
|
|
115
|
-
hookstride --env
|
|
116
|
-
hookstride --env
|
|
117
|
-
hookstride --env
|
|
137
|
+
hookstride --env dev projects use PROJECT_UUID
|
|
138
|
+
hookstride --env dev events send DESTINATION_UUID --wait
|
|
139
|
+
hookstride --env dev events show EVENT_UUID
|
|
118
140
|
```
|
|
119
141
|
|
|
120
|
-
The event type
|
|
142
|
+
Use a dedicated test destination that you control. The default event type is `webhook.test`, with the following JSON payload:
|
|
121
143
|
`{"message":"Hookstride CLI delivery test","source":"cli"}`.
|
|
122
144
|
To send a different JSON object without placing its contents in shell history:
|
|
123
145
|
|
|
124
146
|
```bash
|
|
125
|
-
hookstride --env
|
|
147
|
+
hookstride --env dev events send DESTINATION_UUID --type demo.delivery --payload-file ./demo-payload.json --wait
|
|
126
148
|
```
|
|
127
149
|
|
|
128
150
|
To avoid the hidden prompt, set `HOOKSTRIDE_PRODUCTION_API_KEY` or
|
|
@@ -135,7 +157,6 @@ A non-delivered event can be examined using `events show` with the usual Control
|
|
|
135
157
|
## Environments and local settings
|
|
136
158
|
|
|
137
159
|
The CLI connects to the production API by default: `https://api.hookstride.com`.
|
|
138
|
-
A new release must be published to PyPI before existing installations receive this change.
|
|
139
160
|
|
|
140
161
|
To inspect the development API explicitly, select it:
|
|
141
162
|
|
|
@@ -149,21 +170,23 @@ Project selections are stored separately by environment in `~/.config/hookstride
|
|
|
149
170
|
|
|
150
171
|
## Documentation
|
|
151
172
|
|
|
152
|
-
|
|
173
|
+
- [Website](https://hookstride.com)
|
|
174
|
+
- [Documentation](https://hookstride.com/docs)
|
|
175
|
+
- [Service status](https://status.hookstride.com)
|
|
176
|
+
- [Support](https://hookstride.com/support)
|
|
153
177
|
|
|
154
178
|
## Capability boundaries
|
|
155
179
|
|
|
156
180
|
The CLI supports project/destination creation and updates, event submission and
|
|
157
181
|
inspection, incoming configuration inspection, billing history and statistics.
|
|
158
|
-
|
|
159
|
-
alert actions. Use the dashboard for CSV exports, purchasing, credential
|
|
182
|
+
JSON exports and confirmed configuration, replay, team and alert actions are also supported. Use the dashboard for CSV exports, purchasing, credential
|
|
160
183
|
management, MFA/ownership controls and Support tickets. Billing output
|
|
161
184
|
preserves the actual recorded currency; it does not
|
|
162
185
|
convert historical payments into display estimates. `status` checks API and
|
|
163
|
-
dependency readiness.
|
|
186
|
+
dependency readiness. Use `status --pipeline` for the
|
|
164
187
|
worker-readiness check. Neither mode proves signed delivery or historical uptime.
|
|
165
188
|
|
|
166
|
-
### Delivery metrics
|
|
189
|
+
### Delivery metrics
|
|
167
190
|
|
|
168
191
|
Inspect the dashboard's queue-health measurements:
|
|
169
192
|
|
|
@@ -177,10 +200,9 @@ waiting events; the current queue includes all accepted dates. `stats` retains
|
|
|
177
200
|
its existing lifetime response and labels its denominator as delivered/all,
|
|
178
201
|
including pending events. Neither command measures service uptime or quota usage.
|
|
179
202
|
The interactive console supports `metrics --days 7` and `show metrics` too.
|
|
180
|
-
This command
|
|
181
|
-
endpoint. Select `--env dev` when using a separate development project/token.
|
|
203
|
+
This command requires API support for delivery metrics. Select `--env dev` when using a separate development project/token.
|
|
182
204
|
|
|
183
|
-
### JSON event export
|
|
205
|
+
### JSON event export
|
|
184
206
|
|
|
185
207
|
```bash
|
|
186
208
|
hookstride --project PROJECT_UUID --json events export --status failed > ./failed-events.json
|
|
@@ -191,10 +213,9 @@ recorded attempts. JSON is limited to 200 matching events; the response retains
|
|
|
191
213
|
`truncated` and `limit`, and the CLI reports truncation on stderr. Narrow status,
|
|
192
214
|
`--origin` or `--type` filters when needed. CSV remains available in the dashboard.
|
|
193
215
|
|
|
194
|
-
## Confirmed actions
|
|
216
|
+
## Confirmed actions
|
|
195
217
|
|
|
196
|
-
The CLI
|
|
197
|
-
without making AI calls. Inspect what this backend permits:
|
|
218
|
+
The CLI supports role-scoped actions with an explicit preview and confirmation flow. Inspect what this backend permits:
|
|
198
219
|
|
|
199
220
|
```bash
|
|
200
221
|
hookstride --project PROJECT_UUID actions list
|
|
@@ -250,28 +271,14 @@ commands containing them are never retained in console history. Resource
|
|
|
250
271
|
creation can return a one-time signing secret outside chat: save it privately
|
|
251
272
|
and do not pipe creation output into logs or public artifacts.
|
|
252
273
|
|
|
253
|
-
##
|
|
254
|
-
|
|
255
|
-
Version 0.3.2 includes the opt-in listener from issue #163. **The server feature
|
|
256
|
-
remains disabled by default; inclusion of the command does not enable it in
|
|
257
|
-
production.** Use a separately configured development backend for verification.
|
|
258
|
-
Older installations must be upgraded to receive the command.
|
|
259
|
-
|
|
260
|
-
The backend requires the new ingress migration and both
|
|
261
|
-
`WEBHOOK_INGRESS_ENABLED=1` and `WEBHOOK_LOCAL_FORWARDING_ENABLED=1`. Local
|
|
262
|
-
forwarding is disabled by default. Enable it only after reviewing this change;
|
|
263
|
-
do not change production ingress/egress security gates to test it. An operator
|
|
264
|
-
must schedule `python manage.py prune_local_sessions` regularly (for example,
|
|
265
|
-
every minute); it removes at most 500 expired, revoked or idle sessions per run.
|
|
266
|
-
It does not delete incoming events, destinations, or billing records.
|
|
274
|
+
## Local webhook forwarding (restricted preview)
|
|
267
275
|
|
|
268
|
-
|
|
276
|
+
Forward newly verified incoming webhooks to a local development receiver. This feature requires a compatible API with local forwarding enabled for your environment. Installing the CLI does not grant access to the preview. Use an authorized development project and a dedicated test source.
|
|
269
277
|
|
|
270
278
|
```bash
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
uv run --project cli hookstride --env dev incoming sources
|
|
279
|
+
hookstride --env dev projects list
|
|
280
|
+
hookstride --env dev projects use PROJECT_UUID
|
|
281
|
+
hookstride --env dev incoming sources
|
|
275
282
|
```
|
|
276
283
|
|
|
277
284
|
Use an MFA-verified Control API token where the account role requires MFA, as
|
|
@@ -287,7 +294,7 @@ source if its payloads must not be copied to a development machine.
|
|
|
287
294
|
Start your local HTTP receiver on **127.0.0.1**, then run:
|
|
288
295
|
|
|
289
296
|
```bash
|
|
290
|
-
hookstride listen 8000 --path /webhooks
|
|
297
|
+
hookstride --env dev listen 8000 --path /webhooks
|
|
291
298
|
```
|
|
292
299
|
|
|
293
300
|
The project must have been explicitly selected already. An interactive terminal
|
|
@@ -298,7 +305,6 @@ source. For scripts or the interactive console, supply it explicitly:
|
|
|
298
305
|
hookstride --env dev --project PROJECT_UUID listen 8000 --path /webhooks --source SOURCE_UUID
|
|
299
306
|
```
|
|
300
307
|
|
|
301
|
-
For source-checkout testing, prefix these examples with `uv run --project cli`.
|
|
302
308
|
A custom development API may be selected with the existing global `--api-url`;
|
|
303
309
|
remote origins require HTTPS. The local receiver URL is always
|
|
304
310
|
`http://127.0.0.1:8000/webhooks`. Paths cannot select a different host, include
|
|
@@ -306,7 +312,7 @@ queries/fragments or contain traversal. Proxy environment variables are ignored
|
|
|
306
312
|
for the receiver, redirects are never followed, receiver requests time out after
|
|
307
313
|
five seconds, and receiver response bodies are never read or printed.
|
|
308
314
|
|
|
309
|
-
The
|
|
315
|
+
The listener shows connection/reconnection state, stable event IDs, attempts,
|
|
310
316
|
forwarding results and bounded failure messages. It never prints provider
|
|
311
317
|
credentials, management tokens, request payloads, or receiver response bodies.
|
|
312
318
|
Listener commands/paths are not added to console command history. `--json` is
|
|
@@ -351,7 +357,7 @@ receivers must atomically deduplicate by envelope `id` before applying side
|
|
|
351
357
|
effects. Do not claim exactly-once behavior.
|
|
352
358
|
|
|
353
359
|
Poll requests return immediately with up to five events; empty results are
|
|
354
|
-
paced client-side every two seconds
|
|
360
|
+
paced client-side every two seconds to avoid unnecessary requests. The
|
|
355
361
|
CLI reconnects with capped backoff. A session lasts at most one hour (`--ttl 60` through
|
|
356
362
|
`--ttl 3600`), and expires after two idle minutes. The same creating Control token
|
|
357
363
|
is checked on every API request, and every poll rechecks token/MFA, membership,
|
|
@@ -385,8 +391,7 @@ subscribes only to future events.
|
|
|
385
391
|
events during the gap will not be replayed.
|
|
386
392
|
- HTTP 401/403: check the environment's Control token, revocation/expiry, MFA and
|
|
387
393
|
developer membership. Delivery API keys cannot create or read sessions.
|
|
388
|
-
- HTTP 404: check project/source selection and the
|
|
389
|
-
migration. HTTP 410 means the temporary session stopped or expired.
|
|
394
|
+
- HTTP 404: check project/source selection and whether local forwarding is available in your environment. HTTP 410 means the temporary session stopped or expired.
|
|
390
395
|
- Queue full or retry-limit feedback: fix the receiver, then start a new session.
|
|
391
396
|
Unforwarded events from the old session are not moved into a new one.
|
|
392
397
|
- Local connection errors: bind the receiver to `127.0.0.1`, confirm the port and
|
|
@@ -394,6 +399,4 @@ subscribes only to future events.
|
|
|
394
399
|
are failures. Check your receiver's own development logs; Hookstride does not
|
|
395
400
|
display its response content.
|
|
396
401
|
|
|
397
|
-
|
|
398
|
-
release gates. Do not send synthetic provider events to production/customer
|
|
399
|
-
sources or destinations to verify this preview.
|
|
402
|
+
Use only dedicated development sources and receivers for testing. Do not send synthetic provider events to production or customer integrations.
|
|
@@ -1,24 +1,16 @@
|
|
|
1
|
-
Metadata-Version: 2.5
|
|
2
|
-
Name: hookstride-cli
|
|
3
|
-
Version: 0.3.2
|
|
4
|
-
Summary: Manage Hookstride projects and destinations, inspect webhook activity and billing.
|
|
5
|
-
License: Proprietary
|
|
6
|
-
Requires-Python: >=3.11
|
|
7
|
-
Requires-Dist: click<9,>=8.1
|
|
8
|
-
Requires-Dist: httpx<1,>=0.28
|
|
9
|
-
Requires-Dist: prompt-toolkit<4,>=3.0.52
|
|
10
|
-
Requires-Dist: rich<15,>=14
|
|
11
|
-
Requires-Dist: typer<1,>=0.20
|
|
12
|
-
Description-Content-Type: text/markdown
|
|
13
|
-
|
|
14
1
|
# Hookstride CLI
|
|
15
2
|
|
|
16
|
-
Hookstride CLI
|
|
3
|
+
Hookstride CLI is the command-line interface for [Hookstride](https://hookstride.com), a hosted webhook delivery and routing platform. Manage projects and destinations, inspect delivery activity, and automate supported workflows from your terminal.
|
|
17
4
|
|
|
18
|
-
|
|
5
|
+
- **Deliver:** send signed events, monitor delivery results, and replay eligible events.
|
|
6
|
+
- **Manage:** configure projects, destinations, incoming connections, team access, and alerts through authorized commands.
|
|
7
|
+
- **Observe:** inspect delivery attempts, queue health, pipeline readiness, and redacted JSON exports.
|
|
8
|
+
- **Develop:** preview verified incoming webhooks on a local HTTP receiver where local forwarding is enabled.
|
|
9
|
+
- **Automate:** use structured JSON output and explicit confirmation for supported actions.
|
|
19
10
|
|
|
20
|
-
|
|
11
|
+
Feature availability depends on your account permissions and the connected API. Local forwarding is a restricted preview, not a generally available production feature.
|
|
21
12
|
|
|
13
|
+
## Installation
|
|
22
14
|
|
|
23
15
|
Requires Python 3.11 or later.
|
|
24
16
|
|
|
@@ -125,17 +117,17 @@ The command securely prompts for a project delivery API key (`whrk_`). It cannot
|
|
|
125
117
|
Control API token (`whrctl_`); these credentials have different permissions.
|
|
126
118
|
|
|
127
119
|
```bash
|
|
128
|
-
hookstride --env
|
|
129
|
-
hookstride --env
|
|
130
|
-
hookstride --env
|
|
120
|
+
hookstride --env dev projects use PROJECT_UUID
|
|
121
|
+
hookstride --env dev events send DESTINATION_UUID --wait
|
|
122
|
+
hookstride --env dev events show EVENT_UUID
|
|
131
123
|
```
|
|
132
124
|
|
|
133
|
-
The event type
|
|
125
|
+
Use a dedicated test destination that you control. The default event type is `webhook.test`, with the following JSON payload:
|
|
134
126
|
`{"message":"Hookstride CLI delivery test","source":"cli"}`.
|
|
135
127
|
To send a different JSON object without placing its contents in shell history:
|
|
136
128
|
|
|
137
129
|
```bash
|
|
138
|
-
hookstride --env
|
|
130
|
+
hookstride --env dev events send DESTINATION_UUID --type demo.delivery --payload-file ./demo-payload.json --wait
|
|
139
131
|
```
|
|
140
132
|
|
|
141
133
|
To avoid the hidden prompt, set `HOOKSTRIDE_PRODUCTION_API_KEY` or
|
|
@@ -148,7 +140,6 @@ A non-delivered event can be examined using `events show` with the usual Control
|
|
|
148
140
|
## Environments and local settings
|
|
149
141
|
|
|
150
142
|
The CLI connects to the production API by default: `https://api.hookstride.com`.
|
|
151
|
-
A new release must be published to PyPI before existing installations receive this change.
|
|
152
143
|
|
|
153
144
|
To inspect the development API explicitly, select it:
|
|
154
145
|
|
|
@@ -162,21 +153,23 @@ Project selections are stored separately by environment in `~/.config/hookstride
|
|
|
162
153
|
|
|
163
154
|
## Documentation
|
|
164
155
|
|
|
165
|
-
|
|
156
|
+
- [Website](https://hookstride.com)
|
|
157
|
+
- [Documentation](https://hookstride.com/docs)
|
|
158
|
+
- [Service status](https://status.hookstride.com)
|
|
159
|
+
- [Support](https://hookstride.com/support)
|
|
166
160
|
|
|
167
161
|
## Capability boundaries
|
|
168
162
|
|
|
169
163
|
The CLI supports project/destination creation and updates, event submission and
|
|
170
164
|
inspection, incoming configuration inspection, billing history and statistics.
|
|
171
|
-
|
|
172
|
-
alert actions. Use the dashboard for CSV exports, purchasing, credential
|
|
165
|
+
JSON exports and confirmed configuration, replay, team and alert actions are also supported. Use the dashboard for CSV exports, purchasing, credential
|
|
173
166
|
management, MFA/ownership controls and Support tickets. Billing output
|
|
174
167
|
preserves the actual recorded currency; it does not
|
|
175
168
|
convert historical payments into display estimates. `status` checks API and
|
|
176
|
-
dependency readiness.
|
|
169
|
+
dependency readiness. Use `status --pipeline` for the
|
|
177
170
|
worker-readiness check. Neither mode proves signed delivery or historical uptime.
|
|
178
171
|
|
|
179
|
-
### Delivery metrics
|
|
172
|
+
### Delivery metrics
|
|
180
173
|
|
|
181
174
|
Inspect the dashboard's queue-health measurements:
|
|
182
175
|
|
|
@@ -190,10 +183,9 @@ waiting events; the current queue includes all accepted dates. `stats` retains
|
|
|
190
183
|
its existing lifetime response and labels its denominator as delivered/all,
|
|
191
184
|
including pending events. Neither command measures service uptime or quota usage.
|
|
192
185
|
The interactive console supports `metrics --days 7` and `show metrics` too.
|
|
193
|
-
This command
|
|
194
|
-
endpoint. Select `--env dev` when using a separate development project/token.
|
|
186
|
+
This command requires API support for delivery metrics. Select `--env dev` when using a separate development project/token.
|
|
195
187
|
|
|
196
|
-
### JSON event export
|
|
188
|
+
### JSON event export
|
|
197
189
|
|
|
198
190
|
```bash
|
|
199
191
|
hookstride --project PROJECT_UUID --json events export --status failed > ./failed-events.json
|
|
@@ -204,10 +196,9 @@ recorded attempts. JSON is limited to 200 matching events; the response retains
|
|
|
204
196
|
`truncated` and `limit`, and the CLI reports truncation on stderr. Narrow status,
|
|
205
197
|
`--origin` or `--type` filters when needed. CSV remains available in the dashboard.
|
|
206
198
|
|
|
207
|
-
## Confirmed actions
|
|
199
|
+
## Confirmed actions
|
|
208
200
|
|
|
209
|
-
The CLI
|
|
210
|
-
without making AI calls. Inspect what this backend permits:
|
|
201
|
+
The CLI supports role-scoped actions with an explicit preview and confirmation flow. Inspect what this backend permits:
|
|
211
202
|
|
|
212
203
|
```bash
|
|
213
204
|
hookstride --project PROJECT_UUID actions list
|
|
@@ -263,28 +254,14 @@ commands containing them are never retained in console history. Resource
|
|
|
263
254
|
creation can return a one-time signing secret outside chat: save it privately
|
|
264
255
|
and do not pipe creation output into logs or public artifacts.
|
|
265
256
|
|
|
266
|
-
##
|
|
267
|
-
|
|
268
|
-
Version 0.3.2 includes the opt-in listener from issue #163. **The server feature
|
|
269
|
-
remains disabled by default; inclusion of the command does not enable it in
|
|
270
|
-
production.** Use a separately configured development backend for verification.
|
|
271
|
-
Older installations must be upgraded to receive the command.
|
|
272
|
-
|
|
273
|
-
The backend requires the new ingress migration and both
|
|
274
|
-
`WEBHOOK_INGRESS_ENABLED=1` and `WEBHOOK_LOCAL_FORWARDING_ENABLED=1`. Local
|
|
275
|
-
forwarding is disabled by default. Enable it only after reviewing this change;
|
|
276
|
-
do not change production ingress/egress security gates to test it. An operator
|
|
277
|
-
must schedule `python manage.py prune_local_sessions` regularly (for example,
|
|
278
|
-
every minute); it removes at most 500 expired, revoked or idle sessions per run.
|
|
279
|
-
It does not delete incoming events, destinations, or billing records.
|
|
257
|
+
## Local webhook forwarding (restricted preview)
|
|
280
258
|
|
|
281
|
-
|
|
259
|
+
Forward newly verified incoming webhooks to a local development receiver. This feature requires a compatible API with local forwarding enabled for your environment. Installing the CLI does not grant access to the preview. Use an authorized development project and a dedicated test source.
|
|
282
260
|
|
|
283
261
|
```bash
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
uv run --project cli hookstride --env dev incoming sources
|
|
262
|
+
hookstride --env dev projects list
|
|
263
|
+
hookstride --env dev projects use PROJECT_UUID
|
|
264
|
+
hookstride --env dev incoming sources
|
|
288
265
|
```
|
|
289
266
|
|
|
290
267
|
Use an MFA-verified Control API token where the account role requires MFA, as
|
|
@@ -300,7 +277,7 @@ source if its payloads must not be copied to a development machine.
|
|
|
300
277
|
Start your local HTTP receiver on **127.0.0.1**, then run:
|
|
301
278
|
|
|
302
279
|
```bash
|
|
303
|
-
hookstride listen 8000 --path /webhooks
|
|
280
|
+
hookstride --env dev listen 8000 --path /webhooks
|
|
304
281
|
```
|
|
305
282
|
|
|
306
283
|
The project must have been explicitly selected already. An interactive terminal
|
|
@@ -311,7 +288,6 @@ source. For scripts or the interactive console, supply it explicitly:
|
|
|
311
288
|
hookstride --env dev --project PROJECT_UUID listen 8000 --path /webhooks --source SOURCE_UUID
|
|
312
289
|
```
|
|
313
290
|
|
|
314
|
-
For source-checkout testing, prefix these examples with `uv run --project cli`.
|
|
315
291
|
A custom development API may be selected with the existing global `--api-url`;
|
|
316
292
|
remote origins require HTTPS. The local receiver URL is always
|
|
317
293
|
`http://127.0.0.1:8000/webhooks`. Paths cannot select a different host, include
|
|
@@ -319,7 +295,7 @@ queries/fragments or contain traversal. Proxy environment variables are ignored
|
|
|
319
295
|
for the receiver, redirects are never followed, receiver requests time out after
|
|
320
296
|
five seconds, and receiver response bodies are never read or printed.
|
|
321
297
|
|
|
322
|
-
The
|
|
298
|
+
The listener shows connection/reconnection state, stable event IDs, attempts,
|
|
323
299
|
forwarding results and bounded failure messages. It never prints provider
|
|
324
300
|
credentials, management tokens, request payloads, or receiver response bodies.
|
|
325
301
|
Listener commands/paths are not added to console command history. `--json` is
|
|
@@ -364,7 +340,7 @@ receivers must atomically deduplicate by envelope `id` before applying side
|
|
|
364
340
|
effects. Do not claim exactly-once behavior.
|
|
365
341
|
|
|
366
342
|
Poll requests return immediately with up to five events; empty results are
|
|
367
|
-
paced client-side every two seconds
|
|
343
|
+
paced client-side every two seconds to avoid unnecessary requests. The
|
|
368
344
|
CLI reconnects with capped backoff. A session lasts at most one hour (`--ttl 60` through
|
|
369
345
|
`--ttl 3600`), and expires after two idle minutes. The same creating Control token
|
|
370
346
|
is checked on every API request, and every poll rechecks token/MFA, membership,
|
|
@@ -398,8 +374,7 @@ subscribes only to future events.
|
|
|
398
374
|
events during the gap will not be replayed.
|
|
399
375
|
- HTTP 401/403: check the environment's Control token, revocation/expiry, MFA and
|
|
400
376
|
developer membership. Delivery API keys cannot create or read sessions.
|
|
401
|
-
- HTTP 404: check project/source selection and the
|
|
402
|
-
migration. HTTP 410 means the temporary session stopped or expired.
|
|
377
|
+
- HTTP 404: check project/source selection and whether local forwarding is available in your environment. HTTP 410 means the temporary session stopped or expired.
|
|
403
378
|
- Queue full or retry-limit feedback: fix the receiver, then start a new session.
|
|
404
379
|
Unforwarded events from the old session are not moved into a new one.
|
|
405
380
|
- Local connection errors: bind the receiver to `127.0.0.1`, confirm the port and
|
|
@@ -407,6 +382,4 @@ subscribes only to future events.
|
|
|
407
382
|
are failures. Check your receiver's own development logs; Hookstride does not
|
|
408
383
|
display its response content.
|
|
409
384
|
|
|
410
|
-
|
|
411
|
-
release gates. Do not send synthetic provider events to production/customer
|
|
412
|
-
sources or destinations to verify this preview.
|
|
385
|
+
Use only dedicated development sources and receivers for testing. Do not send synthetic provider events to production or customer integrations.
|
|
@@ -4,8 +4,8 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "hookstride-cli"
|
|
7
|
-
version = "0.3.
|
|
8
|
-
description = "Manage
|
|
7
|
+
version = "0.3.3"
|
|
8
|
+
description = "Manage webhook delivery, monitor events, and automate Hookstride workflows from your terminal."
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.11"
|
|
11
11
|
license = { text = "Proprietary" }
|
|
@@ -17,6 +17,12 @@ dependencies = [
|
|
|
17
17
|
"typer>=0.20,<1",
|
|
18
18
|
]
|
|
19
19
|
|
|
20
|
+
[project.urls]
|
|
21
|
+
Homepage = "https://hookstride.com"
|
|
22
|
+
Documentation = "https://hookstride.com/docs"
|
|
23
|
+
Support = "https://hookstride.com/support"
|
|
24
|
+
"Service status" = "https://status.hookstride.com"
|
|
25
|
+
|
|
20
26
|
[project.scripts]
|
|
21
27
|
hookstride = "hookstride_cli.main:main"
|
|
22
28
|
|
|
@@ -26,6 +32,9 @@ dev = [
|
|
|
26
32
|
"ruff>=0.12,<1",
|
|
27
33
|
]
|
|
28
34
|
|
|
35
|
+
[tool.hatch.build.targets.sdist]
|
|
36
|
+
include = ["/README.md", "/pyproject.toml", "/src/hookstride_cli"]
|
|
37
|
+
|
|
29
38
|
[tool.hatch.build.targets.wheel]
|
|
30
39
|
packages = ["src/hookstride_cli"]
|
|
31
40
|
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env bash
|
|
2
|
-
# Local CLI validation, independent of GitHub Actions runner availability.
|
|
3
|
-
set -euo pipefail
|
|
4
|
-
|
|
5
|
-
cd "$(dirname "${BASH_SOURCE[0]}")/../.."
|
|
6
|
-
|
|
7
|
-
echo "[1/5] Install/sync isolated CLI test dependencies"
|
|
8
|
-
uv sync --project cli --group dev
|
|
9
|
-
|
|
10
|
-
echo "[2/5] Static Python syntax check"
|
|
11
|
-
uv run --project cli python -m compileall -q cli/src cli/tests
|
|
12
|
-
|
|
13
|
-
echo "[3/5] Lint"
|
|
14
|
-
uv run --project cli ruff check cli/src cli/tests
|
|
15
|
-
|
|
16
|
-
echo "[4/5] Offline, mock-network tests (no live tokens)"
|
|
17
|
-
uv run --project cli pytest -c cli/pyproject.toml -q cli/tests
|
|
18
|
-
|
|
19
|
-
echo "[5/5] Command smoke tests"
|
|
20
|
-
uv run --project cli hookstride --version
|
|
21
|
-
uv run --project cli hookstride --help >/dev/null
|
|
22
|
-
uv run --project cli hookstride console --help >/dev/null
|
|
23
|
-
uv run --project cli hookstride --json config show
|
|
24
|
-
|
|
25
|
-
echo "CLI checks passed. No live account or payment data was modified."
|
|
@@ -1,157 +0,0 @@
|
|
|
1
|
-
"""Confirmation protocol tests for the terminal adapter; no live account requests."""
|
|
2
|
-
|
|
3
|
-
import json
|
|
4
|
-
|
|
5
|
-
from typer.testing import CliRunner
|
|
6
|
-
|
|
7
|
-
from hookstride_cli import console
|
|
8
|
-
from hookstride_cli import main as cli
|
|
9
|
-
|
|
10
|
-
runner = CliRunner()
|
|
11
|
-
PROJECT = "11111111-1111-4111-8111-111111111111"
|
|
12
|
-
APPROVAL = "22222222-2222-4222-8222-222222222222"
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
def setup(monkeypatch, tmp_path):
|
|
16
|
-
source = tmp_path / "action.json"
|
|
17
|
-
source.write_text(json.dumps({"destination_id": PROJECT}))
|
|
18
|
-
monkeypatch.setenv("HOOKSTRIDE_CONFIG_FILE", str(tmp_path / "settings.json"))
|
|
19
|
-
calls = []
|
|
20
|
-
|
|
21
|
-
def request(_session, path, **kwargs):
|
|
22
|
-
calls.append((path, kwargs))
|
|
23
|
-
if path.endswith("/preview/"):
|
|
24
|
-
return {"approval_id": APPROVAL, "preview": {"event_units": 1, "effect": "Send a test"}}
|
|
25
|
-
return {"success": True, "result": {"id": PROJECT, "status": "pending"}}
|
|
26
|
-
|
|
27
|
-
monkeypatch.setattr(cli, "_request", request)
|
|
28
|
-
return source, calls
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
def test_actions_apply_previews_then_confirms_exact_body_once(monkeypatch, tmp_path):
|
|
32
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
33
|
-
result = runner.invoke(
|
|
34
|
-
cli.app,
|
|
35
|
-
[
|
|
36
|
-
"--project",
|
|
37
|
-
PROJECT,
|
|
38
|
-
"--json",
|
|
39
|
-
"actions",
|
|
40
|
-
"apply",
|
|
41
|
-
"event.test",
|
|
42
|
-
"--input-file",
|
|
43
|
-
str(source),
|
|
44
|
-
"--confirm",
|
|
45
|
-
],
|
|
46
|
-
)
|
|
47
|
-
assert result.exit_code == 0, result.output
|
|
48
|
-
assert json.loads(result.stdout)["status"] == "pending"
|
|
49
|
-
assert [p for p, _ in calls] == [
|
|
50
|
-
"/control/v1/support/project-actions/preview/",
|
|
51
|
-
"/control/v1/support/project-actions/confirm/",
|
|
52
|
-
]
|
|
53
|
-
body = calls[0][1]["json_body"]
|
|
54
|
-
assert body["project_id"] == PROJECT
|
|
55
|
-
assert calls[1][1]["json_body"] == {**body, "approval_id": APPROVAL}
|
|
56
|
-
assert calls[0][1]["method"] == calls[1][1]["method"] == "POST"
|
|
57
|
-
assert not (tmp_path / "settings.json").exists()
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
def test_json_without_explicit_confirmation_performs_no_action(monkeypatch, tmp_path):
|
|
61
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
62
|
-
result = runner.invoke(
|
|
63
|
-
cli.app,
|
|
64
|
-
[
|
|
65
|
-
"--project",
|
|
66
|
-
PROJECT,
|
|
67
|
-
"--json",
|
|
68
|
-
"actions",
|
|
69
|
-
"apply",
|
|
70
|
-
"event.test",
|
|
71
|
-
"--input-file",
|
|
72
|
-
str(source),
|
|
73
|
-
],
|
|
74
|
-
)
|
|
75
|
-
assert result.exit_code != 0
|
|
76
|
-
assert len(calls) == 1 and calls[0][0].endswith("/preview/")
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
def test_declined_prompt_and_preview_only_never_confirm(monkeypatch, tmp_path):
|
|
80
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
81
|
-
args = ["--project", PROJECT, "actions"]
|
|
82
|
-
assert (
|
|
83
|
-
runner.invoke(
|
|
84
|
-
cli.app, [*args, "preview", "event.test", "--input-file", str(source)]
|
|
85
|
-
).exit_code
|
|
86
|
-
== 0
|
|
87
|
-
)
|
|
88
|
-
result = runner.invoke(
|
|
89
|
-
cli.app, [*args, "apply", "event.test", "--input-file", str(source)], input="n\n"
|
|
90
|
-
)
|
|
91
|
-
assert result.exit_code == 0, result.output
|
|
92
|
-
assert "No action performed" in result.stdout
|
|
93
|
-
assert all(path.endswith("/preview/") for path, _ in calls)
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
def test_first_project_creation_has_workspace_payload_without_project_selection(
|
|
97
|
-
monkeypatch, tmp_path
|
|
98
|
-
):
|
|
99
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
100
|
-
source.write_text(json.dumps({"account_id": PROJECT, "name": "First", "slug": "first"}))
|
|
101
|
-
result = runner.invoke(
|
|
102
|
-
cli.app, ["actions", "apply", "project.create", "--input-file", str(source), "--confirm"]
|
|
103
|
-
)
|
|
104
|
-
assert result.exit_code == 0, result.output
|
|
105
|
-
assert calls[0][1]["json_body"]["project_id"] is None
|
|
106
|
-
assert calls[0][1]["json_body"]["payload"]["account_id"] == PROJECT
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
def test_invalid_or_oversized_payload_is_rejected_before_network(monkeypatch, tmp_path):
|
|
110
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
111
|
-
for content in ["[]", '{"a":NaN}', "x" * 10001]:
|
|
112
|
-
source.write_text(content)
|
|
113
|
-
result = runner.invoke(
|
|
114
|
-
cli.app,
|
|
115
|
-
["--project", PROJECT, "actions", "preview", "event.test", "--input-file", str(source)],
|
|
116
|
-
)
|
|
117
|
-
assert result.exit_code != 0
|
|
118
|
-
assert calls == []
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
def test_action_names_cannot_select_arbitrary_api_paths_and_history_stays_private(
|
|
122
|
-
monkeypatch, tmp_path
|
|
123
|
-
):
|
|
124
|
-
source, calls = setup(monkeypatch, tmp_path)
|
|
125
|
-
result = runner.invoke(
|
|
126
|
-
cli.app,
|
|
127
|
-
[
|
|
128
|
-
"--project",
|
|
129
|
-
PROJECT,
|
|
130
|
-
"actions",
|
|
131
|
-
"preview",
|
|
132
|
-
"../../billing/checkout",
|
|
133
|
-
"--input-file",
|
|
134
|
-
str(source),
|
|
135
|
-
],
|
|
136
|
-
)
|
|
137
|
-
assert result.exit_code == 0
|
|
138
|
-
assert calls[0][0] == "/control/v1/support/project-actions/preview/"
|
|
139
|
-
assert console._history_safe("actions list")
|
|
140
|
-
assert not console._history_safe(
|
|
141
|
-
"actions apply event.test --input-file /private/payload.json --confirm"
|
|
142
|
-
)
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
def test_actions_listing_does_not_dump_snapshot_or_key_metadata(monkeypatch):
|
|
146
|
-
monkeypatch.setattr(
|
|
147
|
-
cli,
|
|
148
|
-
"_request",
|
|
149
|
-
lambda *a, **kw: {
|
|
150
|
-
"available_actions": ["event.test"],
|
|
151
|
-
"api_keys": [{"masked_key": "masked-private"}],
|
|
152
|
-
},
|
|
153
|
-
)
|
|
154
|
-
result = runner.invoke(cli.app, ["--project", PROJECT, "--json", "actions", "list"])
|
|
155
|
-
assert result.exit_code == 0
|
|
156
|
-
assert json.loads(result.stdout) == {"actions": ["event.test"]}
|
|
157
|
-
assert "masked-private" not in result.stdout
|