-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add noise support #7365
Merged
Merged
feat: add noise support #7365
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
#!/usr/bin/env bash | ||
|
||
test_description="Test ping over NOISE command" | ||
|
||
. lib/test-lib.sh | ||
|
||
test_init_ipfs | ||
|
||
# start iptb + wait for peering | ||
test_expect_success 'init iptb' ' | ||
iptb testbed create -type localipfs -count 3 -init | ||
' | ||
|
||
noise_transports='"[\"noise\"]"' | ||
other_transports='"[\"tls\",\"secio\"]"' | ||
tcp_addr='"[\"/ip4/127.0.0.1/tcp/0\"]"' | ||
test_expect_success "configure security transports" ' | ||
ipfsi 0 config --json Experimental.OverrideSecurityTransports '${noise_transports}' && | ||
ipfsi 1 config --json Experimental.OverrideSecurityTransports '${noise_transports}' && | ||
ipfsi 2 config --json Experimental.OverrideSecurityTransports '${other_transports}' && | ||
iptb run -- ipfs config --json Addresses.Swarm '${tcp_addr}' | ||
' | ||
|
||
startup_cluster 2 | ||
|
||
test_expect_success 'peer ids' ' | ||
PEERID_0=$(iptb attr get 0 id) && | ||
PEERID_1=$(iptb attr get 1 id) | ||
' | ||
|
||
test_expect_success "test ping other" ' | ||
ipfsi 0 ping -n2 -- "$PEERID_1" && | ||
ipfsi 1 ping -n2 -- "$PEERID_0" | ||
' | ||
|
||
test_expect_success "test tls incompatible" ' | ||
iptb start --wait 2 && | ||
test_must_fail iptb connect 2 0 > connect_error 2>&1 && | ||
test_should_contain "failed to negotiate security protocol" connect_error || | ||
test_fsh cat connect_error | ||
' | ||
|
||
test_expect_success 'stop iptb' ' | ||
iptb stop | ||
' | ||
|
||
test_done |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Stebalien Why have we added the
securityTransportOverride
option ? Is there any use case for it right now ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At the moment, go-ipfs prefers TLS, then SECIO, then Noise. That means the noise transport will never be used by default. The override option lets us actually use noise by:
See the tests and the new experimental-features documentation for details. If it doesn't make sense, I'll expand the documentation in a followup PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(also provides a way to disable noise if it causes problems)