v0.5.4
Highlights
This release adds interfaces for Connection Gating: middleware components that intercept connections at different stages and decide whether to ALLOW or BLOCK the connection. In contrast to Connection Managers, Connection Gaters are actively consulted throughout the dial/listen pipeline.
Connection Gaters can intercept connections at these stages:
-
InterceptPeerDial
is called on an imminent outbound peer dial request, prior to the addresses of that peer being available/resolved. Blocking connections at this stage is typical for blacklisting scenarios. -
InterceptAddrDial
is called on an imminent outbound dial to a peer on a particular address. Blocking connections at this stage is typical for address filtering. -
InterceptAccept
is called as soon as a transport listener receives an inbound connection request, before any upgrade takes place. Transports who accept already secure and/or multiplexed connections (e.g. possibly QUIC) MUST call this method regardless, for correctness/consistency. -
InterceptSecured
is called for both inbound and outbound connections, after a security handshake has taken place and we've authenticated the peer. -
InterceptUpgraded
is called for inbound and outbound connections, after libp2p has finished upgrading the connection entirely to a secure, multiplexed channel.
Minor changes
- Added a
FirstSupportedProtocol
API to theProtobook
interface which returns the first protocol a peer supports from among the given interfaces.