@libp2p/interface-connection
Advanced tools
Comparing version 3.1.1 to 4.0.0
@@ -139,91 +139,2 @@ import type { Multiaddr } from '@multiformats/multiaddr'; | ||
export declare function isConnection(other: any): other is Connection; | ||
/** | ||
* @deprecated Please use the version from `@libp2p/interface-connection-gater` instead, this will be removed in a future release | ||
*/ | ||
export interface ConnectionGater { | ||
/** | ||
* denyDialMultiaddr tests whether we're permitted to Dial the | ||
* specified peer. | ||
* | ||
* This is called by the dialer.connectToPeer implementation before | ||
* dialling a peer. | ||
* | ||
* Return true to prevent dialing the passed peer. | ||
*/ | ||
denyDialPeer: (peerId: PeerId) => Promise<boolean>; | ||
/** | ||
* denyDialMultiaddr tests whether we're permitted to dial the specified | ||
* multiaddr for the given peer. | ||
* | ||
* This is called by the dialer.connectToPeer implementation after it has | ||
* resolved the peer's addrs, and prior to dialling each. | ||
* | ||
* Return true to prevent dialing the passed peer on the passed multiaddr. | ||
*/ | ||
denyDialMultiaddr: (peerId: PeerId, multiaddr: Multiaddr) => Promise<boolean>; | ||
/** | ||
* denyInboundConnection tests whether an incipient inbound connection is allowed. | ||
* | ||
* This is called by the upgrader, or by the transport directly (e.g. QUIC, | ||
* Bluetooth), straight after it has accepted a connection from its socket. | ||
* | ||
* Return true to deny the incoming passed connection. | ||
*/ | ||
denyInboundConnection: (maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* denyOutboundConnection tests whether an incipient outbound connection is allowed. | ||
* | ||
* This is called by the upgrader, or by the transport directly (e.g. QUIC, | ||
* Bluetooth), straight after it has created a connection with its socket. | ||
* | ||
* Return true to deny the incoming passed connection. | ||
*/ | ||
denyOutboundConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* denyInboundEncryptedConnection tests whether a given connection, now encrypted, | ||
* is allowed. | ||
* | ||
* This is called by the upgrader, after it has performed the security | ||
* handshake, and before it negotiates the muxer, or by the directly by the | ||
* transport, at the exact same checkpoint. | ||
* | ||
* Return true to deny the passed secured connection. | ||
*/ | ||
denyInboundEncryptedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* denyOutboundEncryptedConnection tests whether a given connection, now encrypted, | ||
* is allowed. | ||
* | ||
* This is called by the upgrader, after it has performed the security | ||
* handshake, and before it negotiates the muxer, or by the directly by the | ||
* transport, at the exact same checkpoint. | ||
* | ||
* Return true to deny the passed secured connection. | ||
*/ | ||
denyOutboundEncryptedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* denyInboundUpgradedConnection tests whether a fully capable connection is allowed. | ||
* | ||
* This is called after encryption has been negotiated and the connection has been | ||
* multiplexed, if a multiplexer is configured. | ||
* | ||
* Return true to deny the passed upgraded connection. | ||
*/ | ||
denyInboundUpgradedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* denyOutboundUpgradedConnection tests whether a fully capable connection is allowed. | ||
* | ||
* This is called after encryption has been negotiated and the connection has been | ||
* multiplexed, if a multiplexer is configured. | ||
* | ||
* Return true to deny the passed upgraded connection. | ||
*/ | ||
denyOutboundUpgradedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean>; | ||
/** | ||
* Used by the address book to filter passed addresses. | ||
* | ||
* Return true to allow storing the passed multiaddr for the passed peer. | ||
*/ | ||
filterMultiaddrForPeer: (peer: PeerId, multiaddr: Multiaddr) => Promise<boolean>; | ||
} | ||
export interface ConnectionProtector { | ||
@@ -230,0 +141,0 @@ /** |
{ | ||
"Connection": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_connection.Connection.html", | ||
"ConnectionGater": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_connection.ConnectionGater.html", | ||
"ConnectionProtector": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_connection.ConnectionProtector.html", | ||
@@ -5,0 +4,0 @@ "ConnectionStat": "https://libp2p.github.io/js-libp2p-interfaces/interfaces/_libp2p_interface_connection.ConnectionStat.html", |
{ | ||
"name": "@libp2p/interface-connection", | ||
"version": "3.1.1", | ||
"version": "4.0.0", | ||
"description": "Connection interface for libp2p", | ||
@@ -5,0 +5,0 @@ "license": "Apache-2.0 OR MIT", |
@@ -165,100 +165,2 @@ import type { Multiaddr } from '@multiformats/multiaddr' | ||
/** | ||
* @deprecated Please use the version from `@libp2p/interface-connection-gater` instead, this will be removed in a future release | ||
*/ | ||
export interface ConnectionGater { | ||
/** | ||
* denyDialMultiaddr tests whether we're permitted to Dial the | ||
* specified peer. | ||
* | ||
* This is called by the dialer.connectToPeer implementation before | ||
* dialling a peer. | ||
* | ||
* Return true to prevent dialing the passed peer. | ||
*/ | ||
denyDialPeer: (peerId: PeerId) => Promise<boolean> | ||
/** | ||
* denyDialMultiaddr tests whether we're permitted to dial the specified | ||
* multiaddr for the given peer. | ||
* | ||
* This is called by the dialer.connectToPeer implementation after it has | ||
* resolved the peer's addrs, and prior to dialling each. | ||
* | ||
* Return true to prevent dialing the passed peer on the passed multiaddr. | ||
*/ | ||
denyDialMultiaddr: (peerId: PeerId, multiaddr: Multiaddr) => Promise<boolean> | ||
/** | ||
* denyInboundConnection tests whether an incipient inbound connection is allowed. | ||
* | ||
* This is called by the upgrader, or by the transport directly (e.g. QUIC, | ||
* Bluetooth), straight after it has accepted a connection from its socket. | ||
* | ||
* Return true to deny the incoming passed connection. | ||
*/ | ||
denyInboundConnection: (maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* denyOutboundConnection tests whether an incipient outbound connection is allowed. | ||
* | ||
* This is called by the upgrader, or by the transport directly (e.g. QUIC, | ||
* Bluetooth), straight after it has created a connection with its socket. | ||
* | ||
* Return true to deny the incoming passed connection. | ||
*/ | ||
denyOutboundConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* denyInboundEncryptedConnection tests whether a given connection, now encrypted, | ||
* is allowed. | ||
* | ||
* This is called by the upgrader, after it has performed the security | ||
* handshake, and before it negotiates the muxer, or by the directly by the | ||
* transport, at the exact same checkpoint. | ||
* | ||
* Return true to deny the passed secured connection. | ||
*/ | ||
denyInboundEncryptedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* denyOutboundEncryptedConnection tests whether a given connection, now encrypted, | ||
* is allowed. | ||
* | ||
* This is called by the upgrader, after it has performed the security | ||
* handshake, and before it negotiates the muxer, or by the directly by the | ||
* transport, at the exact same checkpoint. | ||
* | ||
* Return true to deny the passed secured connection. | ||
*/ | ||
denyOutboundEncryptedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* denyInboundUpgradedConnection tests whether a fully capable connection is allowed. | ||
* | ||
* This is called after encryption has been negotiated and the connection has been | ||
* multiplexed, if a multiplexer is configured. | ||
* | ||
* Return true to deny the passed upgraded connection. | ||
*/ | ||
denyInboundUpgradedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* denyOutboundUpgradedConnection tests whether a fully capable connection is allowed. | ||
* | ||
* This is called after encryption has been negotiated and the connection has been | ||
* multiplexed, if a multiplexer is configured. | ||
* | ||
* Return true to deny the passed upgraded connection. | ||
*/ | ||
denyOutboundUpgradedConnection: (peerId: PeerId, maConn: MultiaddrConnection) => Promise<boolean> | ||
/** | ||
* Used by the address book to filter passed addresses. | ||
* | ||
* Return true to allow storing the passed multiaddr for the passed peer. | ||
*/ | ||
filterMultiaddrForPeer: (peer: PeerId, multiaddr: Multiaddr) => Promise<boolean> | ||
} | ||
export interface ConnectionProtector { | ||
@@ -265,0 +167,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32674
355