From 2ff8f5b2b8a657bfb7f8b0a9776bd90ce82a2897 Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Wed, 6 Apr 2022 15:54:15 -0700 Subject: [PATCH 1/6] Add code coverage for SplitID. Create SplitIDWithSigil for future extension. Mark SplitID deprecated --- .gitignore | 1 + event.go | 63 ++++++++++++++++++++++++++++++++++----- event_test.go | 81 +++++++++++++++++++++++++++++++++++++++++++++++++++ go.mod | 2 +- 4 files changed, 138 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index a01ee289..2f6f77ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .*.swp +coverage.out diff --git a/event.go b/event.go index 46e916eb..5ce12256 100644 --- a/event.go +++ b/event.go @@ -21,6 +21,7 @@ import ( "errors" "fmt" "reflect" + "regexp" "strings" "time" @@ -1111,14 +1112,15 @@ func (er EventReference) MarshalJSON() ([]byte, error) { return json.Marshal(&tuple) } -// SplitID splits a matrix ID into a local part and a server name. -func SplitID(sigil byte, id string) (local string, domain ServerName, err error) { - // IDs have the format: SIGIL LOCALPART ":" DOMAIN - // Split on the first ":" character since the domain can contain ":" - // characters. - if len(id) == 0 || id[0] != sigil { - return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with %q", id, sigil) - } +const UserIDSigil = '@' +const RoomAliasSigil = '#' +const RoomIDSigil = '!' +const EventIDSigil = '$' +const GroupIDSigil = '+' + +var IsValidMXID = regexp.MustCompile(`^[a-z0-9\_\-\.\/\=]+$`).MatchString + +func splitId(id string) (local string, domain ServerName, err error) { parts := strings.SplitN(id, ":", 2) if len(parts) != 2 { // The ID must have a ":" character. @@ -1127,6 +1129,51 @@ func SplitID(sigil byte, id string) (local string, domain ServerName, err error) return parts[0][1:], ServerName(parts[1]), nil } +// Deprecated: Replaced with SplitIDWithSigil +// SplitID splits a matrix ID into a local part and a server name. +func SplitID(unusedSigil byte, id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + if unusedSigil != sigil { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with %q", id, unusedSigil) + } + return SplitIDWithSigil(id) +} + +// SplitID splits a matrix ID into a local part and a server name. +func SplitIDWithSigil(id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + switch sigil { + case UserIDSigil: + { + local, domain, err = splitId(id) + if err == nil { + if IsValidMXID(local) { + return local, domain, nil + } + // The Local portion of the User must be only a valid characters. + return "", "", fmt.Errorf("gomatrixserverlib: invalid local ID %q", local) + } + return + } + case RoomAliasSigil, RoomIDSigil, EventIDSigil, GroupIDSigil: + return splitId(id) + default: + return "", "", fmt.Errorf("gomatrixserverlib: invalid sigil %q", sigil) + } +} + // fixNilSlices corrects cases where nil slices end up with "null" in the // marshalled JSON because Go stupidly doesn't care about the type in this // situation. diff --git a/event_test.go b/event_test.go index fe506551..b21ca6c4 100644 --- a/event_test.go +++ b/event_test.go @@ -20,6 +20,8 @@ import ( "errors" "reflect" "testing" + + "github.com/stretchr/testify/assert" ) func benchmarkParse(b *testing.B, eventJSON string) { @@ -180,3 +182,82 @@ func TestHeaderedEventToNewEventFromUntrustedJSON(t *testing.T) { t.Fatal("expected an UnexpectedHeaderedEvent error but got:", err) } } + +func TestSplitID(t *testing.T) { + t.Run("To short id", + func(t *testing.T) { + _, _, err := SplitID('@', "") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Mismatch Sigil", + func(t *testing.T) { + _, _, err := SplitID('@', "#1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"#1234abcd:test\" doesn't start with '@'", "Mismatch Sigil incorrect error") + }) +} +func TestSplitIDWithSigil(t *testing.T) { + t.Run("To short id", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Invalid Sigil", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("%1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid sigil '%'", "Invalid Sigil incorrect error") + }) + + t.Run("No ServerName", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("@1234abcd_test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"@1234abcd_test\" missing ':'", "No ServerName incorrect error") + }) + + t.Run("UserID", + func(t *testing.T) { + localpart, domain, err := SplitIDWithSigil("@1234abcd:test") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "1234abcd", localpart, "The localpart should parse") + assert.Equal(t, ServerName("test"), domain, "The domain should parse") + }) + t.Run("UserID - Missing :", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("@1234Abcdtest") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"@1234Abcdtest\" missing ':'", "No : in UserID") + + }) + t.Run("UserID - Invalid", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("@1234Abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid local ID \"1234Abcd\"", "Error should be: %v, got: %v", "gomatrixserverlib: invalid local ID \"1234Abcd\"", err) + + }) + t.Run("GroupID", + func(t *testing.T) { + localpart, domain, err := SplitIDWithSigil("+group/=_-.123:my.domain") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "group/=_-.123", localpart, "The localpart should parse") + assert.Equal(t, ServerName("my.domain"), domain, "The domain should parse") + }) + t.Run("GroupID - Missing :", + func(t *testing.T) { + _, _, err := SplitIDWithSigil("+group/=_-.123my.domain") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"+group/=_-.123my.domain\" missing ':'", "No : in UserID") + + }) + + t.Run("RoomAlias", + + func(t *testing.T) { + localpart, domain, err := SplitIDWithSigil("#channel:test") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "channel", localpart, "The localpart should parse") + assert.Equal(t, ServerName("test"), domain, "The domain should parse") + }) +} diff --git a/go.mod b/go.mod index 60c74d68..48d0d341 100644 --- a/go.mod +++ b/go.mod @@ -9,7 +9,7 @@ require ( github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 github.com/miekg/dns v1.1.25 github.com/sirupsen/logrus v1.4.2 - github.com/stretchr/testify v1.4.0 // indirect + github.com/stretchr/testify v1.4.0 github.com/tidwall/gjson v1.12.1 github.com/tidwall/sjson v1.0.3 golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d From 4fe13c6c976e4af0c9d9877267af22c3547ac5a2 Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Thu, 7 Apr 2022 15:33:10 -0700 Subject: [PATCH 2/6] Add tests for UPK --- event.go | 17 +++++++++++++++-- event_test.go | 27 +++++++++++++++++++++++++-- 2 files changed, 40 insertions(+), 4 deletions(-) diff --git a/event.go b/event.go index 5ce12256..b7d48464 100644 --- a/event.go +++ b/event.go @@ -1117,10 +1117,14 @@ const RoomAliasSigil = '#' const RoomIDSigil = '!' const EventIDSigil = '$' const GroupIDSigil = '+' +const UserPermanentKeySigil = '~' +const UserDelegatedKeySigil = '^' var IsValidMXID = regexp.MustCompile(`^[a-z0-9\_\-\.\/\=]+$`).MatchString func splitId(id string) (local string, domain ServerName, err error) { + // Split on the first ":" character since the domain can contain ":" + // characters. parts := strings.SplitN(id, ":", 2) if len(parts) != 2 { // The ID must have a ":" character. @@ -1151,10 +1155,19 @@ func SplitIDWithSigil(id string) (local string, domain ServerName, err error) { return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) } // IDs have the format: SIGIL LOCALPART ":" DOMAIN - // Split on the first ":" character since the domain can contain ":" - // characters. sigil := id[0] switch sigil { + case UserPermanentKeySigil: + { + version := id[1] + if version == '1' { + // UPK, the whole ID is the local portion + return id[2:], "", err + + } + return "", "", fmt.Errorf("gomatrixserverlib: invalid UPK version %q", version) + + } case UserIDSigil: { local, domain, err = splitId(id) diff --git a/event_test.go b/event_test.go index b21ca6c4..a56cfc01 100644 --- a/event_test.go +++ b/event_test.go @@ -16,12 +16,14 @@ package gomatrixserverlib import ( + "encoding/base64" "encoding/json" "errors" "reflect" "testing" "github.com/stretchr/testify/assert" + "golang.org/x/crypto/ed25519" ) func benchmarkParse(b *testing.B, eventJSON string) { @@ -196,10 +198,10 @@ func TestSplitID(t *testing.T) { }) } func TestSplitIDWithSigil(t *testing.T) { - t.Run("To short id", + t.Run("Too short id", func(t *testing.T) { _, _, err := SplitIDWithSigil("") - assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "Too short id") }) t.Run("Invalid Sigil", func(t *testing.T) { @@ -234,6 +236,27 @@ func TestSplitIDWithSigil(t *testing.T) { assert.EqualErrorf(t, err, "gomatrixserverlib: invalid local ID \"1234Abcd\"", "Error should be: %v, got: %v", "gomatrixserverlib: invalid local ID \"1234Abcd\"", err) }) + + t.Run("UserID - UPK", + func(t *testing.T) { + pubKey, _, err := ed25519.GenerateKey(nil) + encodedKey := base64.URLEncoding.EncodeToString(pubKey) + localpart, domain, err := SplitIDWithSigil("~1" + encodedKey) + if err != nil { + t.Fatal(err) + } + assert.Equal(t, encodedKey, localpart, "The localpart should parse") + assert.Equal(t, ServerName(""), domain, "The domain should parse") + }) + + t.Run("UserID - Unsupported UPK version", + func(t *testing.T) { + pubKey, _, err := ed25519.GenerateKey(nil) + encodedKey := base64.URLEncoding.EncodeToString(pubKey) + _, _, err = SplitIDWithSigil("~2" + encodedKey) + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid UPK version '2'", "Only version 1 supported at this time") + }) + t.Run("GroupID", func(t *testing.T) { localpart, domain, err := SplitIDWithSigil("+group/=_-.123:my.domain") From 45b38bd0b68ffe9eb2570370cdeb392c21f6c9cf Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Thu, 7 Apr 2022 15:52:46 -0700 Subject: [PATCH 3/6] Fix lint warnings --- event.go | 6 +++--- event_test.go | 6 ++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/event.go b/event.go index b7d48464..88f14f12 100644 --- a/event.go +++ b/event.go @@ -1122,7 +1122,7 @@ const UserDelegatedKeySigil = '^' var IsValidMXID = regexp.MustCompile(`^[a-z0-9\_\-\.\/\=]+$`).MatchString -func splitId(id string) (local string, domain ServerName, err error) { +func splitID(id string) (local string, domain ServerName, err error) { // Split on the first ":" character since the domain can contain ":" // characters. parts := strings.SplitN(id, ":", 2) @@ -1170,7 +1170,7 @@ func SplitIDWithSigil(id string) (local string, domain ServerName, err error) { } case UserIDSigil: { - local, domain, err = splitId(id) + local, domain, err = splitID(id) if err == nil { if IsValidMXID(local) { return local, domain, nil @@ -1181,7 +1181,7 @@ func SplitIDWithSigil(id string) (local string, domain ServerName, err error) { return } case RoomAliasSigil, RoomIDSigil, EventIDSigil, GroupIDSigil: - return splitId(id) + return splitID(id) default: return "", "", fmt.Errorf("gomatrixserverlib: invalid sigil %q", sigil) } diff --git a/event_test.go b/event_test.go index a56cfc01..98d928bc 100644 --- a/event_test.go +++ b/event_test.go @@ -240,6 +240,9 @@ func TestSplitIDWithSigil(t *testing.T) { t.Run("UserID - UPK", func(t *testing.T) { pubKey, _, err := ed25519.GenerateKey(nil) + if err != nil { + t.Fatal(err) + } encodedKey := base64.URLEncoding.EncodeToString(pubKey) localpart, domain, err := SplitIDWithSigil("~1" + encodedKey) if err != nil { @@ -252,6 +255,9 @@ func TestSplitIDWithSigil(t *testing.T) { t.Run("UserID - Unsupported UPK version", func(t *testing.T) { pubKey, _, err := ed25519.GenerateKey(nil) + if err != nil { + t.Fatal(err) + } encodedKey := base64.URLEncoding.EncodeToString(pubKey) _, _, err = SplitIDWithSigil("~2" + encodedKey) assert.EqualErrorf(t, err, "gomatrixserverlib: invalid UPK version '2'", "Only version 1 supported at this time") From 3969955b7f08ee720946cd719997396e78c413a2 Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Fri, 8 Apr 2022 09:25:31 -0700 Subject: [PATCH 4/6] Encode type of ID being split into function name to prevent cross type accidental decoding --- event.go | 100 +++++++++++++++++++++++++----- event_test.go | 165 ++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 240 insertions(+), 25 deletions(-) diff --git a/event.go b/event.go index 88f14f12..bcab896f 100644 --- a/event.go +++ b/event.go @@ -1118,22 +1118,22 @@ const RoomIDSigil = '!' const EventIDSigil = '$' const GroupIDSigil = '+' const UserPermanentKeySigil = '~' -const UserDelegatedKeySigil = '^' -var IsValidMXID = regexp.MustCompile(`^[a-z0-9\_\-\.\/\=]+$`).MatchString +//const UserDelegatedKeySigil = '^' -func splitID(id string) (local string, domain ServerName, err error) { - // Split on the first ":" character since the domain can contain ":" - // characters. - parts := strings.SplitN(id, ":", 2) - if len(parts) != 2 { - // The ID must have a ":" character. - return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q missing ':'", id) - } - return parts[0][1:], ServerName(parts[1]), nil +func GetSupportedSigils() []rune { + return []rune{UserIDSigil, RoomAliasSigil, RoomIDSigil, EventIDSigil, GroupIDSigil, UserPermanentKeySigil /* , UserDelegatedKeySigil */} +} +func GetUserSigils() []rune { + return []rune{UserIDSigil, UserPermanentKeySigil /*, UserDelegatedKeySigil */} } +func GetRoomSigils() []rune { + return []rune{RoomAliasSigil, RoomIDSigil} +} + +var IsValidMXID = regexp.MustCompile(`^[a-z0-9\_\-\.\/\=]+$`).MatchString -// Deprecated: Replaced with SplitIDWithSigil +// Deprecated: Replaced with SplitXXXID functions // SplitID splits a matrix ID into a local part and a server name. func SplitID(unusedSigil byte, id string) (local string, domain ServerName, err error) { if len(id) == 0 { @@ -1146,14 +1146,86 @@ func SplitID(unusedSigil byte, id string) (local string, domain ServerName, err if unusedSigil != sigil { return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with %q", id, unusedSigil) } - return SplitIDWithSigil(id) + return splitIDWithSigil(id) +} + +// SplitUserID splits a matrix User ID into a local part and a server name. +func SplitUserID(id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + if !(UserIDSigil == sigil || UserPermanentKeySigil == sigil /*|| UserDelegatedKeySigil == sigil */) { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with valid sigil %q", id, sigil) + } + return splitIDWithSigil(id) +} + +// SplitRoomID splits a matrix RoomID into a local part and a server name. +func SplitRoomID(id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + if !(RoomIDSigil == sigil || RoomAliasSigil == sigil) { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with valid sigil %q", id, sigil) + } + return splitIDWithSigil(id) +} + +// SplitEventID splits a matrix EventID into a local part and a server name. +func SplitEventID(id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + if !(EventIDSigil == sigil) { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with valid sigil %q", id, sigil) + } + return splitIDWithSigil(id) +} + +// SplitGroupID splits a matrix GroupID into a local part and a server name. +func SplitGroupID(id string) (local string, domain ServerName, err error) { + if len(id) == 0 { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) + } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN + // Split on the first ":" character since the domain can contain ":" + // characters. + sigil := id[0] + if !(GroupIDSigil == sigil) { + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q doesn't start with valid sigil %q", id, sigil) + } + return splitIDWithSigil(id) +} + +func splitID(id string) (local string, domain ServerName, err error) { + // Split on the first ":" character since the domain can contain ":" + // characters. + parts := strings.SplitN(id, ":", 2) + if len(parts) != 2 { + // The ID must have a ":" character. + return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q missing ':'", id) + } + return parts[0][1:], ServerName(parts[1]), nil } // SplitID splits a matrix ID into a local part and a server name. -func SplitIDWithSigil(id string) (local string, domain ServerName, err error) { +func splitIDWithSigil(id string) (local string, domain ServerName, err error) { if len(id) == 0 { return "", "", fmt.Errorf("gomatrixserverlib: invalid ID %q", id) } + // IDs have the format: SIGIL LOCALPART ":" DOMAIN sigil := id[0] switch sigil { diff --git a/event_test.go b/event_test.go index 98d928bc..c10e5930 100644 --- a/event_test.go +++ b/event_test.go @@ -197,27 +197,170 @@ func TestSplitID(t *testing.T) { assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"#1234abcd:test\" doesn't start with '@'", "Mismatch Sigil incorrect error") }) } + +func difference(slice1 []rune, slice2 []rune) []rune { + diffStr := []rune{} + m := map[rune]int{} + + for _, s1Val := range slice1 { + m[s1Val] = 1 + } + for _, s2Val := range slice2 { + m[s2Val] = m[s2Val] + 1 + } + + for mKey, mVal := range m { + if mVal == 1 { + diffStr = append(diffStr, mKey) + } + } + + return diffStr +} +func TestSplitUserID(t *testing.T) { + testFunction := SplitUserID + supportedSigils := GetUserSigils() + t.Run("To short id", + func(t *testing.T) { + _, _, err := testFunction("") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Mismatch Sigil", + func(t *testing.T) { + notUserSigil := difference(GetSupportedSigils(), supportedSigils) + for _, sigil := range notUserSigil { + _, _, err := testFunction(string(sigil) + "1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \""+string(sigil)+"1234abcd:test\" doesn't start with valid sigil '"+string(sigil)+"'", "Mismatch Sigil incorrect error") + } + }) + t.Run("Matching Sigil", + func(t *testing.T) { + for _, sigil := range supportedSigils { + localpart, domain, err := testFunction(string(sigil) + "1234abcd:test") + if err != nil { + t.Fatal(err) + } + if sigil == UserIDSigil { + assert.Equal(t, "1234abcd", localpart, "The localpart should parse for sigil"+string(sigil)) + assert.Equal(t, ServerName("test"), domain, "The domain should parse for sigil"+string(sigil)) + + } else { + assert.Equal(t, "234abcd:test", localpart, "The localpart should parse for sigil"+string(sigil)) + assert.Equal(t, ServerName(""), domain, "The domain should parse for sigil"+string(sigil)) + + } + } + }) +} + +func TestSplitRoomID(t *testing.T) { + testFunction := SplitRoomID + supportedSigils := GetRoomSigils() + t.Run("To short id", + func(t *testing.T) { + _, _, err := testFunction("") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Mismatch Sigil", + func(t *testing.T) { + notRoomSigil := difference(GetSupportedSigils(), supportedSigils) + for _, sigil := range notRoomSigil { + _, _, err := testFunction(string(sigil) + "1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \""+string(sigil)+"1234abcd:test\" doesn't start with valid sigil '"+string(sigil)+"'", "Mismatch Sigil incorrect error") + } + }) + t.Run("Matching Sigil", + func(t *testing.T) { + for _, sigil := range supportedSigils { + localpart, domain, err := testFunction(string(sigil) + "1234abcd:test") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "1234abcd", localpart, "The localpart should parse for sigil"+string(sigil)) + assert.Equal(t, ServerName("test"), domain, "The domain should parse for sigil"+string(sigil)) + } + }) +} + +func TestSplitGroupID(t *testing.T) { + testFunction := SplitGroupID + supportedSigils := []rune{GroupIDSigil} + t.Run("To short id", + func(t *testing.T) { + _, _, err := testFunction("") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Mismatch Sigil", + func(t *testing.T) { + notGroupSigil := difference(GetSupportedSigils(), supportedSigils) + for _, sigil := range notGroupSigil { + _, _, err := testFunction(string(sigil) + "1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \""+string(sigil)+"1234abcd:test\" doesn't start with valid sigil '"+string(sigil)+"'", "Mismatch Sigil incorrect error") + } + }) + t.Run("Matching Sigil", + func(t *testing.T) { + for _, sigil := range supportedSigils { + localpart, domain, err := testFunction(string(sigil) + "1234abcd:test") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "1234abcd", localpart, "The localpart should parse for sigil"+string(sigil)) + assert.Equal(t, ServerName("test"), domain, "The domain should parse for sigil"+string(sigil)) + } + }) +} + +func TestSplitEventID(t *testing.T) { + testFunction := SplitEventID + supportedSigils := []rune{EventIDSigil} + t.Run("To short id", + func(t *testing.T) { + _, _, err := testFunction("") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "To short id") + }) + t.Run("Mismatch Sigil", + func(t *testing.T) { + notGroupSigil := difference(GetSupportedSigils(), supportedSigils) + for _, sigil := range notGroupSigil { + _, _, err := testFunction(string(sigil) + "1234abcd:test") + assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \""+string(sigil)+"1234abcd:test\" doesn't start with valid sigil '"+string(sigil)+"'", "Mismatch Sigil incorrect error") + } + }) + t.Run("Matching Sigil", + func(t *testing.T) { + for _, sigil := range supportedSigils { + localpart, domain, err := testFunction(string(sigil) + "1234abcd:test") + if err != nil { + t.Fatal(err) + } + assert.Equal(t, "1234abcd", localpart, "The localpart should parse for sigil"+string(sigil)) + assert.Equal(t, ServerName("test"), domain, "The domain should parse for sigil"+string(sigil)) + } + }) +} + func TestSplitIDWithSigil(t *testing.T) { t.Run("Too short id", func(t *testing.T) { - _, _, err := SplitIDWithSigil("") + _, _, err := splitIDWithSigil("") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"\"", "Too short id") }) t.Run("Invalid Sigil", func(t *testing.T) { - _, _, err := SplitIDWithSigil("%1234abcd:test") + _, _, err := splitIDWithSigil("%1234abcd:test") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid sigil '%'", "Invalid Sigil incorrect error") }) t.Run("No ServerName", func(t *testing.T) { - _, _, err := SplitIDWithSigil("@1234abcd_test") + _, _, err := splitIDWithSigil("@1234abcd_test") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"@1234abcd_test\" missing ':'", "No ServerName incorrect error") }) t.Run("UserID", func(t *testing.T) { - localpart, domain, err := SplitIDWithSigil("@1234abcd:test") + localpart, domain, err := splitIDWithSigil("@1234abcd:test") if err != nil { t.Fatal(err) } @@ -226,13 +369,13 @@ func TestSplitIDWithSigil(t *testing.T) { }) t.Run("UserID - Missing :", func(t *testing.T) { - _, _, err := SplitIDWithSigil("@1234Abcdtest") + _, _, err := splitIDWithSigil("@1234Abcdtest") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"@1234Abcdtest\" missing ':'", "No : in UserID") }) t.Run("UserID - Invalid", func(t *testing.T) { - _, _, err := SplitIDWithSigil("@1234Abcd:test") + _, _, err := splitIDWithSigil("@1234Abcd:test") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid local ID \"1234Abcd\"", "Error should be: %v, got: %v", "gomatrixserverlib: invalid local ID \"1234Abcd\"", err) }) @@ -244,7 +387,7 @@ func TestSplitIDWithSigil(t *testing.T) { t.Fatal(err) } encodedKey := base64.URLEncoding.EncodeToString(pubKey) - localpart, domain, err := SplitIDWithSigil("~1" + encodedKey) + localpart, domain, err := splitIDWithSigil("~1" + encodedKey) if err != nil { t.Fatal(err) } @@ -259,13 +402,13 @@ func TestSplitIDWithSigil(t *testing.T) { t.Fatal(err) } encodedKey := base64.URLEncoding.EncodeToString(pubKey) - _, _, err = SplitIDWithSigil("~2" + encodedKey) + _, _, err = splitIDWithSigil("~2" + encodedKey) assert.EqualErrorf(t, err, "gomatrixserverlib: invalid UPK version '2'", "Only version 1 supported at this time") }) t.Run("GroupID", func(t *testing.T) { - localpart, domain, err := SplitIDWithSigil("+group/=_-.123:my.domain") + localpart, domain, err := splitIDWithSigil("+group/=_-.123:my.domain") if err != nil { t.Fatal(err) } @@ -274,7 +417,7 @@ func TestSplitIDWithSigil(t *testing.T) { }) t.Run("GroupID - Missing :", func(t *testing.T) { - _, _, err := SplitIDWithSigil("+group/=_-.123my.domain") + _, _, err := splitIDWithSigil("+group/=_-.123my.domain") assert.EqualErrorf(t, err, "gomatrixserverlib: invalid ID \"+group/=_-.123my.domain\" missing ':'", "No : in UserID") }) @@ -282,7 +425,7 @@ func TestSplitIDWithSigil(t *testing.T) { t.Run("RoomAlias", func(t *testing.T) { - localpart, domain, err := SplitIDWithSigil("#channel:test") + localpart, domain, err := splitIDWithSigil("#channel:test") if err != nil { t.Fatal(err) } From 377060bebe4dda13f45a61089b38fbedf2d9eec6 Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Wed, 13 Apr 2022 12:25:49 -0400 Subject: [PATCH 5/6] Update package name for testing --- go.mod | 35 +++++++++++++++-------------- go.sum | 69 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 16 deletions(-) diff --git a/go.mod b/go.mod index 48d0d341..1867b355 100644 --- a/go.mod +++ b/go.mod @@ -1,25 +1,28 @@ -module github.com/matrix-org/gomatrixserverlib +module github.com/brianathere/gomatrixserverlib require ( github.com/frankban/quicktest v1.7.2 // indirect - github.com/google/go-cmp v0.4.0 - github.com/konsorten/go-windows-terminal-sequences v1.0.2 // indirect + github.com/google/go-cmp v0.5.7 + github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/kr/pretty v0.2.0 // indirect - github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 - github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 - github.com/miekg/dns v1.1.25 - github.com/sirupsen/logrus v1.4.2 - github.com/stretchr/testify v1.4.0 - github.com/tidwall/gjson v1.12.1 - github.com/tidwall/sjson v1.0.3 - golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d - golang.org/x/net v0.0.0-20200226121028-0de0cce0169b // indirect - golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e // indirect - golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64 // indirect + github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 + github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f + github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 + github.com/miekg/dns v1.1.48 + github.com/sirupsen/logrus v1.8.1 + github.com/stretchr/testify v1.7.1 + github.com/tidwall/gjson v1.14.0 + github.com/tidwall/sjson v1.2.4 + golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 + golang.org/x/net v0.0.0-20220412020605-290c469a71a5 // indirect + golang.org/x/sys v0.0.0-20220412211240-33da011f77ad // indirect + golang.org/x/tools v0.1.10 // indirect + golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f // indirect gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 // indirect - gopkg.in/h2non/gock.v1 v1.0.14 + gopkg.in/h2non/gock.v1 v1.1.2 gopkg.in/macaroon.v2 v2.1.0 - gopkg.in/yaml.v2 v2.2.8 + gopkg.in/yaml.v2 v2.4.0 + gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b // indirect ) go 1.13 diff --git a/go.sum b/go.sum index 61356e7c..1ec942c1 100644 --- a/go.sum +++ b/go.sum @@ -8,11 +8,15 @@ github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5a github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= +github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= +github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= +github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= +github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= @@ -21,63 +25,128 @@ github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 h1:Hr3zjRsq2bhrnp3Ky1qgx/fzCtCALOoGYylh2tpS9K4= github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= +github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4= +github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= +github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f h1:MZrl4TgTnlaOn2Cu9gJCoJ3oyW5mT4/3QIZGgZXzKl4= +github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f/go.mod h1:V5eO8rn/C3rcxig37A/BCeKerLFS+9Avg/77FIeTZ48= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 h1:ntrLa/8xVzeSs8vHFHK25k0C+NV74sYMJnNSg5NoSRo= github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= +github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= +github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= +github.com/miekg/dns v1.1.48 h1:Ucfr7IIVyMBz4lRE8qmGUuZ4Wt3/ZGu9hmcMT3Uu4tQ= +github.com/miekg/dns v1.1.48/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= +github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= +github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= +github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= +github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= +github.com/tidwall/gjson v1.14.0 h1:6aeJ0bzojgWLa82gDQHcx3S0Lr/O51I9bJ5nv6JFx5w= +github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= github.com/tidwall/sjson v1.0.3 h1:DeF+0LZqvIt4fKYw41aPB29ZGlvwVkHKktoXJ1YW9Y8= github.com/tidwall/sjson v1.0.3/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= +github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc= +github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= +github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= +github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= +golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= +golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= +golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= +golang.org/x/mod v0.4.2/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdxfwMYh3AVStj88WQTlNDi2a+o= +golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= +golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= +golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= +golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= +golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= +golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= +golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64 h1:D1v9ucDTYBtbz5vNuBbAhIMAGhQhJ6Ym5ah3maMVNX4= golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= +golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= +golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= +golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= +golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= +golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= +golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= +golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= +golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= +golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/h2non/gock.v1 v1.0.14 h1:fTeu9fcUvSnLNacYvYI54h+1/XEteDyHvrVCZEEEYNM= gopkg.in/h2non/gock.v1 v1.0.14/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= +gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= +gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI= gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= +gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= +gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= +gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b h1:h8qDotaEPuJATrMmW04NCwg7v22aHH28wwpauUhK9Oo= +gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= From fcba996964fc1da6c050a234a5483e5d7fc3038f Mon Sep 17 00:00:00 2001 From: Brian Meek Date: Wed, 13 Apr 2022 12:45:48 -0400 Subject: [PATCH 6/6] Fixup fetching gomatrixserverlib from private branch --- authchain_test.go | 2 +- federationclient_test.go | 2 +- go.mod | 2 -- go.sum | 42 +--------------------------------------- 4 files changed, 3 insertions(+), 45 deletions(-) diff --git a/authchain_test.go b/authchain_test.go index 48f53bf6..46e5f501 100644 --- a/authchain_test.go +++ b/authchain_test.go @@ -4,7 +4,7 @@ import ( "context" "testing" - "github.com/matrix-org/gomatrixserverlib" + "github.com/brianathere/gomatrixserverlib" ) // A basic sanity check of a linear sequence of common events diff --git a/federationclient_test.go b/federationclient_test.go index dd0b7775..7663e2de 100644 --- a/federationclient_test.go +++ b/federationclient_test.go @@ -11,7 +11,7 @@ import ( "strings" "testing" - "github.com/matrix-org/gomatrixserverlib" + "github.com/brianathere/gomatrixserverlib" "golang.org/x/crypto/ed25519" ) diff --git a/go.mod b/go.mod index 1867b355..58c53118 100644 --- a/go.mod +++ b/go.mod @@ -3,10 +3,8 @@ module github.com/brianathere/gomatrixserverlib require ( github.com/frankban/quicktest v1.7.2 // indirect github.com/google/go-cmp v0.5.7 - github.com/konsorten/go-windows-terminal-sequences v1.0.3 // indirect github.com/kr/pretty v0.2.0 // indirect github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 - github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 github.com/miekg/dns v1.1.48 github.com/sirupsen/logrus v1.8.1 diff --git a/go.sum b/go.sum index 1ec942c1..1ef6377a 100644 --- a/go.sum +++ b/go.sum @@ -6,53 +6,35 @@ github.com/frankban/quicktest v1.7.2 h1:2QxQoC1TS09S7fhCPsrvqYdvP1H5M1P1ih5ABm3B github.com/frankban/quicktest v1.7.2/go.mod h1:jaStnuzAqU1AJdCO0l53JDCJrVDKcS03DbaAcR7Ks/o= github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M= github.com/google/go-cmp v0.3.1/go.mod h1:8QqcDgzrUqlUb/G2PQTWiueGozuR1884gddMywk6iLU= -github.com/google/go-cmp v0.4.0 h1:xsAVV57WRhGj6kEIi8ReJzQlHHqcBYCElAvkovg3B/4= -github.com/google/go-cmp v0.4.0/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE= github.com/google/go-cmp v0.5.7 h1:81/ik6ipDQS2aGcBfIN5dHDB36BwrStyeAQquSYCV4o= github.com/google/go-cmp v0.5.7/go.mod h1:n+brtR0CgQNWTVd5ZUFpTBC8YFBDLK/h/bpaJ8/DtOE= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslCrtky5vbi9dd7HrQPQIx6wqiw= github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542/go.mod h1:Ow0tF8D4Kplbc8s8sSb3V2oUCygFHVp8gC3Dn6U4MNI= github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.2 h1:DB17ag19krx9CFsz4o3enTrPXyIXCl+2iCXH/aMAp9s= -github.com/konsorten/go-windows-terminal-sequences v1.0.2/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= -github.com/konsorten/go-windows-terminal-sequences v1.0.3 h1:CE8S1cTafDpPvMhIxNJKvHsGVBgn1xWYf1NbHQhywc8= -github.com/konsorten/go-windows-terminal-sequences v1.0.3/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ= github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo= github.com/kr/pretty v0.2.0 h1:s5hAObm+yFO5uHYt5dYjxi2rXrsnmRpJx4OYvIWUaQs= github.com/kr/pretty v0.2.0/go.mod h1:ipq/a2n7PKx3OHsz4KJII5eveXtPO4qwEXGdVfWzfnI= github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ= github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE= github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI= -github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26 h1:Hr3zjRsq2bhrnp3Ky1qgx/fzCtCALOoGYylh2tpS9K4= -github.com/matrix-org/gomatrix v0.0.0-20190528120928-7df988a63f26/go.mod h1:3fxX6gUjWyI/2Bt7J1OLhpCzOfO/bB3AiX0cJtEKud0= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16 h1:ZtO5uywdd5dLDCud4r0r55eP4j9FuUNpl60Gmntcop4= github.com/matrix-org/gomatrix v0.0.0-20210324163249-be2af5ef2e16/go.mod h1:/gBX06Kw0exX1HrwmoBibFA98yBk/jxKpGVeyQbff+s= -github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f h1:MZrl4TgTnlaOn2Cu9gJCoJ3oyW5mT4/3QIZGgZXzKl4= -github.com/matrix-org/gomatrixserverlib v0.0.0-20220408160933-cf558306b56f/go.mod h1:V5eO8rn/C3rcxig37A/BCeKerLFS+9Avg/77FIeTZ48= -github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7 h1:ntrLa/8xVzeSs8vHFHK25k0C+NV74sYMJnNSg5NoSRo= -github.com/matrix-org/util v0.0.0-20190711121626-527ce5ddefc7/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4 h1:eCEHXWDv9Rm335MSuB49mFUK44bwZPFSDde3ORE3syk= github.com/matrix-org/util v0.0.0-20200807132607-55161520e1d4/go.mod h1:vVQlW/emklohkZnOPwD3LrZUBqdfsbiyO3p1lNV8F6U= -github.com/miekg/dns v1.1.25 h1:dFwPR6SfLtrSwgDcIq2bcU/gVutB4sNApq2HBdqcakg= -github.com/miekg/dns v1.1.25/go.mod h1:bPDLeHnStXmXAq1m/Ch/hvfNHr14JKNPMBo3VZKjuso= github.com/miekg/dns v1.1.48 h1:Ucfr7IIVyMBz4lRE8qmGUuZ4Wt3/ZGu9hmcMT3Uu4tQ= github.com/miekg/dns v1.1.48/go.mod h1:e3IlAVfNqAllflbibAZEWOXOQ+Ynzk/dDozDxY7XnME= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32 h1:W6apQkHrMkS0Muv8G/TipAy/FJl/rCYT0+EuS8+Z0z4= github.com/nbio/st v0.0.0-20140626010706-e9e8d9816f32/go.mod h1:9wM+0iRr9ahx58uYLpLIr5fm8diHn0JbqRycJi6w0Ms= github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= -github.com/sirupsen/logrus v1.4.2 h1:SPIRibHv4MatM3XXNO2BJeFLZwZ2LvZgfQ5+UNI2im4= github.com/sirupsen/logrus v1.4.2/go.mod h1:tLMulIdttU9McNUspp0xgXVQah82FyeX6MwdIuYE2rE= github.com/sirupsen/logrus v1.8.1 h1:dJKuHgqk1NNQlqoA6BTlM1Wf9DOH3NBjQyu0h9+AZZE= github.com/sirupsen/logrus v1.8.1/go.mod h1:yWOB1SBYBC5VeMP7gHvWumXLIWorT60ONWic61uBYv0= github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/objx v0.1.1/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= github.com/stretchr/testify v1.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs= -github.com/stretchr/testify v1.4.0 h1:2E4SXV/wtOkTonXsotYi4li6zVWxYlZuYNCXe9XRJyk= -github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4= github.com/stretchr/testify v1.7.1 h1:5TQK59W5E3v0r2duFAb7P95B6hEeOyEnHRa8MjYSMTY= github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= -github.com/tidwall/gjson v1.12.1 h1:ikuZsLdhr8Ws0IdROXUS1Gi4v9Z4pGqpX/CvJkxvfpo= github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= github.com/tidwall/gjson v1.14.0 h1:6aeJ0bzojgWLa82gDQHcx3S0Lr/O51I9bJ5nv6JFx5w= github.com/tidwall/gjson v1.14.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk= @@ -60,18 +42,13 @@ github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA= github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM= github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs= github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU= -github.com/tidwall/sjson v1.0.3 h1:DeF+0LZqvIt4fKYw41aPB29ZGlvwVkHKktoXJ1YW9Y8= -github.com/tidwall/sjson v1.0.3/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y= github.com/tidwall/sjson v1.2.4 h1:cuiLzLnaMeBhRmEv00Lpk3tkYrcxpmbU81tAY4Dw0tc= github.com/tidwall/sjson v1.2.4/go.mod h1:098SZ494YoMWPmMO6ct4dcFnqxwj9r/gF0Etp19pSNM= github.com/yuin/goldmark v1.3.5/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= github.com/yuin/goldmark v1.4.1/go.mod h1:mwnBkeHKe2W/ZEtQ+71ViKU8L12m81fl3OWwC1Zlc8k= golang.org/x/crypto v0.0.0-20180723164146-c126467f60eb/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= -golang.org/x/crypto v0.0.0-20190923035154-9ee001bba392/go.mod h1:/lpIB1dKB+9EgE3H3cr1v9wB50oz8l4C4h62xy7jSTY= golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d h1:1ZiEyfaQIg3Qh0EoqpwAakHVhecoE5wlSg5GjnafJGw= -golang.org/x/crypto v0.0.0-20200221231518-2aa609cf4a9d/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4 h1:kUhD7nTDoI3fVd9G4ORWrbV5NY0liEs/Jg2pv5f+bBA= golang.org/x/crypto v0.0.0-20220411220226-7b82a4e95df4/go.mod h1:IxCIyHEi3zRg3s0A5j5BB6A9Jmi73HwBIUl50j+osU4= @@ -80,26 +57,19 @@ golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3 h1:kQgndtyPBW/JIYERgdx golang.org/x/mod v0.6.0-dev.0.20220106191415-9b9b3d81d5e3/go.mod h1:3p9vT2HGsQu2K1YbXdKPJLVgG5VJdoTa1poYQBtP1AY= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20190923162816-aa69164e4478/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b h1:0mm1VjtFUOIlE1SbDlwjYaDxZVDP2S5ou6y0gSgXHu8= -golang.org/x/net v0.0.0-20200226121028-0de0cce0169b/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM= golang.org/x/net v0.0.0-20210726213435-c6fcb2dbf985/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20211015210444-4f30a5c0130f/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= -golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2 h1:CIJ76btIcR3eFI5EgSo6k1qKw9KJexJuRLI9G7Hp5wE= golang.org/x/net v0.0.0-20211112202133-69e39bad7dc2/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y= golang.org/x/net v0.0.0-20220412020605-290c469a71a5 h1:bRb386wvrE+oBNdF1d/Xh9mQrfQ4ecYhW5qJ5GvTGT4= golang.org/x/net v0.0.0-20220412020605-290c469a71a5/go.mod h1:CfG3xpIq0wQ8r1q4Su4UZFWDARRcnwPjda9FqA0JpMk= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e h1:vcxGaoTs7kV8m5Np9uUNQin4BrLOthgV7252N8V+FwY= -golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= +golang.org/x/sync v0.0.0-20210220032951-036812b2e83c h1:5KslGYwFpkhGh+Q16bwMP3cOontH8FOep7tGV86Y7SQ= golang.org/x/sync v0.0.0-20210220032951-036812b2e83c/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20190422165155-953cdadca894/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190922100055-0a153f010e69/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.0.0-20190924154521-2837fb4f24fe/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20191026070338-33540a1f6037/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= @@ -109,26 +79,21 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211019181941-9d821ace8654/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20211216021012-1d35b9e2eb4e/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64 h1:D1v9ucDTYBtbz5vNuBbAhIMAGhQhJ6Ym5ah3maMVNX4= -golang.org/x/sys v0.0.0-20220405052023-b1e9470b6e64/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad h1:ntjMns5wyP/fN65tdBD4g8J5w8n015+iIIs9rtjXkY0= golang.org/x/sys v0.0.0-20220412211240-33da011f77ad/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo= golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= -golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= -golang.org/x/tools v0.0.0-20190907020128-2ca718005c18/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.6-0.20210726203631-07bc1bf47fb2/go.mod h1:o0xws9oXOQQZyjljx8fwUC0k7L1pTE6eaCbjGeHmOkk= golang.org/x/tools v0.1.10 h1:QjFRCZxdOhBJ/UNgnBZLbNV13DlbnK0quyivTnXJM20= golang.org/x/tools v0.1.10/go.mod h1:Uh6Zz+xoGYZom868N8YTex3t7RhtHDBrE8Gzo9bV56E= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= -golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543 h1:E7g+9GITq07hpfrRu66IVDexMakfv52eLZ2CXBWiKr4= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f h1:GGU+dLjvlC3qDwqYgL6UgRmHXhOOgns0bZu2Ty5mm6U= @@ -136,15 +101,10 @@ golang.org/x/xerrors v0.0.0-20220411194840-2f41105eb62f/go.mod h1:I/5z698sn9Ka8T gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo= gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= -gopkg.in/h2non/gock.v1 v1.0.14 h1:fTeu9fcUvSnLNacYvYI54h+1/XEteDyHvrVCZEEEYNM= -gopkg.in/h2non/gock.v1 v1.0.14/go.mod h1:sX4zAkdYX1TRGJ2JY156cFspQn4yRWn6p9EMdODlynE= gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY= gopkg.in/h2non/gock.v1 v1.1.2/go.mod h1:n7UGz/ckNChHiK05rDoiC4MYSunEC/lyaUm2WWaDva0= gopkg.in/macaroon.v2 v2.1.0 h1:HZcsjBCzq9t0eBPMKqTN/uSN6JOm78ZJ2INbqcBQOUI= gopkg.in/macaroon.v2 v2.1.0/go.mod h1:OUb+TQP/OP0WOerC2Jp/3CwhIKyIa9kQjuc7H24e6/o= -gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= -gopkg.in/yaml.v2 v2.2.8 h1:obN1ZagJSUGI0Ek/LBmuj4SNLPfIny3KsKFopxRdj10= -gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=