mirror of
https://github.com/paperclipai/paperclip.git
synced 2026-10-29 12:59:13 +01:00
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:
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") {
|
||||
|
||||
Reference in new issue
Block a user