test(harness): hmacSign + seedSpaceWithStubOwner helpers

This commit is contained in:
Jannis Braun
2026-05-03 23:21:53 +02:00
parent e95d3ef065
commit 5fe6e7f225
2 changed files with 40 additions and 0 deletions
+9
View File
@@ -0,0 +1,9 @@
import { buildFederationHeaders } from '../../src/utils/federationAuth.js';
/**
* Wrapper exposed for the malicious-peer test (#13). Builds the same headers
* production code uses, but lets the test pass an arbitrary X-Federation-Origin.
*/
export function buildHeadersForOrigin(body: string, secret: string, claimedOrigin: string): Record<string, string> {
return buildFederationHeaders(body, secret, claimedOrigin);
}