Repository navigation
feat(cli): add tole webhook test to check a destination end to end - #931
Merged
Merged
Conversation
Part 4b of #911. webhook_out::send::drain_pass leases one due event per destination through the store, sends with no lock held, and appends the result under a short lock. Before every send the line is re-validated against the destination of the loaded config and signed with the key that destination names, so a forged line cannot choose a destination, an event type or a key, and the key is not read for a line that fails validation. A result line and its terminal line are one write, and a send must end inside its lease. Retry and no-retry follow the design; result codes are a closed set and no receiver text is stored or printed. The network, the key source and the clock are injected. Nothing calls it yet.
… standalone tick Part 4c of #911. A webhook:<name> target is now delivered. The tick (and an approval-resumed run, which goes through the same path) only appends the redacted cron_run_finished event to the outbox; the sender writes the ledger delivery row when the event settles. A silent ok run records skipped, a failed run with no output still notifies, and a refusal to queue records failed with a closed code. The standalone tole cron tick and tole cron run send for about 20 s after their jobs. A row is written once per run and destination and only for a run whose job names the destination. The destination URL is redacted like its key. Events of a destination that is no longer configured are never sent and never make a drain wait.
…x text out of logs
… make the backlog test robust
Part 4e of #911. reconcile closes the two gaps a crash leaves: a run that settled but whose event was never queued, and an event that finished without a ledger row. A row of any status counts as terminal, so a silent run is not queued again. A run younger than 10 minutes is left to the live tick. A missing kept output is never read as silent, and the file is read without following a symlink or blocking on a FIFO. A webhook row is written once per run and destination by the live tick too. It runs at the start of tole serve and every 5 minutes, and before the drain of a standalone tick.
🔍 Cora AI Code Review✅ No issues found. Code looks good! Review powered by cora-code · BYOK · MIT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Part 5a of #911:
tole webhook test NAMEsends one signedwebhook_testevent to a destination of the user config and prints what the receiver answered.tole doctorstill makes no network call; this is the explicit one.Why
A gateway operator who has just configured a destination needs to know the URL, the secret and the receiver's signature check work, without waiting for a cron run to fire. Until now the only way to find out was a real run.
Changes
tole webhook test NAME: the destination is a name from[webhook_out.NAME]; there is no flag for a URL, a header or a secret, so it cannot be pointed anywhere the owner did not declare. One request, no retry, no outbox, no ledger row. Exits non-zero unless the receiver answered 2xx.webhook_out::probe, built onsign::request_headers), with idtest:<16 hex>so it can be found in the receiver's log,type: "webhook_test"and the destination inside the signed body.timeout,dns,transport,refused_address,redirect_refused,bad_destination): never the URL (which can carry a token), a header, the key or any text the receiver sent. A name typed on the command line is printed as printable ASCII only.Event::WebhookTestis not inEvent::ALL: it cannot be listed inevents, and a forged outbox line cannot name it (the sender's validation does not recognise it).probetakes aPosterandKeys), as in the sender. CHANGELOG entry.Testing
probe(signature over exactly the sent bytes, ids unique per nonce, the closed result table, an unknown destination or a missing key sends nothing, not a configurable event, nothing secret in the body or the outcome) and 2 for the printed report.cargo test -p tole-clipasses, clippy clean, layering test passes (webhook_cmdis registered as a face module).