js-libp2p
js-libp2p copied to clipboard
Use standard IP cidr format for allow/deny lists
Currently the connection manager treats multiaddrs in the allow/deny lists as string prefixes (e.g. "/ip4/52.55"), it should use the standard IP cidr format instead (e.g. "/ip4/52.55.0.0/ipcidr/16") which will allow us to validate these as multiaddrs.
This will likely involve changes to the @multiformats/multiaddr module to allow using address ranges.
Related issue: https://github.com/libp2p/js-libp2p-utils/issues/12
This will likely involve changes to the @multiformats/multiaddr module to allow using address ranges.
@achingbrain Doesn't multiaddr already have ipcidr for this purpose?
Seems like we are missing https://github.com/multiformats/go-multiaddr/blob/master/protocols.go#L112 in js?
Should we add cidr based filtering implementation in js-multiaddr (like go) or in js-libp2p-utils?