-
Notifications
You must be signed in to change notification settings - Fork 455
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: Use CIDR format for connection-manager allow/deny lists #2783
Conversation
Commit History and ChangesThis document summarizes the commits made to the repository, detailing the changes and the rationale behind each commit. 1. Commit: Add
|
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.
Looking good, really close - comments inline.
Updates the connection manager to treat multiaddrs in the allow/deny lists using the standard IP CIDR format (e.g. `/ip4/52.55.0.0/ipcidr/16`) rather than string prefixes (e.g. `/ip4/52.55`). This allows us to validate multiaddrs accurately and ensures better control over IP address matching.
efb2cd5
to
84c3037
Compare
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.
LGTM, comments inline
packages/libp2p/test/connection-manager/connection-pruner.spec.ts
Outdated
Show resolved
Hide resolved
packages/libp2p/test/connection-manager/multiaddr-to-ipnet.spec.ts
Outdated
Show resolved
Hide resolved
Co-authored-by: Alex Potsides <[email protected]>
Co-authored-by: Alex Potsides <[email protected]>
Co-authored-by: Alex Potsides <[email protected]>
Co-authored-by: Alex Potsides <[email protected]>
Co-authored-by: Alex Potsides <[email protected]>
…c.ts Co-authored-by: Alex Potsides <[email protected]>
Thanks for your patience with this! |
@SgtPooki @wemeetagain @dhuseby
Description
This PR updates the connection manager to treat multiaddrs in the allow/deny lists using the standard IP CIDR format (e.g.
/ip4/52.55.0.0/ipcidr/16
) rather than string prefixes (e.g./ip4/52.55
). This allows us to validate multiaddrs accurately and ensures better control over IP address matching.Changes:
.allow
and.deny
properties in the connection manager to useIpNet[]
for IP range validation.IpNet
format for both allow and deny lists.Relevant issues:
Notes & open questions
IpNet
format to ensure the connection manager handles IPs in CIDR notation.Change checklist