Repository navigation
feat(cli): add the outbound webhook sender - #927
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.
🔍 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 4b of #911:
webhook_out::send::drain_pass, one drain pass over the outbox. Nothing calls it yet; the tick wiring and thetole servesender thread follow in separate PRs.Why
This is the piece that signs and sends. It reads a file other processes of the same account can write, so what it may sign is bounded by the loaded config, not by the file. It is split from the store (#926, merged) and from the wiring to keep each PR small for review.
Changes
drain_pass: leases at most one due event per destination undertry_lock(a second drainer does nothing), sends with no lock held, appends the result under a short lock.Retry-Afteron 429/503 raises the wait, capped at 10 min. No retry on another 4xx, a redirect or a refused address.http_<status>,timeout,dns,refused_address,redirect_refused,bad_destination,expired,bad_line). Nothing a receiver says is stored or printed;Debugof a reply and of a leased event hides it.Poster), the key source (Keys) and the clock are injected;NetPosteristole_core::web::vetted_post.Testing
u32::MAX, adjacency of the result and terminal lines, a send that could outlive its lease is not started, no secret or URL in the outbox or a settled row, and the retry and classification tables.cargo test -p tole-clipasses, clippy clean, layering test passes.