pinning + new version of backups

This commit is contained in:
KingKDot
2026-07-30 14:03:16 -05:00
parent 477b9a5353
commit 2669ab1388
32 changed files with 1527 additions and 133 deletions
@@ -0,0 +1,17 @@
import { describe, expect, test } from "bun:test";
import { createAgentTlsPinsLdflag } from "./build-process";
describe("agent build TLS pin embedding", () => {
test("creates the linker flag consumed by the Go agent config", () => {
const currentPin = Buffer.alloc(32, 0x11).toString("base64");
const nextPin = Buffer.alloc(32, 0x22).toString("base64");
expect(createAgentTlsPinsLdflag([currentPin, nextPin])).toBe(
`-X overlord-client/cmd/agent/config.DefaultTLSSPKIPins=${currentPin},${nextPin}`,
);
});
test("does not create a linker flag without pins", () => {
expect(createAgentTlsPinsLdflag([])).toBe("");
});
});