Skip to content
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

feat: reusable ip-based firewall/rate limiting, hmac on admin rpc #24

Merged
merged 14 commits into from
Jun 18, 2024
Merged

Conversation

nhtyy
Copy link
Contributor

@nhtyy nhtyy commented Jun 11, 2024

also:

  • our own service impl for rpc
  • rpc method level filtering at startup


match self {
ConnectionPolicy::Blacklist(blacklist) => {
if blacklist.contains(&ip) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: a small optimization would be to call remove directly.

pub hmac_secret: Option<PathBuf>,
}

impl From<Config> for FirewallConfig {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this needed considering firewall is a public field?

pub rate_limiting: RateLimitingConfig,
}

// todo stricter defaults?
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When in doubt, I tend to avoid the default and let the users decide so that there are no suprises. Makes debugging easier imo.

@nhtyy nhtyy force-pushed the n/rpc branch 4 times, most recently from 969a4ae to 9ad72ad Compare June 17, 2024 19:51
core/rpc/src/tests.rs Outdated Show resolved Hide resolved
core/rpc/src/config.rs Outdated Show resolved Hide resolved
@nhtyy nhtyy force-pushed the n/rpc branch 2 times, most recently from 9e38e0c to eaa0826 Compare June 17, 2024 23:49
@nhtyy nhtyy merged commit 8517f12 into main Jun 18, 2024
1 check passed
@nhtyy nhtyy deleted the n/rpc branch June 18, 2024 00:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants