Skip to content
This repository has been archived by the owner on Sep 10, 2022. It is now read-only.

call the connection gater when accepting connections and after crypto handshake #55

Merged
merged 10 commits into from
May 15, 2020

Conversation

aarshkshah1992
Copy link
Contributor

@aarshkshah1992 aarshkshah1992 commented Apr 7, 2020

For libp2p/go-libp2p#872.

Core PR at libp2p/go-libp2p-core#139.

We apply gating to accepted(inbound connections from a socket before we begin upgrading them) AND secured(the security protocol has been negotiated) connections in the upgrader.

However, please note that we don't apply gating to upgraded connections here as we want to send a Disconnect message with an appropriate reason for them. Hence, the best place to do it is the Swarm.

@aarshkshah1992 aarshkshah1992 changed the title Add an Address based Connection Gater Connection Gating for Accepted OR Secured connections Apr 9, 2020
Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is missing tests. Unfortunately we're using gingko which nobody on the team is really familiar with -- and this implies some ramp up cost to be able to enhance the listener test suite.

@raulk raulk changed the title Connection Gating for Accepted OR Secured connections call the connection gater when accepting connections and after crypto handshake May 13, 2020
@aarshkshah1992
Copy link
Contributor Author

aarshkshah1992 commented May 13, 2020

@raulk I couldn't figure out how to add tests for this in this repo back then so I implemented all these tests in the go-libp2p-swarm PR.

@raulk
Copy link
Member

raulk commented May 13, 2020

@aarshkshah1992 I removed ginkgo in #60.

@raulk
Copy link
Member

raulk commented May 13, 2020

This needs a release in go-libp2p-core to we can import a proper version. Other than that, it's good to go now.

Copy link
Member

@raulk raulk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgraded go-libp2p-core to v0.5.5.

@raulk raulk merged commit 0c577bb into master May 15, 2020
@raulk raulk deleted the feat/connection-gating branch May 15, 2020 12:54
@Stebalien Stebalien mentioned this pull request May 26, 2020
77 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants