]> source.dussan.org Git - rspamd.git/commit
[Feature] Add controller endpoint to get fuzzy hashes from messages
authorVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 20 May 2023 14:22:43 +0000 (15:22 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Sat, 20 May 2023 14:24:16 +0000 (15:24 +0100)
commitcac66961924d22e2454db745ccef118a08ea6184
treeb32360bc9b37c35ea2bc59b1efed82e123c0a9d0
parent32428449bd7a6035cecaaf4a684df997f2a9dab7
[Feature] Add controller endpoint to get fuzzy hashes from messages

Sample usage:

```
curl -XPOST 'http://localhost:11334/plugins/fuzzy/hashes?flag=1' --data-binary '@-' < file
```

Sample output:
```json
{
  "hashes": {
    "local": [
      "24b6e7de2f489778d828c827079c48bacb086f816d0a7acabbe42e8d0da703b89b913176ad67eefaf5b54fa59f5e0ecfc7015846c4043fcfb0c7a4ed7a235025",
      "72789777cbec926f4143de4c08c87acc3fbf3b909b5c39f1edcf82ed12e2d8bc2f56be8d68ee681feccf44ca04e3eca5b8ec039cb84a0d40e22258c370a10cbb"
    ],
    "rspamd.com": [
      "24b6e7de2f489778d828c827079c48bacb086f816d0a7acabbe42e8d0da703b89b913176ad67eefaf5b54fa59f5e0ecfc7015846c4043fcfb0c7a4ed7a235025",
      "72789777cbec926f4143de4c08c87acc3fbf3b909b5c39f1edcf82ed12e2d8bc2f56be8d68ee681feccf44ca04e3eca5b8ec039cb84a0d40e22258c370a10cbb"
    ],
  },
  "success": true
}
```

Issue: #4489
rules/controller/fuzzy.lua [new file with mode: 0644]
rules/controller/init.lua
src/plugins/fuzzy_check.c