agents: let trigger rotate_secret revoke the outgoing webhook secret (MARSOHS-1078) - #714
Merged
SSharma-10 merged 2 commits intoAug 26, 2026
Conversation
…(MARSOHS-1078) Rotation defaults to a grace window so in-flight deliveries keep verifying while the new secret is pasted into the provider. That is right for routine rotation and wrong for a leaked secret, where the point is to kill the old value now. Add revoke_previous=True to opt into that on both the sync and async clients. Also replaces the "stays valid briefly" docstring, which is the vague wording the ticket was filed about: the response now says which happened, carrying either previous_secret_expires_at or previous_secret_revoked. Co-authored-by: Cursor <cursoragent@cursor.com>
…all by URL Co-authored-by: Cursor <cursoragent@cursor.com>
Author
|
@SSharma-10 review request when you have time — pydo half of MARSOHS-1078 (P1, webhook secret rotation). Touches only the hand-authored triggers modules: I can't add reviewers on this repo, so mentioning instead. |
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.
Summary
triggers.rotate_secret()can only ask for the default rotation, and its docstring says the old secret "stays valid briefly" — which is exactly the unactionable wording MARSOHS-1078 was filed about. Someone responding to a leaked secret can neither kill the old value nor tell from the response whether it is already dead.This adds
revoke_previousto the sync and async clients. The default is unchanged.Why grace is still the default: the provider side holds one secret at a time (a GitHub webhook has a single
Secretfield), so it keeps signing with the old value until a human pastes the new one in. Revoking on every rotate would turn routine rotation into a delivery outage lasting as long as that handoff.revoke_previous=Trueaccepts that gap deliberately, because a leaked secret is the worse risk.The response now always states the outcome — exactly one of
previous_secret_expires_atandprevious_secret_revokedis present, so a caller never infers it from a missing field. The docstrings were rewritten to say so.Notes for review
revoke_previousis keyword-only and defaults toFalse.custom_triggers.pysurface, so nothing here depends on an openapi publish — unlike Point pydo at Hosted Agents Origin openapi tip (MARSOHS-551) #699 / Document Agent Configs openapi dependency (MARSOHS-741) #708, there is noDO_OPENAPI_COMMIT_SHA.txtbump to wait on._sendhelper already dropsNoneparams, so the default rotate puts no query parameter on the wire at all. Both suites assert that rather than only asserting the revoke case.OHS_endpoints, matching Document Agent Configs openapi dependency (MARSOHS-741) #708 — so Integrate Harness APIs #680 picks this up when it carries the branch tomain.Related
digitalocean/cthulhu#172453(harness-trigger —?revoke_previous=true, plus a cleaner sweep that nulls the expired ciphertext once the window closes).OHS_endpoints).doctl agents triggers rotate-secret --revoke-previous).Test plan
pytest tests/agents/— 127 passed, 1 skipped (pre-existing)test_rotate_secret_revoke_previousandtest_async_rotate_secret_revoke_previousassertrevoke_previous=truereaches the wire and the revoked flag parsestest_rotate_secretextended to assert the default sends norevoke_previousand parses the expiryblack --checkcleanMade with Cursor