Repository navigation
Keep a webhook trigger's auth when an update spec leaves it out - #95
Merged
2 commits merged intoOct 27, 2026
Merged
2 commits merged into
2 commits merged into
Conversation
Since Kizen's 2026-10-26 release a webhook trigger carries auth_type, headers and secret, and a PUT without auth_type resets the trigger to Kizen API auth, which also changes its URL under external callers. Every spec written before the release omits the key, so an update now carries the live trigger's auth across, matched by trigger id and then by webhook name. Setting auth_type still changes it. Specs can now set all four auth types. The model refuses headers or secret on a type Kizen silently drops them for, and the retired auth_header_* keys. Headers get the same html_value the UI writes, labelling a secret reference with the secret's description, and automations get shows each webhook's auth type.
This was referenced Oct 27, 2026
Merged
Contributor
Author
|
Included in the 0.4.0 release PR #102; merge that instead. |
sangyeT
approved these changes
Oct 27, 2026
sangyeT
left a comment
Contributor
There was a problem hiding this comment.
Reviewed the typed webhook auth models, the server-state carry-over in _carry_webhook_auth (matched by trigger id, then webhook name), the validator for Kizen's silently-dropped combinations, and the html_value mirror. Unit coverage against the four-auth-type fixture plus the drift guard look thorough. Approving.
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.
Problem
Since Kizen's 2026-10-26 release a webhook trigger carries
auth_type,headersandsecret. A PUT whose webhook block leaves outauth_typeresets the trigger to Kizen API auth and drops its headers or secret. Every spec written before the release leaves it out, soautomations updatefrom such a spec silently switched header, basic and no-auth webhooks back to Kizen API auth, and changed their?business_id=URLs under external callers, who then got 401s.diffshowed the reset, and also showed a spec restating the live auth as a change, because the read shape ofsecretand the emptyhtml_valuedidn't match the write shape.Solution
_merge_server_statenow carries the live trigger's auth across when a spec's webhook block has noauth_type, the same way an omittedactivekeeps its live value. Triggers match by id, then by webhook name, and a spec that setsauth_type(any value) is sent as written. One reduction,_webhook_auth, serves the builder, the GET→PUT read path and the carry-over, sodiffcompares like with like.TriggerWebhookConfigtypesauth_type,headersandsecret, and refusesheaderson a non-http_headertrigger andsecreton a non-basic_authone, which Kizen drops without a word. It also refuses the retiredauth_header_*keys, pointing atheaders. Each header gets thehtml_valuemirror the UI writes, labelling an{{ integration_secret.x }}reference with the secret's description; that needs a single read of/api/integration-secretsper plan, keeping only api_name → description.automations getgains anauthcolumn.kizen docs show automationhas a webhook-auth section with the enforcement rules seen live.Testing
Local checks after merging main: lint, format, typecheck, pytest (
2855 passed, 4 skipped, 1 xfailed) and the CLI-tree diff,passed: lint format typecheck test extra_checks. With the carry-over call removed, the omitted-auth, by-name and omitted-diff tests fail.Live on a test tenant, with a scratch automation holding all four auth types: create stored the derived
html_value;diffagainst a spec omitting auth and one restating it showed no auth lines;updatefrom a spec with no auth and no ids kept every trigger's auth, headers, secret and URL; an explicitauth_type: kizen_apiwas applied;roundtrip --executereporteddrift: []. On a UI-built automation (read only), the derivedhtml_valuematched the UI's byte for byte. New drift testtest_active_preserved_on_update.py -k webhookandtest_roundtrip_automations.py -k wired_trigger_typepass. The full drift tier has 4 failures, all also failing on main: its schema snapshot predates the 2026-10-26 release.Design notes / tradeoffs
Keep-live over two alternatives. Refusing the plan when live auth exists and the spec omits it would reject every spec written before the release. Checking client-side the rules the server already rejects with a precise 400 would duplicate them; the model checks only what the server drops silently. The cost of keep-live: turning auth off takes an explicit
auth_type: kizen_apiornone.A literal header value is accepted by Kizen and stored in plain text, so the docs steer to a secret reference.
The integration-secret lookup is a hand-rolled lazy cache on
LiveContext. #99 (the Call LLM MCP-server fix) adds a generic lazy step-picker cache there; once both are on main, this lookup could move onto it.Overlaps: #96 (the loops fix) and #99 (the Call LLM MCP-server fix) also change
tools/planners/automations.py,docs/specs/automation.mdandCHANGELOG.md; #100 (themcp-serverscommand group) and #101 (theservice-accountscommand group) also add lines to theCONTRIBUTING.mdsource tree. The second of these to merge should need a small conflict fix. The merge from main also refreshesscripts/cli-tree-baseline.txtfor #92's newkizen upgrade --checkhelp text, which main's baseline lacks; every PR in this set carries that same line, so they don't conflict on it.