physical.HOOK_MARKERconstno test imports itconst HOOK_MARKER: "# change-control pre-push hook"The marker of the hook this library installs.
The keys on this machine and what is done with them: the facts read (OpenSSH, the daily key, Git's settings for the repository, the agent, the hook), a key made by OpenSSH itself (so that the passphrase is typed into OpenSSH and nowhere else), Git set to sign with it for the repository alone, a test signature proved against the signers, the pre-push hook. A key is never overwritten, nothing is loaded into an agent, and no passphrase is seen, stored or passed: ssh-keygen and git ask for it on the terminal (or through the program named in SSH_ASKPASS).
import { readFacts } from "./keys.ts";
// const facts = await readFacts({ repo, keyFile, signersText, recoveryCheckedAt });physical.HOOK_MARKERconstno test imports itconst HOOK_MARKER: "# change-control pre-push hook"The marker of the hook this library installs.
physical.commitSignedfunctionno test imports itfunction commitSigned(repo: string, keyFile: string, message: string, options?: { readonly allowEmpty?: boolean | undefined; readonly paths?: readonly string[] | undefined; }): Promise<Result<string, string>>A commit made as the key signs it (an empty one where asked), the passphrase typed on the terminal.
physical.configureGitfunctionno test imports itfunction configureGit(repo: string, keyFile: string): Promise<Result<true, string>>Git set to sign every commit of this repository with the key, for this repository alone.
physical.installHookfunctionno test imports itfunction installHook(repo: string, command: string): Promise<Result<"already" | "installed", string>>The pre-push hook: it runs the command with what Git hands it, and is never put over a hook that is not ours.
physical.makeKeyfunctionno test imports itfunction makeKey(file: string, comment: string): Promise<Result<string, string>>A key pair made by OpenSSH (ed25519), the passphrase typed into OpenSSH on the terminal: refused where the file is there (a key is never overwritten). The public key line is given back.
physical.readFactsfunctionno test imports itfunction readFacts(i: FactsInput): Promise<Facts>The facts of this machine, read with no change and no passphrase asked.
physical.testSignfunctionno test imports itfunction testSign(keyFile: string, expectedPub: string, principal: string): Promise<Result<true, string>>A test signature with a key, checked against the public key it should be listed as (OpenSSH asks for the passphrase): proves the key and its passphrase.
physical.FactsInputtypeno test imports ittype FactsInput = {
readonly repo: string;
/** The daily key's private file (its public file is beside it, `.pub`). … (503 characters)type FactsInput = {
readonly repo: string;
/** The daily key's private file (its public file is beside it, `.pub`). */
readonly keyFile: string;
/** The text of the file that lists the signers, and the public keys of the daily and the recovery signers by name where they are listed. */
readonly dailyPub: string | undefined;
readonly recoveryListed: boolean;
readonly recoveryKeyFile: string | undefined;
readonly recoveryCheckedAt: string | undefined;
readonly signersText: string;
};What is read to know the facts.
HOOK_MARKERconstconst HOOK_MARKER: "# change-control pre-push hook"The marker of the hook this library installs.
commitSignedfunctionfunction commitSigned(repo: string, keyFile: string, message: string, options?: { readonly allowEmpty?: boolean | undefined; readonly paths?: readonly string[] | undefined; }): Promise<Result<string, string>>A commit made as the key signs it (an empty one where asked), the passphrase typed on the terminal.
configureGitfunctionfunction configureGit(repo: string, keyFile: string): Promise<Result<true, string>>Git set to sign every commit of this repository with the key, for this repository alone.
installHookfunctionfunction installHook(repo: string, command: string): Promise<Result<"already" | "installed", string>>The pre-push hook: it runs the command with what Git hands it, and is never put over a hook that is not ours.
makeKeyfunctionfunction makeKey(file: string, comment: string): Promise<Result<string, string>>A key pair made by OpenSSH (ed25519), the passphrase typed into OpenSSH on the terminal: refused where the file is there (a key is never overwritten). The public key line is given back.
readFactsfunctionfunction readFacts(i: FactsInput): Promise<Facts>The facts of this machine, read with no change and no passphrase asked.
testSignfunctionfunction testSign(keyFile: string, expectedPub: string, principal: string): Promise<Result<true, string>>A test signature with a key, checked against the public key it should be listed as (OpenSSH asks for the passphrase): proves the key and its passphrase.
FactsInputtypeno test imports ittype FactsInput = {
readonly repo: string;
/** The daily key's private file (its public file is beside it, `.pub`). … (503 characters)type FactsInput = {
readonly repo: string;
/** The daily key's private file (its public file is beside it, `.pub`). */
readonly keyFile: string;
/** The text of the file that lists the signers, and the public keys of the daily and the recovery signers by name where they are listed. */
readonly dailyPub: string | undefined;
readonly recoveryListed: boolean;
readonly recoveryKeyFile: string | undefined;
readonly recoveryCheckedAt: string | undefined;
readonly signersText: string;
};What is read to know the facts.