-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[screener] add blacklist #2825
[screener] add blacklist #2825
Conversation
WalkthroughThe configuration of the screener API has been enhanced to include a blacklist alongside the existing whitelist. The internal handling and initialization of the blacklist have been streamlined and updated across relevant components to reflect this change. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant ConfigLoader
participant Screener
User->>ConfigLoader: Load configuration (includes blacklist)
ConfigLoader->>Screener: Initialize screener with config
Screener->>ConfigLoader: Fetch blacklist
Screener->>Screener: Process blacklist addresses
loop Screening process
User->>Screener: Request screen
Screener->>User: Check blacklist and respond
end
Poem
Tip Early access features: enabledWe are currently testing the following features in early access:
Note:
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR Summary
- Added
Blacklist
field toConfig
struct incontrib/screener-api/config/config.go
- Replaced
blacklistCache
withblacklist
map initialized from config incontrib/screener-api/screener/screener.go
- Simplified handling of blacklisted addresses by using config directly
2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #2825 +/- ##
===================================================
+ Coverage 25.58902% 25.91575% +0.32672%
===================================================
Files 766 751 -15
Lines 54922 53890 -1032
Branches 80 80
===================================================
- Hits 14054 13966 -88
+ Misses 39422 38480 -942
+ Partials 1446 1444 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 0
Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Files selected for processing (2)
- contrib/screener-api/config/config.go (1 hunks)
- contrib/screener-api/screener/screener.go (5 hunks)
Additional comments not posted (8)
contrib/screener-api/config/config.go (2)
24-24
: LGTM!The comment for the new
Blacklist
field is clear and concise.
25-25
: LGTM!The addition of the
Blacklist
field to theConfig
struct is consistent with the existing structure.contrib/screener-api/screener/screener.go (6)
57-57
: LGTM!The addition of the
blacklist
field to thescreenerImpl
struct is consistent with the existing structure.
77-77
: LGTM!The initialization of the
blacklist
map in theNewScreener
function is consistent with the initialization of thewhitelist
map.
83-85
: LGTM!The population of the
blacklist
map with addresses from thecfg.Blacklist
slice is consistent with the population of thewhitelist
map.
173-173
: LGTM!The addition of the item to the
blacklist
map in thefetchBlacklist
function is consistent with the function's purpose.
257-257
: LGTM!The check if an address is in the
blacklist
map in theisBlacklistedCache
function is consistent with the function's purpose.
305-305
: LGTM!The addition of the item to the
blacklist
map in theblacklistAddress
function is consistent with the function's purpose.
Deploying sanguine-fe with Cloudflare Pages
|
Description
blacklist through config
Summary by CodeRabbit
New Features
Refactor