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:
parent
fc29fc89c0
commit
3d7541c0af
1 changed files with 521 additions and 67 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue