mirror of
https://github.com/NixOS/nix.git
synced 2025-12-09 10:31:02 +01:00
Merge pull request #14536 from NixOS/clamp-down-hash
JSON for `Hash` now has to be `Base16`
This commit is contained in:
commit
69920f9557
36 changed files with 141 additions and 162 deletions
|
|
@ -15,13 +15,12 @@ nix-build fixed.nix -A bad --no-out-link && fail "should fail"
|
|||
# a side-effect.
|
||||
[[ -e $path ]]
|
||||
nix path-info --json "$path" | jq -e \
|
||||
--arg hash "$(nix hash convert --to base64 "md5:8ddd8be4b179a529afa5f2ffae4b9858")" \
|
||||
'.[].ca == {
|
||||
method: "flat",
|
||||
hash: {
|
||||
algorithm: "md5",
|
||||
format: "base64",
|
||||
hash: $hash
|
||||
format: "base16",
|
||||
hash: "8ddd8be4b179a529afa5f2ffae4b9858"
|
||||
},
|
||||
}'
|
||||
|
||||
|
|
|
|||
|
|
@ -49,12 +49,12 @@ try2 () {
|
|||
|
||||
nix path-info --json "$path" | jq -e \
|
||||
--arg algo "$hashAlgo" \
|
||||
--arg hash "$(nix hash convert --to base64 "$hashAlgo:$hashFromGit")" \
|
||||
--arg hash "$hashFromGit" \
|
||||
'.[].ca == {
|
||||
method: "git",
|
||||
hash: {
|
||||
algorithm: $algo,
|
||||
format: "base64",
|
||||
format: "base16",
|
||||
hash: $hash
|
||||
},
|
||||
}'
|
||||
|
|
|
|||
|
|
@ -19,13 +19,13 @@ diff --unified --color=always \
|
|||
{
|
||||
"$foo": {
|
||||
"algorithm": "sha256",
|
||||
"format": "base64",
|
||||
"hash": "QvtAMbUl/uvi+LCObmqOhvNOapHdA2raiI4xG5zI5pA="
|
||||
"format": "base16",
|
||||
"hash": "42fb4031b525feebe2f8b08e6e6a8e86f34e6a91dd036ada888e311b9cc8e690"
|
||||
},
|
||||
"$bar": {
|
||||
"algorithm": "sha256",
|
||||
"format": "base64",
|
||||
"hash": "9fhYGu9fqxcQC2Kc81qh2RMo1QcLBUBo8U+pPn+jthQ="
|
||||
"format": "base16",
|
||||
"hash": "f5f8581aef5fab17100b629cf35aa1d91328d5070b054068f14fa93e7fa3b614"
|
||||
},
|
||||
"$baz": null
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue