1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-27 12:41:15 +02:00

fetchGit and flake: add publicKeys list input

This adds publicKeys as an optional fetcher input attribute to flakes
and builtins.fetchGit to provide a nix interface for the json-encoded
`publicKeys` attribute of the git fetcher.

Co-authored-by: Valentin Gagarin <valentin.gagarin@tweag.io>
This commit is contained in:
BootRhetoric 2023-10-20 21:17:14 +02:00
parent 6df32889a5
commit 098f0615c9
No known key found for this signature in database
4 changed files with 73 additions and 10 deletions

View file

@ -169,14 +169,14 @@ void doCommitVerification(const Path repoDir, const Path gitDir, const std::stri
&& k.type != "ssh-ed25519"
&& k.type != "ssh-ed25519-sk"
&& k.type != "ssh-rsa")
warn("Unknow keytype: %s\n"
warn("Unknown keytype: %s\n"
"Please use one of\n"
"- ssh-dsa\n"
"- ssh-ecdsa\n"
"- ssh-ecdsa-sk\n"
"- ssh-ed25519\n"
"- ssh-ed25519-sk\n"
"- ssh-rsa", k.type);
" ssh-ecdsa\n"
" ssh-ecdsa-sk\n"
" ssh-ed25519\n"
" ssh-ed25519-sk\n"
" ssh-rsa", k.type);
allowedSigners += "* " + k.type + " " + k.key + "\n";
}
writeFile(allowedSignersFile, allowedSigners);
@ -201,7 +201,7 @@ void doCommitVerification(const Path repoDir, const Path gitDir, const std::stri
}
re += "]";
if (status == 0 && std::regex_search(output, std::regex(re)))
printTalkative("Commit signature verification on commit %s succeeded", rev);
printTalkative("Signature verification on commit %s succeeded", rev);
else
throw Error("Commit signature verification on commit %s failed: \n%s", rev, output);
}