diff --git a/docs/content-blocking.md b/docs/content-blocking.md index ef5461132db..ebc84bba3ea 100644 --- a/docs/content-blocking.md +++ b/docs/content-blocking.md @@ -40,7 +40,18 @@ caused the request to be blocked. [NOpfs](https://github.com/ipfs-shipyard/nopfs) supports the format from [IPIP-383](https://github.com/ipfs/specs/pull/383). -Example: https://badbits.dwebops.pub/badbits.deny +Clear-text rules are simple: just put content paths to block, one per line. +Paths with unicode and whitespace need to be percend-encoded: + +``` +/ipfs/QmbWqxBEKC3P8tqsKc98xmWNzrzDtRLMiMPL8wBuTGsMnR +/ipfs/bafybeihfg3d7rdltd43u3tfvncx7n5loqofbsobojcadtmokrljfthuc7y/927%20-%20Standards/927%20-%20Standards.png +``` + +Sensitive content paths can be double-hashed to block without revealing them. +Double-hashed list example: https://badbits.dwebops.pub/badbits.deny + +See [IPIP-383](https://github.com/ipfs/specs/pull/383) for detailed format specification and more examples. ## How to suspend blocking without removing denylists diff --git a/test/cli/content_blocking_test.go b/test/cli/content_blocking_test.go index 98e65397f15..ddb7c951e88 100644 --- a/test/cli/content_blocking_test.go +++ b/test/cli/content_blocking_test.go @@ -74,8 +74,6 @@ func TestContentBlocking(t *testing.T) { node.StartDaemon() // we need online mode for GatewayOverLibp2p tests client := node.GatewayClient() - // TODO: run matrix with NoFetch=false|true - // First, confirm gateway works t.Run("Gateway Allows CID that is not blocked", func(t *testing.T) { t.Parallel() @@ -174,7 +172,6 @@ func TestContentBlocking(t *testing.T) { gwTestName := fmt.Sprintf("Gateway denies %s", testCase.name) t.Run(gwTestName, func(t *testing.T) { resp := client.Get(testCase.path) - // TODO we should require HTTP 410, not 5XX: assert.Equal(t, http.StatusGone, resp.StatusCode) assert.Equal(t, http.StatusGone, resp.StatusCode, statusExpl) assert.Contains(t, resp.Body, blockedMsg, bodyExpl) }) @@ -192,7 +189,6 @@ func TestContentBlocking(t *testing.T) { }) assert.Equal(t, http.StatusGone, resp.StatusCode, statusExpl) - // TODO assert.Equal(t, http.StatusGone, resp.StatusCode) assert.Contains(t, resp.Body, blockedMsg, bodyExpl) }) @@ -205,7 +201,6 @@ func TestContentBlocking(t *testing.T) { }) assert.Equal(t, http.StatusGone, resp.StatusCode, statusExpl) - // TODO assert.Equal(t, http.StatusGone, resp.StatusCode) assert.Contains(t, resp.Body, blockedMsg, bodyExpl) }) @@ -220,7 +215,6 @@ func TestContentBlocking(t *testing.T) { }) assert.Equal(t, http.StatusGone, resp.StatusCode, statusExpl) - // TODO assert.Equal(t, http.StatusGone, resp.StatusCode) assert.Contains(t, resp.Body, blockedMsg, bodyExpl) })