Skip to content
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.

Commit

Permalink
fix: make outbound peer id optional (#294)
Browse files Browse the repository at this point in the history
In order to support connecting to mulitaddrs without a peer id
make the remote peer id an optional argument when securing the
outbound connection.
  • Loading branch information
achingbrain authored Sep 30, 2022
1 parent 399544b commit 6724ffe
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions packages/interface-connection-encrypter/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,16 @@ export interface ConnectionEncrypter {
protocol: string

/**
* Encrypt outgoing data to the remote party.
* Encrypt outgoing data to the remote party. If the remote PeerId is known,
* pass it for extra verification, otherwise it will be determined during
* the handshake.
*/
secureOutbound: (localPeer: PeerId, connection: Duplex<Uint8Array>, remotePeer: PeerId) => Promise<SecuredConnection>
secureOutbound: (localPeer: PeerId, connection: Duplex<Uint8Array>, remotePeer?: PeerId) => Promise<SecuredConnection>

/**
* Decrypt incoming data.
* Decrypt incoming data. If the remote PeerId is known,
* pass it for extra verification, otherwise it will be determined during
* the handshake
*/
secureInbound: (localPeer: PeerId, connection: Duplex<Uint8Array>, remotePeer?: PeerId) => Promise<SecuredConnection>
}
Expand Down

0 comments on commit 6724ffe

Please sign in to comment.