feat(webhooks): add gated automation token issuance - #6142
Conversation
Code Review SummaryStatus: No Issues Found | Recommendation: Merge Executive SummaryThe only change since the prior review at Files Reviewed (2 files)
Previous Review Summaries (2 snapshots, latest commit e860b23)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit e860b23)Status: No Issues Found | Recommendation: Merge Executive SummaryThe only change since the prior review at Files Reviewed (1 file)
Prior Review Context (unchanged files)Carried forward from the previous review, no new findings: Previous review (commit 0221351)Status: No Issues Found | Recommendation: Merge Reviewed the gated webhook automation token issuance changes against the current head Files Reviewed (14 files)
Reviewed by deepseek-v4.1-flash · Input: 39.6K · Output: 5.7K · Cached: 306.8K Review guidance: REVIEW.md from base branch |
Summary
Enable scoped credentials for Webhook Agent Ingest and scheduled automation. Modern control tokens target Cloud Agent Next, carry exact runtime-admission authority, and preserve existing null peppers. Legacy issuance retains its existing format. Format-specific cache keys prevent reusing credentials from the other issuance mode; callbacks retain separate HMAC authentication.
Extracted from #5976, which originated in the token-issuance implementation in #5857. This PR targets main independently of mobile and Gastown.
Verification
No manual deployed automation smoke tests were run. This extraction was verified with automated suites and source comparison; the deployed prepare/initiate/runtime/callback flow has not been smoke-tested and must be checked during rollout.
Visual Changes
N/A
Reviewer Notes
SHARED_RESOURCE_TOKENS_ENABLED"true"in production and developmentservices/webhook-agent-ingest/wrangler.jsonc; update the relevant environment and redeploy the WorkerScoped issuance turns on when this PR deploys; no additional toggle is needed. This Worker variable is independent of the same-named Vercel variable. To stop fresh scoped issuance, set it to
"false"in the relevant Worker environment and redeploy. An absent or invalid value also leaves issuance off.SHARED_RESOURCE_TOKENS_ENABLED=truewithCLOUD_AGENT_RESOURCE_TOKENS_ENABLED=falseis supported: Web issuance and Worker issuance are independent. Cloud Agent must retainRUNTIME_ISOLATION_ENABLED=trueto admit scoped webhook workloads; its checked-in configuration already does. Webhook jobs still exercise the scoped runtime path even when Web issuance is disabled.