feat: support multiple blacklist providers#746
Merged
samcamwilliams merged 2 commits intoimpr/gunfrom Mar 11, 2026
Merged
Conversation
Collaborator
|
Looks good but no need for the backwards compat here. Clanker has over indexed on that, so the 'still works' test can go, much of the comment change, as well as |
- Add `blacklist_providers` config key accepting a list of providers - Keep backward compatibility with singular `blacklist_provider` key - Each provider is fetched independently with try/catch isolation - Merge all provider blacklists into a single ETS cache (union) - Add tests for multi-provider, backward compat, failure resilience, and numbered-message config format
- Remove fallback to singular blacklist_provider key - Remove numbered-message map handling from resolve_providers - Remove ?DEFAULT_PROVIDER macro (stale under new plural API) - Remove backward_compat_test and plural_numbered_message_test - Update existing tests to use blacklist_providers
f90f7fb to
87d5dde
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
blacklist_providersconfig key (JSON array) to configure multiple blacklist sourcesblacklist_providerkey still worksConfig example
{ "blacklist_providers": [ "/~relay@1.0/call?relay-method=GET&relay-path=https://provider-a.example.com/blacklist", "/~relay@1.0/call?relay-method=GET&relay-path=https://provider-b.example.com/blacklist" ], "on": { "request": { "device": "blacklist@1.0" } } }Note:
blacklist@1.0must be in theon/requesthook chain to intercept requests. It is not in the default hook chain (hb_opts.erl), so it must be explicitly configured. This is also true for the existing singularblacklist_providerkey.Test plan
multiple_providers_test— two separate blacklists, IDs from both are blockedbackward_compat_test— singular key still worksprovider_failure_resilience_test— bad provider doesn't break good onesplural_numbered_message_test— numbered message map (structured config) works