Commit 59f26457 authored by tavit ohanian's avatar tavit ohanian

Merge branch 'port-2021-05-05'

parents b95a67c4 3ad3e986
Pipeline #1009 passed with stages
in 20 seconds
...@@ -5,11 +5,11 @@ import ( ...@@ -5,11 +5,11 @@ import (
"fmt" "fmt"
"time" "time"
pb "gitlab.dms3.io/dms3/public/go-dms3ns/pb" pb "gitlab.dms3.io/dms3/go-dms3ns/pb"
ic "github.com/libp2p/go-libp2p-core/crypto" u "gitlab.dms3.io/dms3/go-dms3-util"
peer "github.com/libp2p/go-libp2p-core/peer" ic "gitlab.dms3.io/p2p/go-p2p-core/crypto"
u "gitlab.dms3.io/dms3/public/go-dms3-util" peer "gitlab.dms3.io/p2p/go-p2p-core/peer"
) )
// Create creates a new DMS3NS entry and signs it with the given private key. // Create creates a new DMS3NS entry and signs it with the given private key.
...@@ -127,7 +127,7 @@ func ExtractPublicKey(pid peer.ID, entry *pb.Dms3NsEntry) (ic.PubKey, error) { ...@@ -127,7 +127,7 @@ func ExtractPublicKey(pid peer.ID, entry *pb.Dms3NsEntry) (ic.PubKey, error) {
// //
// NOTE: If a and b cannot be ordered by this function, you can determine their // NOTE: If a and b cannot be ordered by this function, you can determine their
// order by comparing their serialized byte representations (using // order by comparing their serialized byte representations (using
// `bytes.Compare`). You must do this if you are implementing a libp2p record // `bytes.Compare`). You must do this if you are implementing a p2p record
// validator (or you can just use the one provided for you by this package). // validator (or you can just use the one provided for you by this package).
func Compare(a, b *pb.Dms3NsEntry) (int, error) { func Compare(a, b *pb.Dms3NsEntry) (int, error) {
as := a.GetSequence() as := a.GetSequence()
......
...@@ -5,9 +5,9 @@ import ( ...@@ -5,9 +5,9 @@ import (
"testing" "testing"
"time" "time"
u "gitlab.dms3.io/dms3/public/go-dms3-util" u "gitlab.dms3.io/dms3/go-dms3-util"
ci "github.com/libp2p/go-libp2p-core/crypto" ci "gitlab.dms3.io/p2p/go-p2p-core/crypto"
peer "github.com/libp2p/go-libp2p-core/peer" peer "gitlab.dms3.io/p2p/go-p2p-core/peer"
) )
func TestEmbedPublicKey(t *testing.T) { func TestEmbedPublicKey(t *testing.T) {
......
...@@ -8,7 +8,7 @@ import ( ...@@ -8,7 +8,7 @@ import (
// invalid due to being too old // invalid due to being too old
var ErrExpiredRecord = errors.New("expired record") var ErrExpiredRecord = errors.New("expired record")
// ErrUnrecognizedValidity is returned when an IpnsRecord has an // ErrUnrecognizedValidity is returned when an Dms3NsRecord has an
// unknown validity type. // unknown validity type.
var ErrUnrecognizedValidity = errors.New("unrecognized validity type") var ErrUnrecognizedValidity = errors.New("unrecognized validity type")
......
...@@ -3,10 +3,10 @@ package examples ...@@ -3,10 +3,10 @@ package examples
import ( import (
"time" "time"
pb "gitlab.dms3.io/dms3/public/go-dms3ns/pb" pb "gitlab.dms3.io/dms3/go-dms3ns/pb"
dms3ns "gitlab.dms3.io/dms3/public/go-dms3ns" dms3ns "gitlab.dms3.io/dms3/go-dms3ns"
crypto "github.com/libp2p/go-libp2p-core/crypto" crypto "gitlab.dms3.io/p2p/go-p2p-core/crypto"
) )
// CreateEntryWithEmbed shows how you can create an DMS3NS entry // CreateEntryWithEmbed shows how you can create an DMS3NS entry
......
...@@ -3,8 +3,8 @@ package examples_test ...@@ -3,8 +3,8 @@ package examples_test
import ( import (
"testing" "testing"
crypto "github.com/libp2p/go-libp2p-core/crypto" "gitlab.dms3.io/dms3/go-dms3ns/examples"
"gitlab.dms3.io/dms3/public/go-dms3ns/examples" crypto "gitlab.dms3.io/p2p/go-p2p-core/crypto"
) )
var testPath = "/dms3/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5" var testPath = "/dms3/Qme1knMqwt1hKZbc1BmQFmnm9f36nyQGwXxPGVpVJ9rMK5"
......
package examples package examples
import ( import (
crypto "github.com/libp2p/go-libp2p-core/crypto" crypto "gitlab.dms3.io/p2p/go-p2p-core/crypto"
) )
// GenerateRSAKeyPair is used to generate an RSA key pair // GenerateRSAKeyPair is used to generate an RSA key pair
......
This diff is collapsed.
...@@ -4,26 +4,26 @@ import ( ...@@ -4,26 +4,26 @@ import (
"bytes" "bytes"
"errors" "errors"
pb "gitlab.dms3.io/dms3/public/go-dms3ns/pb" pb "gitlab.dms3.io/dms3/go-dms3ns/pb"
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
ic "github.com/libp2p/go-libp2p-core/crypto" logging "gitlab.dms3.io/dms3/go-log"
peer "github.com/libp2p/go-libp2p-core/peer" ic "gitlab.dms3.io/p2p/go-p2p-core/crypto"
pstore "github.com/libp2p/go-libp2p-core/peerstore" peer "gitlab.dms3.io/p2p/go-p2p-core/peer"
record "github.com/libp2p/go-libp2p-record" pstore "gitlab.dms3.io/p2p/go-p2p-core/peerstore"
logging "gitlab.dms3.io/dms3/public/go-log" record "gitlab.dms3.io/p2p/go-p2p-record"
) )
var log = logging.Logger("dms3ns") var log = logging.Logger("dms3ns")
var _ record.Validator = Validator{} var _ record.Validator = Validator{}
// RecordKey returns the libp2p record key for a given peer ID. // RecordKey returns the p2p record key for a given peer ID.
func RecordKey(pid peer.ID) string { func RecordKey(pid peer.ID) string {
return "/dms3ns/" + string(pid) return "/dms3ns/" + string(pid)
} }
// Validator is an DMS3NS record validator that satisfies the libp2p record // Validator is an DMS3NS record validator that satisfies the p2p record
// validator interface. // validator interface.
type Validator struct { type Validator struct {
// KeyBook, if non-nil, will be used to lookup keys for validating DMS3NS // KeyBook, if non-nil, will be used to lookup keys for validating DMS3NS
......
...@@ -6,11 +6,11 @@ import ( ...@@ -6,11 +6,11 @@ import (
"testing" "testing"
"time" "time"
pb "gitlab.dms3.io/dms3/public/go-dms3ns/pb" pb "gitlab.dms3.io/dms3/go-dms3ns/pb"
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
ci "github.com/libp2p/go-libp2p-core/crypto" u "gitlab.dms3.io/dms3/go-dms3-util"
u "gitlab.dms3.io/dms3/public/go-dms3-util" ci "gitlab.dms3.io/p2p/go-p2p-core/crypto"
) )
func shuffle(a []*pb.Dms3NsEntry) { func shuffle(a []*pb.Dms3NsEntry) {
......
...@@ -7,14 +7,14 @@ import ( ...@@ -7,14 +7,14 @@ import (
"testing" "testing"
"time" "time"
pb "gitlab.dms3.io/dms3/public/go-dms3ns/pb" pb "gitlab.dms3.io/dms3/go-dms3ns/pb"
proto "github.com/gogo/protobuf/proto" proto "github.com/gogo/protobuf/proto"
u "gitlab.dms3.io/dms3/public/go-dms3-util" u "gitlab.dms3.io/dms3/go-dms3-util"
ci "github.com/libp2p/go-libp2p-core/crypto" ci "gitlab.dms3.io/p2p/go-p2p-core/crypto"
peer "github.com/libp2p/go-libp2p-core/peer" peer "gitlab.dms3.io/p2p/go-p2p-core/peer"
pstore "github.com/libp2p/go-libp2p-core/peerstore" pstore "gitlab.dms3.io/p2p/go-p2p-core/peerstore"
pstoremem "github.com/libp2p/go-libp2p-peerstore/pstoremem" pstoremem "gitlab.dms3.io/p2p/go-p2p-peerstore/pstoremem"
) )
func testValidatorCase(t *testing.T, priv ci.PrivKey, kbook pstore.KeyBook, key string, val []byte, eol time.Time, exp error) { func testValidatorCase(t *testing.T, priv ci.PrivKey, kbook pstore.KeyBook, key string, val []byte, eol time.Time, exp error) {
...@@ -128,7 +128,7 @@ func TestEmbeddedPubKeyValidate(t *testing.T) { ...@@ -128,7 +128,7 @@ func TestEmbeddedPubKeyValidate(t *testing.T) {
} }
func TestPeerIDPubKeyValidate(t *testing.T) { func TestPeerIDPubKeyValidate(t *testing.T) {
t.Skip("disabled until libp2p/go-libp2p-crypto#51 is fixed") t.Skip("disabled until p2p/go-p2p-crypto#51 is fixed")
goodeol := time.Now().Add(time.Hour) goodeol := time.Now().Add(time.Hour)
kbook := pstoremem.NewPeerstore() kbook := pstoremem.NewPeerstore()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment