Keep GitHub webhook secret rotation in human setup

Return a saved setup handoff for delegated agents and reject plaintext signing-secret generation at the service boundary. Verify key/JWT handoffs preserve credential refs and human sessions can still rotate.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
DottaandPaperclip committed 2026-10-26 13:37:44 -05:00
1 parent 271740cc19
commit 096d2b0039
3 files changed
+21

No files matched your search

@@ -26,6 +26,7 @@ import type {
import {
conflict,
forbidden,
notFound,
unprocessable,
} from "../../../errors.js";
@@ -61,6 +62,9 @@ export function createGitHubSetupSecret(db: Db, options: GitHubSetupSecretOption
managementContext?: ConnectionManagementContext,
) {
await managementContext?.reauthorize();
if (managementContext?.actor.type === "agent") {
throw forbidden("Webhook signing secrets require a human setup handoff");
}
const initial = await endpointRecord(endpointId);
if (!initial) throw notFound("Chat endpoint not found");
if (initial.endpoint.provider !== "github") {