Repository navigation
X: deliver only to webhooks whose challenge was answered - #54
Merged
Merged
Conversation
A webhook address accepted only through control mode's relaxation (http, or a port, on an https instance) is never called: its deliveries are held, listed as held in the arrival's response and on the ledger entry of a DM sent through X's route, and previewable with preview-delivery. Any webhook now gets deliveries only once a challenge has been answered for it, as on X: the CRC at creation or on PUT in outbound mode, or a correct answer at POST /_emulate/x/webhooks/:id/challenge in control mode. Until then, and for a seeded webhook until PUT, deliveries are held. Control mode used to deliver to an https address nobody had answered a challenge from.
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.
Follows #52, which lets control mode accept an
httpwebhook address or one with a port on an https instance./_emulate/x/dm/arrive's response and on the ledger entry of a DM sent through X's route, andpreview-deliverygives the exact signed request. Without this, a public instance could be pointed at any host and port and made to send signed POSTs there.PUT /2/webhooks/:idin outbound mode, or a correct answer atPOST /_emulate/x/webhooks/:id/challengein control mode. Until then they are held, as are a seeded webhook's untilPUT. Control mode used to deliver to an https address nobody had answered a challenge from.The manifest, README, docs page and skill say so.
Tests (
webhooks-media.test.ts): a relaxed address is never called even after its challenge is answered, and its held delivery is on the ledger; control mode holds deliveries until the challenge is answered, then sends them; a seeded webhook is held untilPUTpasses the CRC.