summaryrefslogtreecommitdiff
path: root/internal/cache/domain/domain_test.go
AgeCommit message (Collapse)AuthorFiles
2024-01-09[bugfix] fix higher-level explicit domain rules causing issues with ↵Libravatar kim1
lower-level domain blocking (#2513) * fix the sort direction of domain cache child nodes ... * add more domain cache test cases * add specific test for this bug to database domain test suite (thanks for writing this @tsmethurst!) * remove unused field (this was a previous attempt at a fix) * remove debugging println statements :innocent:
2023-09-21[feature] Implement explicit domain allows + allowlist federation mode (#2200)Libravatar tobi1
* love like winter! wohoah, wohoah * domain allow side effects * tests! logging! unallow! * document federation modes * linty linterson * test * further adventures in documentation * finish up domain block documentation (i think) * change wording a wee little bit * docs, example * consolidate shared domainPermission code * call mode once * fetch federation mode within domain blocked func * read domain perm import in streaming manner * don't use pointer to slice for domain perms * don't bother copying blocks + allows before deleting * admonish! * change wording just a scooch * update docs
2023-05-09[bugfix] fix possible domain blockcache nil ptr + add debug String() func ↵Libravatar kim1
(#1755)
2023-05-01[performance] replace domain block cache with an in-memory radix trie (#1714)Libravatar kim1
* replace domain block cache with an in-memory radix tree Signed-off-by: kim <grufwub@gmail.com> * fix domain block cache init Signed-off-by: kim <grufwub@gmail.com> --------- Signed-off-by: kim <grufwub@gmail.com>
2023-03-12[chore] Improve copyright header handling (#1608)Libravatar Daenney1
* [chore] Remove years from all license headers Years or year ranges aren't required in license headers. Many projects have removed them in recent years and it avoids a bit of yearly toil. In many cases our copyright claim was also a bit dodgy since we added the 2021-2023 header to files created after 2021 but you can't claim copyright into the past that way. * [chore] Add license header check This ensures a license header is always added to any new file. This avoids maintainers/reviewers needing to remember to check for and ask for it in case a contribution doesn't include it. * [chore] Add missing license headers * [chore] Further updates to license header * Use the more common // indentend comment format * Remove the hack we had for the linter now that we use the // format * Add SPDX license identifier
2023-01-05[chore] Update/add license headers for 2023 (#1304)Libravatar tobi1
2022-12-14[feature] domain block wildcarding (#1178)Libravatar kim1
* for domain block lookups, lookup along subdomain parts Signed-off-by: kim <grufwub@gmail.com> * only lookup up to a max of 5 domain parts to prevent DOS, limit inserted domains to max of 5 subdomains Signed-off-by: kim <grufwub@gmail.com> * add test for domain block wildcarding Signed-off-by: kim <grufwub@gmail.com> * check cached status first, increase cached domain time Signed-off-by: kim <grufwub@gmail.com> * fix domain wildcard part building logic Signed-off-by: kim <grufwub@gmail.com> * create separate domain.BlockCache{} type to hold all domain blocks in memory Signed-off-by: kim <grufwub@gmail.com> * remove unused variable Signed-off-by: kim <grufwub@gmail.com> * add docs and test to domain block cache, check for domain == host in domain block getter funcs Signed-off-by: kim <grufwub@gmail.com> * add license text Signed-off-by: kim <grufwub@gmail.com> * check order in which we check primary cache Signed-off-by: kim <grufwub@gmail.com> * add better documentation of how domain block checking is performed Signed-off-by: kim <grufwub@gmail.com> * change Signed-off-by: kim <grufwub@gmail.com> Signed-off-by: kim <grufwub@gmail.com>