js-libp2p icon indicating copy to clipboard operation
js-libp2p copied to clipboard

Use standard IP cidr format for allow/deny lists

Open achingbrain opened this issue 3 years ago • 8 comments

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.

achingbrain avatar Dec 04 '22 08:12 achingbrain

Related issue: https://github.com/libp2p/js-libp2p-utils/issues/12

achingbrain avatar Dec 07 '22 07:12 achingbrain

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?

mpetrunic avatar Jan 16 '23 10:01 mpetrunic