Skip to content

Commit 4194519

Browse files
committed
fix(spec): config.signature's reserved-header message names no internal issue id
The doc authoring guard refuses an internal issue id in customer-facing spec text. The ruling reference moves to a comment beside the message, and the test pins the new wording plus the absence of any id. Claude-Session: https://claude.ai/code/session_01WGufzggC8errMtPRYBUmoY Co-authored-by: Claude <noreply@anthropic.com>
1 parent ce07e1f commit 4194519

2 files changed

Lines changed: 8 additions & 4 deletions

File tree

‎packages/spec/src/automation/api-trigger-signature.test.ts‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ describe('refused at parse, at the start node config.signature', () => {
211211
const declared = { ...KEYED, signature: { ...GITHUB_STYLE, header } };
212212
const issues = refusalsUnderSignature(FlowSchema.safeParse(flow('api', declared)));
213213
expect(pathsOf(issues)).toEqual(['nodes.0.config.signature.header']);
214-
expect(issues[0]!.message).toMatch(/ruling B on #22805/);
214+
expect(issues[0]!.message).toMatch(/re-admit that refused form, with no replay bound/);
215+
// Customer-facing text names no internal issue id (the doc authoring guard).
216+
expect(issues[0]!.message).not.toMatch(/#\d/);
215217
expect(apiTriggerVerifierOf(declared)).toEqual({ kind: 'unusable' });
216218
const timestamped = refusalsUnderSignature(FlowSchema.safeParse(flow('api', { ...KEYED, signature: { ...STRIPE_STYLE, header } })));
217219
expect(pathsOf(timestamped)).toEqual(['nodes.0.config.signature.header']);
@@ -236,6 +238,7 @@ describe('refused at parse, at the start node config.signature', () => {
236238
const issues = refusalsUnderSignature(FlowSchema.safeParse(flow('api', declared)));
237239
expect(pathsOf(issues)).toEqual(['nodes.0.config.signature.header']);
238240
expect(issues[0]!.message).toMatch(/never a sender's signature/);
241+
expect(issues[0]!.message).not.toMatch(/#\d/);
239242
expect(apiTriggerVerifierOf(declared)).toEqual({ kind: 'unusable' });
240243
}
241244
}

‎packages/spec/src/automation/api-trigger-signature.zod.ts‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,12 +113,13 @@ function reservedHeaderMessage(header: string): string | undefined {
113113
const name = header.toLowerCase();
114114
if (!RESERVED_HEADERS.has(name)) return undefined;
115115
if (name === 'x-objectstack-signature') {
116+
// The body-only `sha256=` form on this header is refused inbound by ruling B on #22805.
116117
return (
117118
`\`config.signature.header\` names \`${header}\`, the platform's own signature header. A hook that declares ` +
118119
'its sender\'s scheme never reads that header, and the hook\'s own check accepts it only in its timestamped ' +
119-
'form (`t=…,v1=…`): a declared scheme on it would re-admit the body-only `sha256=` form ruling B on #22805 ' +
120-
'refuses inbound, with no replay bound. Remove `signature` to verify `x-objectstack-signature`, or name the ' +
121-
'header the sender writes its own signature in.'
120+
'form (`t=…,v1=…`) because the body-only `sha256=` form signs no time: a declared scheme on it would ' +
121+
're-admit that refused form, with no replay bound. Remove `signature` to verify `x-objectstack-signature`, ' +
122+
'or name the header the sender writes its own signature in.'
122123
);
123124
}
124125
return (

0 commit comments

Comments
 (0)