Skip to content

Commit e820b98

Browse files
committed
test: double-hashed denylit entries
1 parent f7483a6 commit e820b98

File tree

1 file changed

+9
-14
lines changed

1 file changed

+9
-14
lines changed

test/cli/content_blocking_test.go

+9-14
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ func TestContentBlocking(t *testing.T) {
2727
// Create CIDs we use in test
2828
h.WriteFile("blocked-dir/subdir/indirectly-blocked-file.txt", "indirectly blocked file content")
2929
parentDirCID := node.IPFS("add", "-Q", "-r", filepath.Join(h.Dir, "blocked-dir")).Stdout.Trimmed()
30-
// indirectlyBlockedFileCID := node.IPFS("add", "-Q", filepath.Join(h.Dir, "blocked-dir", "indirectly-blocked-file.txt")).Stderr.Trimmed()
3130

3231
h.WriteFile("directly-blocked-file.txt", "directly blocked file content")
3332
blockedCID := node.IPFS("add", "-Q", filepath.Join(h.Dir, "directly-blocked-file.txt")).Stdout.Trimmed()
@@ -38,9 +37,9 @@ func TestContentBlocking(t *testing.T) {
3837
// Create denylist at $IPFS_PATH/denylists/test.deny
3938
denylistTmp := h.WriteToTemp("name: test list\n---\n" +
4039
"//QmX9dhRcQcKUw3Ws8485T5a9dtjrSCQaUAHnG4iK9i4ceM\n" + // Double hash CID block: base58btc-sha256-multihash(QmVTF1yEejXd9iMgoRTFDxBv7HAz9kuZcQNBzHrceuK9HR)
41-
"//QmbK7LDv5NNBvYQzNfm2eED17SNLt1yNMapcUhSuNLgkqz\n" + // Double hash Path block using blake3 hashing: base58btc-blake3-multihash(gW7Nhu4HrfDtphEivm3Z9NNE7gpdh5Tga8g6JNZc1S8E47/path)
42-
"//d9d295bde21f422d471a90f2a37ec53049fdf3e5fa3ee2e8f20e10003da429e7\n" + // Legacy CID double-hash block: sha256(bafybeiefwqslmf6zyyrxodaxx4vwqircuxpza5ri45ws3y5a62ypxti42e/)
43-
"//3f8b9febd851873b3774b937cce126910699ceac56e72e64b866f8e258d09572\n" + // Legacy Path double-hash block: sha256(bafybeiefwqslmf6zyyrxodaxx4vwqircuxpza5ri45ws3y5a62ypxti42e/path)
40+
"//QmbK7LDv5NNBvYQzNfm2eED17SNLt1yNMapcUhSuNLgkqz\n" + // Double hash Path block under blake3 root CID: base58btc-sha256-multihash(gW7Nhu4HrfDtphEivm3Z9NNE7gpdh5Tga8g6JNZc1S8E47/path)
41+
"//8526ba05eec55e28f8db5974cc891d0d92c8af69d386fc6464f1e9f372caf549\n" + // Legacy CID double-hash block: sha256(bafkqahtcnrxwg23fmqqgi33vmjwgk2dbonuca3dfm5qwg6jamnuwicq/)
42+
"//e5b7d2ce2594e2e09901596d8e1f29fa249b74c8c9e32ea01eda5111e4d33f07\n" + // Legacy Path double-hash block: sha256(bafyaagyscufaqalqaacauaqiaejao43vmjygc5didacauaqiae/subpath)
4443
"/ipfs/" + blockedCID + "\n" + // block specific CID
4544
"/ipfs/" + parentDirCID + "/subdir*\n" + // block only specific subpath
4645
"/ipns/blocked-cid.example.com\n" +
@@ -110,26 +109,22 @@ func TestContentBlocking(t *testing.T) {
110109
path: "/ipns/blocked-dnslink.example.com",
111110
},
112111
{
113-
name: "double hash CID block: base58btc-sha256-multihash",
112+
name: "double-hash CID block (base58btc-sha256-multihash)",
114113
path: "/ipfs/QmVTF1yEejXd9iMgoRTFDxBv7HAz9kuZcQNBzHrceuK9HR",
115114
},
116-
/* TODO
117115
{
118-
name: "double hash Path block: base58btc-blake3-multihash",
116+
name: "double-hash Path block under blake3 root CID (base58btc-sha256-multihash)",
119117
path: "/ipfs/bafyb4ieqht3b2rssdmc7sjv2cy2gfdilxkfh7623nvndziyqnawkmo266a/path",
120118
},
121-
*/
122119
{
123-
name: "legacy CID double-hash block: sha256",
124-
path: "/ipfs/bafybeiefwqslmf6zyyrxodaxx4vwqircuxpza5ri45ws3y5a62ypxti42e",
120+
name: "legacy CID double-hash block (sha256)",
121+
path: "/ipfs/bafkqahtcnrxwg23fmqqgi33vmjwgk2dbonuca3dfm5qwg6jamnuwicq",
125122
},
126123

127-
/* TODO
128124
{
129-
name: "legacy Path double-hash: sha256",
130-
path: "/ipfs/bafybeiefwqslmf6zyyrxodaxx4vwqircuxpza5ri45ws3y5a62ypxti42e/path",
125+
name: "legacy Path double-hash block (sha256)",
126+
path: "/ipfs/bafyaagyscufaqalqaacauaqiaejao43vmjygc5didacauaqiae/subpath",
131127
},
132-
*/
133128
}
134129

135130
// Which specific cliCmds we test against testCases

0 commit comments

Comments
 (0)