Watch
0
0
Fork
You've already forked hyperhive
0

sign ssh certificates on demand from ssh itself, warn before setup, say what to do when a host key changes

This commit is contained in:
atlas 2026-11-16 19:42:44 +01:00 • committed by mara
commit 3d7541c0af

View file

@ -4,6 +4,7 @@ import assert from "node:assert/strict";
import { test } from "node:test";
import {
authorizedKeysLine,
forgetHostKeyCommand,
sshBody,
sshSummary,
targetSnippet,
@ -37,6 +38,14 @@ test("the authorized_keys line trusts the CA for one principal only", () => {
);
});
test("the forget command names the agent's pin file and leaves the host to the operator", () => {
assert.equal(
forgetHostKeyCommand("atlas"),
"ssh-keygen -R <host> -f /agents/atlas/state/ssh_known_hosts",
);
assert.ok(forgetHostKeyCommand("maia").includes("/agents/maia/"));
});
test("each target form names the agent and the CA key, and keeps <user> for the operator", () => {
for (const form of ["nixos", "home-manager", "ssh"]) {
const text = targetSnippet(form, "atlas", ca);