Skip to content

Commit 758bbd2

Browse files
committed
refactor!: move insecure transport outside of core
1 parent 403c42e commit 758bbd2

File tree

15 files changed

+51
-51
lines changed

15 files changed

+51
-51
lines changed

config/config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ import (
2121
"github.com/libp2p/go-libp2p/core/protocol"
2222
"github.com/libp2p/go-libp2p/core/routing"
2323
"github.com/libp2p/go-libp2p/core/sec"
24-
"github.com/libp2p/go-libp2p/core/sec/insecure"
2524
"github.com/libp2p/go-libp2p/core/transport"
2625
logging "github.com/libp2p/go-libp2p/gologshim"
2726
"github.com/libp2p/go-libp2p/p2p/host/autonat"
@@ -40,6 +39,7 @@ import (
4039
relayv2 "github.com/libp2p/go-libp2p/p2p/protocol/circuitv2/relay"
4140
"github.com/libp2p/go-libp2p/p2p/protocol/holepunch"
4241
"github.com/libp2p/go-libp2p/p2p/protocol/identify"
42+
"github.com/libp2p/go-libp2p/p2p/security/insecure"
4343
"github.com/libp2p/go-libp2p/p2p/transport/quicreuse"
4444
"github.com/libp2p/go-libp2p/p2p/transport/tcpreuse"
4545
libp2pwebrtc "github.com/libp2p/go-libp2p/p2p/transport/webrtc"

core/sec/insecure/pb/plaintext.proto

Lines changed: 0 additions & 12 deletions
This file was deleted.

p2p/net/swarm/dial_worker_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ import (
1919
"github.com/libp2p/go-libp2p/core/peer"
2020
"github.com/libp2p/go-libp2p/core/peerstore"
2121
"github.com/libp2p/go-libp2p/core/sec"
22-
"github.com/libp2p/go-libp2p/core/sec/insecure"
2322
"github.com/libp2p/go-libp2p/core/test"
2423
"github.com/libp2p/go-libp2p/core/transport"
2524
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
2625
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
2726
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
2827
tptu "github.com/libp2p/go-libp2p/p2p/net/upgrader"
28+
"github.com/libp2p/go-libp2p/p2p/security/insecure"
2929
libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic"
3030
"github.com/libp2p/go-libp2p/p2p/transport/quicreuse"
3131
"github.com/libp2p/go-libp2p/p2p/transport/tcp"

p2p/net/swarm/testing/testing.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,13 @@ import (
1515
"github.com/libp2p/go-libp2p/core/peer"
1616
"github.com/libp2p/go-libp2p/core/peerstore"
1717
"github.com/libp2p/go-libp2p/core/sec"
18-
"github.com/libp2p/go-libp2p/core/sec/insecure"
1918
"github.com/libp2p/go-libp2p/core/transport"
2019
"github.com/libp2p/go-libp2p/p2p/host/eventbus"
2120
"github.com/libp2p/go-libp2p/p2p/host/peerstore/pstoremem"
2221
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
2322
"github.com/libp2p/go-libp2p/p2p/net/swarm"
2423
tptu "github.com/libp2p/go-libp2p/p2p/net/upgrader"
24+
"github.com/libp2p/go-libp2p/p2p/security/insecure"
2525
libp2pquic "github.com/libp2p/go-libp2p/p2p/transport/quic"
2626
"github.com/libp2p/go-libp2p/p2p/transport/quicreuse"
2727
"github.com/libp2p/go-libp2p/p2p/transport/tcp"

p2p/net/upgrader/listener_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ import (
1414
mocknetwork "github.com/libp2p/go-libp2p/core/network/mocks"
1515
"github.com/libp2p/go-libp2p/core/peer"
1616
"github.com/libp2p/go-libp2p/core/sec"
17-
"github.com/libp2p/go-libp2p/core/sec/insecure"
1817
"github.com/libp2p/go-libp2p/core/transport"
1918
"github.com/libp2p/go-libp2p/p2p/net/upgrader"
19+
"github.com/libp2p/go-libp2p/p2p/security/insecure"
2020

2121
ma "github.com/multiformats/go-multiaddr"
2222
manet "github.com/multiformats/go-multiaddr/net"

p2p/net/upgrader/upgrader_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ import (
1313
mocknetwork "github.com/libp2p/go-libp2p/core/network/mocks"
1414
"github.com/libp2p/go-libp2p/core/peer"
1515
"github.com/libp2p/go-libp2p/core/sec"
16-
"github.com/libp2p/go-libp2p/core/sec/insecure"
1716
"github.com/libp2p/go-libp2p/core/transport"
1817
"github.com/libp2p/go-libp2p/p2p/muxer/yamux"
1918
"github.com/libp2p/go-libp2p/p2p/net/upgrader"
19+
"github.com/libp2p/go-libp2p/p2p/security/insecure"
2020

2121
ma "github.com/multiformats/go-multiaddr"
2222
manet "github.com/multiformats/go-multiaddr/net"

core/sec/insecure/insecure.go renamed to p2p/security/insecure/insecure.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// Package insecure provides an insecure, unencrypted implementation of the SecureConn and SecureTransport interfaces.
22
//
3-
// Recommended only for testing and other non-production usage.
3+
// Not Recommended
44
package insecure
55

66
import (
@@ -14,7 +14,7 @@ import (
1414
"github.com/libp2p/go-libp2p/core/peer"
1515
"github.com/libp2p/go-libp2p/core/protocol"
1616
"github.com/libp2p/go-libp2p/core/sec"
17-
"github.com/libp2p/go-libp2p/core/sec/insecure/pb"
17+
"github.com/libp2p/go-libp2p/p2p/security/insecure/pb"
1818

1919
"github.com/libp2p/go-msgio"
2020

File renamed without changes.

core/sec/insecure/pb/plaintext.pb.go renamed to p2p/security/insecure/pb/plaintext.pb.go

Lines changed: 27 additions & 27 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
syntax = "proto2";
2+
3+
package plaintext.pb;
4+
5+
import "core/crypto/pb/crypto.proto";
6+
7+
option go_package = "github.com/libp2p/go-libp2p/p2p/security/insecure/pb";
8+
9+
message Exchange {
10+
optional bytes id = 1;
11+
optional crypto.pb.PublicKey pubkey = 2;
12+
}

0 commit comments

Comments
 (0)