diff --git a/.gitignore b/.gitignore index 21d89b6..a3ce968 100644 --- a/.gitignore +++ b/.gitignore @@ -15,4 +15,6 @@ client/test.cfg .VSCodeCouter/ meowlib-sources.jar meowlib.aar -client/test.db \ No newline at end of file +client/test.db +CLAUDE.md +CODE_REVIEW.md diff --git a/asymcrypt.go b/asymcrypt.go index cb07abd..39e856b 100644 --- a/asymcrypt.go +++ b/asymcrypt.go @@ -2,6 +2,7 @@ package meowlib import ( "encoding/base64" + "fmt" "time" "github.com/ProtonMail/gopenpgp/v2/crypto" @@ -18,24 +19,24 @@ type KeyPair struct { type KeysArray []KeyPair -func NewKeyPair() KeyPair { +func NewKeyPair() (*KeyPair, error) { // Return error! var kp KeyPair keys, err := crypto.GenerateKey("name", "mail", "x25519", 0) if err != nil { - log.Error().Msg("Key generation failed") + return nil, fmt.Errorf("key generation failed: %w", err) } - kp.Generated = time.Now() pub, err := keys.GetArmoredPublicKey() if err != nil { - log.Error().Msg("Public key extraction failed") + return nil, fmt.Errorf("failed to get public key: %w", err) } - kp.Public = base64.StdEncoding.EncodeToString([]byte(pub)) priv, err := keys.Armor() if err != nil { - log.Error().Msg("Private key extraction failed") + return nil, fmt.Errorf("failed to armor private key: %w", err) } + kp.Public = base64.StdEncoding.EncodeToString([]byte(pub)) kp.Private = base64.StdEncoding.EncodeToString([]byte(priv)) - return kp + kp.Generated = time.Now() + return &kp, nil } func (Kp *KeyPair) GetCryptoKeyObject() *crypto.Key { diff --git a/asymcrypt_test.go b/asymcrypt_test.go index 002fa7d..bd89552 100644 --- a/asymcrypt_test.go +++ b/asymcrypt_test.go @@ -42,13 +42,19 @@ WE88AQOdxtE8dAuu16suOpgLUfluDgnzCg== -----END PGP PUBLIC KEY BLOCK-----` func TestNewKeyPair(t *testing.T) { - kp := NewKeyPair() + kp, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } fmt.Println(kp.Public) fmt.Println(kp.Private) } func TestGetKey(t *testing.T) { - kp := NewKeyPair() + kp, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } // fmt.Println(kp.Public) // fmt.Println(kp.Private) key := kp.GetCryptoKeyObject() @@ -65,7 +71,10 @@ func TestGetKey(t *testing.T) { } func TestAsymEncryptDecrypt(t *testing.T) { - kp := NewKeyPair() + kp, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } foo := []byte("!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~") encMess, err := AsymEncrypt(kp.Public, foo) if err != nil { @@ -80,7 +89,10 @@ func TestAsymEncryptDecrypt(t *testing.T) { } func TestAsymEncryptDecryptSigned(t *testing.T) { - kp := NewKeyPair() + kp, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } foo := "!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~" enc, err := AsymEncryptAndSign(kp.Public, kp.Private, []byte(foo)) if err != nil { @@ -94,7 +106,10 @@ func TestAsymEncryptDecryptSigned(t *testing.T) { } func TestAsymEncryptDecryptSigned2(t *testing.T) { - kp := NewKeyPair() + kp, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } foo := "!#$%&()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_abcdefghijklmnopqrstuvwxyz{|}~" enc, err := AsymEncryptAndSign(kp.Public, kp.Private, []byte(foo)) if err != nil { diff --git a/client/helpers/invitationAnswerHelper.go b/client/helpers/invitationAnswerHelper.go index 4457ff3..dd0a1f3 100644 --- a/client/helpers/invitationAnswerHelper.go +++ b/client/helpers/invitationAnswerHelper.go @@ -24,7 +24,10 @@ func InvitationAnswer(cc *meowlib.ContactCard, nickname string, myNickname strin } // build my contact card for that friend - peer := client.GetConfig().GetIdentity().AnswerInvitation(mynick, nickname, serverUids, cc) + peer, err := client.GetConfig().GetIdentity().AnswerInvitation(mynick, nickname, serverUids, cc) + if err != nil { + return nil, "InvitationAnswer: AnswerInvitation", err + } //peerstr, err := json.Marshal(peer) //fmt.Println("InvitationAnswer: " + string(peerstr)) @@ -71,7 +74,10 @@ func InvitationAnswerFile(invitationFile string, nickname string, myNickname str mynick = client.GetConfig().GetIdentity().Nickname } - response := identity.AnswerInvitation(mynick, nickname, serverUids, cc) + response, err := identity.AnswerInvitation(mynick, nickname, serverUids, cc) + if err != nil { + return "InvitationAnswerFile : AnswerInvitation", err + } fmt.Fprintln(os.Stdout, "Invitation sent by "+received) if format == "qr" { filename = c.StoragePath + string(os.PathSeparator) + mynick + "-" + nickname + ".png" diff --git a/client/helpers/invitationCheckHelper.go b/client/helpers/invitationCheckHelper.go index a853e44..344b797 100644 --- a/client/helpers/invitationCheckHelper.go +++ b/client/helpers/invitationCheckHelper.go @@ -64,7 +64,10 @@ func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitati meowurl := strings.Split(invitationUrl, "?") shortcode := meowurl[1] - srv := client.CreateServerFromMeowUrl(meowurl[0]) + srv, err := client.CreateServerFromMeowUrl(meowurl[0]) + if err != nil { + return nil, "InvitationGetMessage: CreateServerFromMeowUrl", err + } // check if already in msg servers dbsrv, err := client.GetConfig().GetIdentity().MessageServers.LoadServer(srv.Url) if err != nil { @@ -73,7 +76,11 @@ func InvitationGetMessage(invitationUrl string, serverPublicKey string, invitati if dbsrv == nil { // create a server object with url & pubkey srv.PublicKey = serverPublicKey - srv.UserKp = meowlib.NewKeyPair() + k, err := meowlib.NewKeyPair() + if err != nil { + return nil, "InvitationGetMessage: NewKeyPair", err + } + srv.UserKp = k // save it err = client.GetConfig().GetIdentity().MessageServers.StoreServer(srv) if err != nil { diff --git a/client/identity.go b/client/identity.go index 2c8d297..b3aa0eb 100644 --- a/client/identity.go +++ b/client/identity.go @@ -16,36 +16,37 @@ import ( const maxHiddenCount = 30 type Identity struct { - Nickname string `json:"nickname,omitempty"` - DefaultAvatar string `json:"default_avatar,omitempty"` - Avatars []Avatar `json:"avatars,omitempty"` - RootKp meowlib.KeyPair `json:"id_kp,omitempty"` - Status string `json:"status,omitempty"` - Peers PeerStorage `json:"peers,omitempty"` - HiddenPeers [][]byte `json:"hidden_peers,omitempty"` - Personae PeerList `json:"faces,omitempty"` - Device meowlib.KeyPair `json:"device,omitempty"` - KnownServers ServerList `json:"known_servers,omitempty"` - MessageServers ServerStorage `json:"message_servers,omitempty"` - DefaultDbPassword string `json:"default_db_password,omitempty"` - DbPasswordStore bool `json:"db_password_store,omitempty"` - OwnedDevices PeerList `json:"owned_devices,omitempty"` - StaticMtkServerPaths []ServerList `json:"static_mtk_server_paths,omitempty"` - DynamicMtkServeRules []string `json:"dynamic_mtk_serve_rules,omitempty"` - InvitationTimeout int `json:"invitation_timeout,omitempty"` - Uuid string `json:"uuid,omitempty"` + Nickname string `json:"nickname,omitempty"` + DefaultAvatar string `json:"default_avatar,omitempty"` + Avatars []Avatar `json:"avatars,omitempty"` + RootKp *meowlib.KeyPair `json:"id_kp,omitempty"` + Status string `json:"status,omitempty"` + Peers PeerStorage `json:"peers,omitempty"` + HiddenPeers [][]byte `json:"hidden_peers,omitempty"` + Personae PeerList `json:"faces,omitempty"` + Device *meowlib.KeyPair `json:"device,omitempty"` + KnownServers ServerList `json:"known_servers,omitempty"` + MessageServers ServerStorage `json:"message_servers,omitempty"` + DefaultDbPassword string `json:"default_db_password,omitempty"` + DbPasswordStore bool `json:"db_password_store,omitempty"` + OwnedDevices PeerList `json:"owned_devices,omitempty"` + StaticMtkServerPaths []ServerList `json:"static_mtk_server_paths,omitempty"` + DynamicMtkServeRules []string `json:"dynamic_mtk_serve_rules,omitempty"` + InvitationTimeout int `json:"invitation_timeout,omitempty"` + Uuid string `json:"uuid,omitempty"` unlockedHiddenPeers PeerList } func CreateIdentity(nickname string) (*Identity, error) { var id Identity + var err error id.Nickname = nickname id.Uuid = uuid.New().String() - id.RootKp = meowlib.NewKeyPair() + id.RootKp, err = meowlib.NewKeyPair() GetConfig().me = &id id.MessageServers = ServerStorage{DbFile: uuid.NewString()} id.generateRandomHiddenStuff() - err := id.CreateFolder() + err = id.CreateFolder() if err != nil { return nil, err } @@ -71,10 +72,20 @@ func (id *Identity) WipeFolder() error { // Creates an invitation for a peer, returns the newly created peer including infos to provide a ContactCard func (id *Identity) InvitePeer(MyName string, ContactName string, MessageServerUids []string, InvitationMessage string) (*Peer, error) { var peer Peer + var err error peer.Uid = uuid.New().String() - peer.MyIdentity = meowlib.NewKeyPair() - peer.MyEncryptionKp = meowlib.NewKeyPair() - peer.MyLookupKp = meowlib.NewKeyPair() + peer.MyIdentity, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + peer.MyEncryptionKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + peer.MyLookupKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } peer.Name = ContactName peer.InvitationId = uuid.New().String() // todo as param to identify then update url /* if id.MessageServers.Servers == nil { @@ -116,13 +127,24 @@ func (id *Identity) CheckInvitation(ReceivedContact *meowlib.ContactCard) (isAns } // Answers an invitation, returns the newly created peer including infos to provide a ContactCard -func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageServerIdxs []string, ReceivedContact *meowlib.ContactCard) *Peer { +func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageServerIdxs []string, ReceivedContact *meowlib.ContactCard) (*Peer, error) { var peer Peer + var err error + var newsrv *Server //var myContactCard meowlib.ContactCard peer.Uid = uuid.New().String() - peer.MyIdentity = meowlib.NewKeyPair() - peer.MyEncryptionKp = meowlib.NewKeyPair() - peer.MyLookupKp = meowlib.NewKeyPair() + peer.MyIdentity, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + peer.MyEncryptionKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + peer.MyLookupKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } if ContactName != "" { peer.Name = ContactName } else { @@ -135,7 +157,8 @@ func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageS peer.InvitationMessage = ReceivedContact.InvitationMessage for srv := range ReceivedContact.PullServers { peer.ContactPullServers = append(peer.ContactPullServers, ReceivedContact.PullServers[srv].GetUid()) - id.MessageServers.StoreServerIfNotExists(CreateServerFromUid(ReceivedContact.PullServers[srv].GetUid())) + newsrv, err = CreateServerFromUid(ReceivedContact.PullServers[srv].GetUid()) + id.MessageServers.StoreServerIfNotExists(newsrv) } /* for _, i := range MessageServerIdxs { srv := id.MessageServers.Servers[i].GetServerCard() @@ -150,11 +173,13 @@ func (id *Identity) AnswerInvitation(MyName string, ContactName string, MessageS peer.InvitationId = ReceivedContact.InvitationId id.Peers.StorePeer(&peer) - return &peer + return &peer, nil } // Finalizes an invitation, returns nil if successful func (id *Identity) FinalizeInvitation(ReceivedContact *meowlib.ContactCard) error { + var err error + var newsrv *Server /*for i, p := range id.Peers { if p.InvitationId == ReceivedContact.InvitationId { //id.Peers[i].Name = ReceivedContact.Name @@ -171,7 +196,11 @@ func (id *Identity) FinalizeInvitation(ReceivedContact *meowlib.ContactCard) err } return errors.New("no matching contact found for invitationId " + ReceivedContact.InvitationId)*/ for srv := range ReceivedContact.PullServers { - id.MessageServers.StoreServerIfNotExists(CreateServerFromUid(ReceivedContact.PullServers[srv].GetUid())) + newsrv, err = CreateServerFromUid(ReceivedContact.PullServers[srv].GetUid()) + if err != nil { + return err + } + id.MessageServers.StoreServerIfNotExists(newsrv) } return id.Peers.FinalizeInvitation(ReceivedContact) } @@ -251,16 +280,26 @@ func (id *Identity) HidePeer(peerIdx int, password string) error { return nil }*/ -func (id *Identity) generateRandomHiddenStuff() { +func (id *Identity) generateRandomHiddenStuff() error { + var err error r := rand.New(rand.NewSource(time.Now().UnixNano())) count := r.Intn(maxHiddenCount) + 1 for i := 1; i < count; i++ { var p Peer p.Uid = uuid.New().String() p.Name = randomLenString(4, 20) - p.MyEncryptionKp = meowlib.NewKeyPair() - p.MyIdentity = meowlib.NewKeyPair() - p.MyLookupKp = meowlib.NewKeyPair() + p.MyEncryptionKp, err = meowlib.NewKeyPair() + if err != nil { + return err + } + p.MyIdentity, err = meowlib.NewKeyPair() + if err != nil { + return err + } + p.MyLookupKp, err = meowlib.NewKeyPair() + if err != nil { + return err + } p.Name = randomLenString(4, 20) p.ContactPublicKey = p.MyLookupKp.Public p.ContactEncryption = p.MyIdentity.Public @@ -271,17 +310,18 @@ func (id *Identity) generateRandomHiddenStuff() { //id.HidePeer(0, randomLenString(8, 14)) // TODO Add random conversations } + return nil } type BackgroundJob struct { - RootPublic string `json:"root_public,omitempty"` - Device meowlib.KeyPair `json:"device,omitempty"` - Jobs []RequestsJob `json:"jobs,omitempty"` + RootPublic string `json:"root_public,omitempty"` + Device *meowlib.KeyPair `json:"device,omitempty"` + Jobs []RequestsJob `json:"jobs,omitempty"` } type RequestsJob struct { - Server *Server `json:"server,omitempty"` - LookupKeys []meowlib.KeyPair `json:"lookup_keys,omitempty"` + Server *Server `json:"server,omitempty"` + LookupKeys []*meowlib.KeyPair `json:"lookup_keys,omitempty"` } func (id *Identity) GetRequestJobs() []RequestsJob { diff --git a/client/identity_test.go b/client/identity_test.go index c370e3b..530f498 100644 --- a/client/identity_test.go +++ b/client/identity_test.go @@ -19,7 +19,7 @@ func exists(filename string) bool { } } -func createId() *Identity { +func createId(t *testing.T) *Identity { config := GetConfig() config.IdentityFile = "test.id" config.memoryPassword = "generalPassword" @@ -37,13 +37,34 @@ func createId() *Identity { var p Peer p.Uid = uuid.New().String() p.Name = "testName_" + strconv.Itoa(i) - p.MyEncryptionKp = meowlib.NewKeyPair() - p.MyIdentity = meowlib.NewKeyPair() - p.MyLookupKp = meowlib.NewKeyPair() + p.MyEncryptionKp, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + p.MyIdentity, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + p.MyLookupKp, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } p.Name = "foo_" + strconv.Itoa(i) - p.ContactPublicKey = meowlib.NewKeyPair().Public - p.ContactEncryption = meowlib.NewKeyPair().Public - p.ContactLookupKey = meowlib.NewKeyPair().Public + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + p.ContactPublicKey = k.Public + k, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + p.ContactEncryption = k.Public + k, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + p.ContactLookupKey = k.Public p.MyPullServers = []string{"server1", "server2"} //p.Contact.AddUrls([]string{"http:/127.0.0.1/meow", "tcp://localhost:1234"}) //todo add servers id.Peers.StorePeer(&p) @@ -98,7 +119,7 @@ func TestHidePeer(t *testing.T) { // test GetRequestJobs func TestGetRequestJobs(t *testing.T) { // Create a mock Identity object - id := createId() + id := createId(t) id.MessageServers = ServerStorage{ DbFile: "test.db", } @@ -106,7 +127,10 @@ func TestGetRequestJobs(t *testing.T) { GetConfig().SetIdentity(id) for i := 1; i < 10; i++ { // initialize a Server with name "server+i" - srv := CreateServerFromUrl("server" + strconv.Itoa(i)) + srv, err := CreateServerFromUrl("server" + strconv.Itoa(i)) + if err != nil { + t.Fatal(err) + } id.MessageServers.StoreServer(srv) } // Call GetRequestJobs diff --git a/client/matriochka.go b/client/matriochka.go index 012c36e..a353fad 100644 --- a/client/matriochka.go +++ b/client/matriochka.go @@ -8,7 +8,7 @@ import ( func ProcessForOutput(usermessage *meowlib.UserMessage, peer *Peer, servers *ServerList, trackingLookupKey string) ([]byte, error) { lastIdx := len(servers.Servers) - 1 // LAST SERVER : Message delivery as usual - srv := &servers.Servers[lastIdx] + srv := servers.Servers[lastIdx] // Prepare cyphered + packed user message packedMsg, err := peer.ProcessOutboundUserMessage(usermessage) if err != nil { @@ -23,7 +23,7 @@ func ProcessForOutput(usermessage *meowlib.UserMessage, peer *Peer, servers *Ser lastuuid := uuid.NewString() // ALL PREVIOUS SERVERS for i := lastIdx - 1; i >= 0; i-- { - srv = &servers.Servers[i] + srv = servers.Servers[i] var toServerMessage meowlib.ToServerMessage toServerMessage.MatriochkaMessage.Data = lastmsg toServerMessage.MatriochkaMessage.Next.Url = servers.Servers[i+1].Url diff --git a/client/messagestorage.go b/client/messagestorage.go index 83de46a..c3a492f 100644 --- a/client/messagestorage.go +++ b/client/messagestorage.go @@ -30,7 +30,11 @@ func StoreMessage(peer *Peer, usermessage *meowlib.UserMessage, filenames []stri } file.Close() peer.DbIds = append(peer.DbIds, dbid) - sqliteDatabase, _ := sql.Open("sqlite3", filepath.Join(cfg.StoragePath, identity.Uuid, dbid+GetConfig().DbSuffix)) // Open the created SQLite File + sqliteDatabase, err := sql.Open("sqlite3", filepath.Join(cfg.StoragePath, identity.Uuid, dbid+GetConfig().DbSuffix)) + if err != nil { + return err + } + defer sqliteDatabase.Close() err = createMessageTable(sqliteDatabase) if err != nil { return err diff --git a/client/messagestorage_test.go b/client/messagestorage_test.go index 215421b..f25b54b 100644 --- a/client/messagestorage_test.go +++ b/client/messagestorage_test.go @@ -11,7 +11,7 @@ import ( ) func TestStoreMessage(t *testing.T) { - id := createId() + id := createId(t) var um meowlib.UserMessage um.Data = []byte("blabla") peers, err := id.Peers.GetPeers() @@ -45,7 +45,7 @@ func TestStoreMessage(t *testing.T) { } func TestManyStoreMessage(t *testing.T) { - id := createId() + id := createId(t) peers, err := id.Peers.GetPeers() // test with zero messages messages, err := GetMessagesHistory(peers[0], 0, 0, 10, GetConfig().memoryPassword) diff --git a/client/peer.go b/client/peer.go index 58276b6..5912be3 100644 --- a/client/peer.go +++ b/client/peer.go @@ -23,10 +23,10 @@ type Peer struct { MyAvatar string `json:"my_avatar,omitempty"` // Conversation []InternalMessage `json:"conversation,omitempty"` // My own keys for that peer - MyIdentity meowlib.KeyPair `json:"my_identity,omitempty"` - MyEncryptionKp meowlib.KeyPair `json:"my_encryption_kp,omitempty"` - MyLookupKp meowlib.KeyPair `json:"my_lookup_kp,omitempty"` - MyPullServers []string `json:"my_pull_servers,omitempty"` + MyIdentity *meowlib.KeyPair `json:"my_identity,omitempty"` + MyEncryptionKp *meowlib.KeyPair `json:"my_encryption_kp,omitempty"` + MyLookupKp *meowlib.KeyPair `json:"my_lookup_kp,omitempty"` + MyPullServers []string `json:"my_pull_servers,omitempty"` // Peer keys and infos //Contact meowlib.ContactCard `json:"contact,omitempty"` // todo : remove ContactPublicKey string `json:"contact_public_key,omitempty"` diff --git a/client/peerstorage_test.go b/client/peerstorage_test.go index 7e79f84..d402829 100644 --- a/client/peerstorage_test.go +++ b/client/peerstorage_test.go @@ -20,7 +20,7 @@ func TestOpen(t *testing.T) { } func TestStorePeer(t *testing.T) { - id := createId() + id := createId(t) GetConfig().SetMemPass("test") GetConfig().SetIdentity(id) ps := &PeerStorage{ diff --git a/client/server.go b/client/server.go index cfb081d..8d444ec 100644 --- a/client/server.go +++ b/client/server.go @@ -18,38 +18,46 @@ import ( // - Server remote management if ManagerKp is available for that server type Server struct { //ServerCard meowlib.ServerCard `json:"server_data,omitempty"` - Name string `json:"name,omitempty"` - Description string `json:"description,omitempty"` - PublicKey string `json:"public_key,omitempty"` - Url string `json:"url,omitempty"` - Login string `json:"login,omitempty"` - Password string `json:"password,omitempty"` - Presence bool `json:"presence,omitempty"` - LastCheck time.Time `json:"last_check,omitempty"` - Uptime time.Duration `json:"uptime,omitempty"` - UserKp meowlib.KeyPair `json:"user_kp,omitempty"` - ManagerKp meowlib.KeyPair `json:"manager_kp,omitempty"` - Country string `json:"country,omitempty"` - AllowedDelay int `json:"allowed_delay,omitempty"` - Backup bool `json:"backup,omitempty"` - WebRTC bool `json:"webrtc,omitempty"` + Name string `json:"name,omitempty"` + Description string `json:"description,omitempty"` + PublicKey string `json:"public_key,omitempty"` + Url string `json:"url,omitempty"` + Login string `json:"login,omitempty"` + Password string `json:"password,omitempty"` + Presence bool `json:"presence,omitempty"` + LastCheck time.Time `json:"last_check,omitempty"` + Uptime time.Duration `json:"uptime,omitempty"` + UserKp *meowlib.KeyPair `json:"user_kp,omitempty"` + ManagerKp *meowlib.KeyPair `json:"manager_kp,omitempty"` + Country string `json:"country,omitempty"` + AllowedDelay int `json:"allowed_delay,omitempty"` + Backup bool `json:"backup,omitempty"` + WebRTC bool `json:"webrtc,omitempty"` } // CreateServerFromUrl creates a server from a basic url, ex : https://my.meowserver.example:8443/meow/ -func CreateServerFromUrl(url string) *Server { +func CreateServerFromUrl(url string) (*Server, error) { var is Server + var err error is.Name = url is.Url = url - is.UserKp = meowlib.NewKeyPair() - return &is + is.UserKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + return &is, nil } // CreateServerFromUid creates a server from a uid string, ex : mylogin:mypassword@https://my.meowserver.example:8443/meow/ -func CreateServerFromUid(uid string) *Server { +func CreateServerFromUid(uid string) (*Server, error) { var is Server + var err error uidTable := strings.Split(uid, "@") //! Weak test, use regexp is.Name = uid - is.UserKp = meowlib.NewKeyPair() + is.UserKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } if len(uidTable) == 2 { loginpw := strings.Split(uidTable[0], ":") is.Url = uidTable[1] @@ -58,17 +66,17 @@ func CreateServerFromUid(uid string) *Server { } else { is.Url = uidTable[0] } - return &is + return &is, nil } // CreateServerFromMeowUrl creates a server from a meow url, ex : meow://mylogin:mypassword@https://my.meowserver.example:8443/meow/ -func CreateServerFromMeowUrl(meowurl string) *Server { +func CreateServerFromMeowUrl(meowurl string) (*Server, error) { uid := strings.Replace(meowurl[7:], "//", "://", 1) return CreateServerFromUid(uid) } // CreateServerFromInvitationLink creates a server from a meow url, ex : meow://mylogin:mypassword@https://my.meowserver.example:8443/meow?invitationCode -func CreateServerFromInvitationLink(meowurl string) *Server { +func CreateServerFromInvitationLink(meowurl string) (*Server, error) { // remove the invitation code, last token after a / meowurlTable := strings.Split(meowurl, "?") // join all elements with / except the last one @@ -103,16 +111,20 @@ func (sc *Server) GetMeowUrl() string { } // Create a server from a server card -func CreateServerFromServerCard(server *meowlib.ServerCard) *Server { +func CreateServerFromServerCard(server *meowlib.ServerCard) (*Server, error) { var is Server + var err error is.Name = server.Name is.PublicKey = server.PublicKey is.Description = server.Description is.Url = server.Url is.Login = server.Login is.Password = server.Password - is.UserKp = meowlib.NewKeyPair() - return &is + is.UserKp, err = meowlib.NewKeyPair() + if err != nil { + return nil, err + } + return &is, nil } // AsymEncryptMessage prepares a message to send to a specific internal server diff --git a/client/serverlist.go b/client/serverlist.go index 86a5940..6342846 100644 --- a/client/serverlist.go +++ b/client/serverlist.go @@ -8,13 +8,13 @@ import "errors" // - Owned servers lists // - Matriochka paths type ServerList struct { - Name string `json:"name,omitempty"` - Servers []Server `json:"servers,omitempty"` + Name string `json:"name,omitempty"` + Servers []*Server `json:"servers,omitempty"` } // FilterByIdxs returns a filtered server list filtered according to an index list func (sl *ServerList) FilterByIdxs(MessageServerIdxs []int) (filtered *ServerList, err error) { - filtered.Servers = []Server{} + filtered.Servers = []*Server{} for _, i := range MessageServerIdxs { if i > len(sl.Servers)-1 { return nil, errors.New("requested server out of range of defined message servers") @@ -31,22 +31,27 @@ func (sl *ServerList) GetServerByIdx(idx int) (server *Server, err error) { if idx > len(sl.Servers)-1 { return nil, errors.New("requested server out of range of defined message servers") } - return &sl.Servers[idx], nil + return sl.Servers[idx], nil } // GetServerByPubkey returns a server from it's public key func (sl *ServerList) GetServerByPubkey(pubkey string) (filtered *Server) { for _, srv := range sl.Servers { if srv.PublicKey == pubkey { - return &srv + return srv } } return nil } // AddUrls is a simple utility functon used mainly as a shortcut for testing purposes -func (sl *ServerList) AddUrls(urls []string) { +func (sl *ServerList) AddUrls(urls []string) error { for _, url := range urls { - sl.Servers = append(sl.Servers, *CreateServerFromUrl(url)) + srvnew, err := CreateServerFromUrl(url) + if err != nil { + return err + } + sl.Servers = append(sl.Servers, srvnew) } + return nil } diff --git a/client/serverstorage_test.go b/client/serverstorage_test.go index a1cefa6..a42dd42 100644 --- a/client/serverstorage_test.go +++ b/client/serverstorage_test.go @@ -9,10 +9,14 @@ import ( ) func TestGetUid(t *testing.T) { + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } srv := Server{ Name: "test", Url: "http://127.0.0.1:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } uid := srv.GetUid() if uid != "http://127.0.0.1:8080" { @@ -21,14 +25,18 @@ func TestGetUid(t *testing.T) { } func TestStoreServer(t *testing.T) { - createId() + createId(t) ss := ServerStorage{DbFile: "test.db"} + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } srv := Server{ Name: "test", Url: "http://127.0.0.1", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } - err := ss.StoreServer(&srv) + err = ss.StoreServer(&srv) if err != nil { log.Fatal(err) } @@ -49,15 +57,19 @@ func TestStoreServer(t *testing.T) { } func TestLoadServersFromUids(t *testing.T) { - createId() + createId(t) GetConfig().SetMemPass("test") ss := ServerStorage{DbFile: "test.db"} + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } srv := Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } - err := ss.StoreServer(&srv) + err = ss.StoreServer(&srv) if err != nil { log.Fatal(err) } @@ -77,14 +89,18 @@ func TestLoadServersFromUids(t *testing.T) { } func TestLoadServerCardsFromUids(t *testing.T) { - createId() + createId(t) ss := ServerStorage{DbFile: "test.db"} + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } srv := Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } - err := ss.StoreServer(&srv) + err = ss.StoreServer(&srv) if err != nil { log.Fatal(err) } @@ -104,13 +120,16 @@ func TestLoadServerCardsFromUids(t *testing.T) { } func TestServerExists(t *testing.T) { - createId() + createId(t) ss := ServerStorage{DbFile: "test.db"} - + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } server := &Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } // Check if server exists before storing it @@ -142,13 +161,16 @@ func TestServerExists(t *testing.T) { } func TestStoreServerIfNotExists(t *testing.T) { - createId() + createId(t) ss := ServerStorage{DbFile: "test.db"} - + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } server := &Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } // Check if server exists before storing it @@ -181,26 +203,32 @@ func TestStoreServerIfNotExists(t *testing.T) { } func TestStoreServerIfNotExists_ServerExists(t *testing.T) { - createId() + createId(t) ss := ServerStorage{DbFile: "test.db"} - + k, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } server := &Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } // Store the server - err := ss.StoreServer(server) + err = ss.StoreServer(server) if err != nil { t.Errorf("Failed to store server: %v", err) } - + k, err = meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } // Store the server again with a different public key newServer := &Server{ Name: "test", Url: "http://localhost:8080", - PublicKey: meowlib.NewKeyPair().Public, + PublicKey: k.Public, } err = ss.StoreServerIfNotExists(newServer) diff --git a/contactcard_test.go b/contactcard_test.go index 9ca34f8..5403a31 100644 --- a/contactcard_test.go +++ b/contactcard_test.go @@ -8,9 +8,18 @@ import ( ) func TestCompressAndJson(t *testing.T) { - kp1 := NewKeyPair() - kp2 := NewKeyPair() - kp3 := NewKeyPair() + kp1, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } + kp2, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } + kp3, err := NewKeyPair() + if err != nil { + t.Fatal(err) + } var cc ContactCard cc.Name = "My Full Name And It's loooong" cc.ContactPublicKey = kp1.Public diff --git a/endtoend_test.go b/endtoend_test.go index a6d205f..536a5c4 100644 --- a/endtoend_test.go +++ b/endtoend_test.go @@ -58,15 +58,25 @@ func TestEndToEnd(t *testing.T) { var ReceivedContact meowlib.ContactCard // Friend simulated invitation - FirstFriendContactKp := meowlib.NewKeyPair() - FirstFriendEncryptionKp := meowlib.NewKeyPair() - FirstFriendLookupKp := meowlib.NewKeyPair() + FirstFriendContactKp, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + FirstFriendEncryptionKp, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } + FirstFriendLookupKp, err := meowlib.NewKeyPair() + if err != nil { + t.Fatal(err) + } ReceivedContact.Name = "I'm the friend" ReceivedContact.ContactPublicKey = FirstFriendContactKp.Public ReceivedContact.EncryptionPublicKey = FirstFriendEncryptionKp.Public ReceivedContact.LookupPublicKey = FirstFriendLookupKp.Public ReceivedContact.InvitationId = peer.GetMyContact().InvitationId - FriendServer1KP := meowlib.NewKeyPair() + FriendServer1KP, err := meowlib.NewKeyPair() + FriendServer1 := meowlib.ServerCard{Name: "FriendServer1", Url: "http://myfriend.org/meow/", PublicKey: FriendServer1KP.Public, Description: "Fancy description"} ReceivedContact.PullServers = append(ReceivedContact.PullServers, &FriendServer1) @@ -76,9 +86,8 @@ func TestEndToEnd(t *testing.T) { Me.FinalizeInvitation(&ReceivedContact) err = Me.Save() if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } - a, _ = json.Marshal(Me) os.WriteFile("id.json", a, 0644) fmt.Println(string(a)) @@ -91,16 +100,16 @@ func TestEndToEnd(t *testing.T) { // Creating User message usermessage, err := MyFirstFriend.BuildSimpleUserMessage([]byte(textmessage)) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } serializedMessage, err := MyFirstFriend.SerializeUserMessage(usermessage) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Encrypting it enc, err := MyFirstFriend.AsymEncryptMessage(serializedMessage) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Packing it @@ -108,22 +117,22 @@ func TestEndToEnd(t *testing.T) { intS1, err := Me.MessageServers.LoadServer("http://127.0.0.1/meow/") if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Creating Server message for transporting the user message toServerMessage, err := intS1.BuildMessageSendingMessage(packedMsg) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Encrypting it encToServer, err := intS1.AsymEncryptMessage(toServerMessage) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Packing it protoPackedServerMsg, err := intS1.PackServerMessage(encToServer.Data, encToServer.Signature) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } /////////////////////// // Sending to server // @@ -143,34 +152,34 @@ func TestEndToEnd(t *testing.T) { // Unpack srv_from, srv_encmsg, srv_signature, err := server1.UnpackReceived(protoPackedServerMsg) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Decrypt srv_clear, err := server1.AsymDecryptMessage(srv_from, srv_encmsg, srv_signature) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Decode msg srv_msg, err := server1.DeserializeToServerMessage(srv_clear) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } // Response : Ack received message srv_fromServerMessage, err := server1.BuildSimpleAckResponseMessage(srv_msg.Uuid) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } encoded_srv_fromServerMessage, err := server1.SerializeFromServerMessage(srv_fromServerMessage) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } srv_resp, err := server1.AsymEncryptMessage(srv_from, encoded_srv_fromServerMessage) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } resp, err := server1.PackForSending(srv_resp.Data, srv_resp.Signature) if err != nil { - fmt.Println(err.Error()) + t.Fatal(err) } print(resp) ////////////////////////////////////////////// diff --git a/go.sum b/go.sum index fa733fc..6db4c25 100644 --- a/go.sum +++ b/go.sum @@ -3,15 +3,10 @@ github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOv github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/OneOfOne/xxhash v1.2.2 h1:KMrpdQIwFcEqXDklaen+P1axHaj9BSKzvpUUfnHldSE= github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAElWljhcU= -github.com/ProtonMail/go-crypto v0.0.0-20230717121422-5aa5874ade95/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= -github.com/ProtonMail/go-crypto v1.0.0 h1:LRuvITjQWX+WIfr930YHG2HNfjR1uOfyf5vE0kC2U78= -github.com/ProtonMail/go-crypto v1.0.0/go.mod h1:EjAoLdwvbIOoOQr3ihjnSoLZRtE8azugULFRteWMNc0= github.com/ProtonMail/go-crypto v1.2.0 h1:+PhXXn4SPGd+qk76TlEePBfOfivE0zkWFenhGhFLzWs= github.com/ProtonMail/go-crypto v1.2.0/go.mod h1:9whxjD8Rbs29b4XWbB8irEcE8KHMqaR2e7GWU1R+/PE= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f h1:tCbYj7/299ekTTXpdwKYF8eBlsYsDVoggDAuAjoK66k= github.com/ProtonMail/go-mime v0.0.0-20230322103455-7d82a3887f2f/go.mod h1:gcr0kNtGBqin9zDW9GOHcVntrwnjrK+qdJ06mWYBybw= -github.com/ProtonMail/gopenpgp/v2 v2.7.5 h1:STOY3vgES59gNgoOt2w0nyHBjKViB/qSg7NjbQWPJkA= -github.com/ProtonMail/gopenpgp/v2 v2.7.5/go.mod h1:IhkNEDaxec6NyzSI0PlxapinnwPVIESk8/76da3Ct3g= github.com/ProtonMail/gopenpgp/v2 v2.8.3 h1:1jHlELwCR00qovx2B50DkL/FjYwt/P91RnlsqeOp2Hs= github.com/ProtonMail/gopenpgp/v2 v2.8.3/go.mod h1:LiuOTbnJit8w9ZzOoLscj0kmdALY7hfoCVh5Qlb0bcg= github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8= @@ -19,14 +14,10 @@ github.com/benbjohnson/clock v1.3.5 h1:VvXlSJBzZpA/zum6Sj74hxwYI2DIxRWuNIoXAzHZz github.com/benbjohnson/clock v1.3.5/go.mod h1:J11/hYXuz8f4ySSvYwY0FKfm+ezbsZBKZxNJlLklBHA= github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM= github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw= -github.com/bwesterb/go-ristretto v1.2.3/go.mod h1:fUIoIZaG73pV5biE2Blr2xEzDoMj7NFEuV9ekS419A0= github.com/cespare/xxhash v1.1.0 h1:a6HrQnmkObjyL+Gs60czilIUGqrzKutQD6XZog3p+ko= github.com/cespare/xxhash v1.1.0/go.mod h1:XrSqR1VqqWfGrhpAt58auRo0WTKS1nRRg3ghfAqPWnc= github.com/cespare/xxhash/v2 v2.2.0 h1:DC2CZ1Ep5Y4k3ZQ899DldepgrayRUGE6BBZ/cd9Cj44= github.com/cespare/xxhash/v2 v2.2.0/go.mod h1:VGX0DQ3Q6kWi7AoAeZDth3/j3BFtOZR5XLFGgcrjCOs= -github.com/cloudflare/circl v1.3.3/go.mod h1:5XYMA4rFBvNIrhs50XuiBJ15vF2pZn4nnUKZrLbUZFA= -github.com/cloudflare/circl v1.3.7 h1:qlCDlTPz2n9fu58M0Nh1J/JzcFpfgkFHHX3O35r5vcU= -github.com/cloudflare/circl v1.3.7/go.mod h1:sRTcRWXGLrKw6yIGJ+l7amYJFfAXbZG0kBSc8r4zxgA= github.com/cloudflare/circl v1.6.1 h1:zqIqSPIndyBh1bjLVVDHMPpVKqp8Su/V+6MeDzzQBQ0= github.com/cloudflare/circl v1.6.1/go.mod h1:uddAzsPgqdMAYatqJ0lsjX1oECcQLIlRpzZh3pJrofs= github.com/coreos/etcd v3.3.10+incompatible/go.mod h1:uF7uidLiAD3TWHmW31ZFd/JWoc32PjwdhPthX9715RE= @@ -117,7 +108,6 @@ github.com/livekit/psrpc v0.5.3-0.20240228172457-3724cb4adbc4/go.mod h1:CQUBSPfY github.com/magiconair/properties v1.8.0/go.mod h1:PppfXfuXeibc/6YijjN8zIbojt8czPbwD3XqdrwzmxQ= github.com/makiuchi-d/gozxing v0.1.1 h1:xxqijhoedi+/lZlhINteGbywIrewVdVv2wl9r5O9S1I= github.com/makiuchi-d/gozxing v0.1.1/go.mod h1:eRIHbOjX7QWxLIDJoQuMLhuXg9LAuw6znsUtRkNw9DU= -github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA= github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg= github.com/mattn/go-colorable v0.1.14 h1:9A9LHSqF/7dyVVX6g0U9cwm9pG3kP9gSzcuIPHPsaIE= github.com/mattn/go-colorable v0.1.14/go.mod h1:6LmQG8QLFO4G5z1gPvYEzlUgJ2wF+stgPZH1UqBm1s8= @@ -200,10 +190,7 @@ github.com/redis/go-redis/v9 v9.5.1/go.mod h1:hdY0cQFCN4fnSYT6TkisLufl/4W5UIXyv0 github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs= github.com/rogpeppe/go-internal v1.11.0 h1:cWPaGQEPrBb5/AsnsZesgZZ9yb1OQ+GOISoDNXVBh4M= github.com/rogpeppe/go-internal v1.11.0/go.mod h1:ddIwULY96R17DhadqLgMfk9H9tvdUzkipdSkR5nkCZA= -github.com/rs/xid v1.5.0/go.mod h1:trrq9SKmegXys3aeAKXMUTdJsYXVwGY3RLcfgqegfbg= github.com/rs/xid v1.6.0/go.mod h1:7XoLgs4eV+QndskICGsho+ADou8ySMSjJKDIan90Nz0= -github.com/rs/zerolog v1.32.0 h1:keLypqrlIjaFsbmJOBdB/qvyF8KEtCWHwobLp5l/mQ0= -github.com/rs/zerolog v1.32.0/go.mod h1:/7mN4D5sKwJLZQ2b/znpjC3/GQWY/xaDXUM0kKWRHss= github.com/rs/zerolog v1.34.0 h1:k43nTLIwcTVQAncfCw4KZ2VY6ukYoZaBPNOE8txlOeY= github.com/rs/zerolog v1.34.0/go.mod h1:bJsvje4Z08ROH4Nhs5iH600c3IkWhwp44iRc54W6wYQ= github.com/russross/blackfriday v1.5.2/go.mod h1:JO/DiYxRf+HjHt06OyowR9PTA263kcR/rfWxYHBV53g= @@ -244,11 +231,7 @@ golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACk golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc= -golang.org/x/crypto v0.3.1-0.20221117191849-2c476679df9a/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4= -golang.org/x/crypto v0.7.0/go.mod h1:pYwdfH91IfpZVANVyUOhSIPZaFoJGxTFbZhFTx+dXZU= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= golang.org/x/crypto v0.37.0 h1:kJNSjF/Xp7kU0iB2Z+9viTPMW4EqqsrywMXLJOOsXSE= golang.org/x/crypto v0.37.0/go.mod h1:vg+k43peMZ0pUMhYmVAWysMK35e6ioLh3wB8ZCAfbVc= golang.org/x/exp v0.0.0-20240222234643-814bf88cf225 h1:LfspQV/FYTatPTr/3HzIcmiUFH7PGP+OQ6mgDYo3yuQ= @@ -263,9 +246,7 @@ golang.org/x/net v0.0.0-20200520004742-59133d7f0dd7/go.mod h1:qpuaurCH72eLCgpAm/ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg= golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c= -golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY= golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs= -golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc= golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.23.0 h1:7EYJ93RZ9vYSZAIb2x3lnuvqO5zneoD6IvWjuhfxjTs= golang.org/x/net v0.23.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= @@ -274,8 +255,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.6.0 h1:5BMeUDZ7vkXGfEr1x9B4bRcTH4lpkTkpdh0T/J+qjbQ= -golang.org/x/sync v0.6.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= +golang.org/x/sync v0.13.0 h1:AauUjRAJ9OSnvULf/ARrrVywoJDy0YS2AwQ98I37610= +golang.org/x/sync v0.13.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20181205085412-a5c9d58dba9a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= @@ -292,32 +273,24 @@ golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBc golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= -golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= -golang.org/x/sys v0.19.0 h1:q5f1RH2jigJ1MoAWp2KTp3gm5zAGFUTarQZ5U386+4o= -golang.org/x/sys v0.19.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= golang.org/x/sys v0.32.0 h1:s77OFDvIQeibCmezSnk/q6iAfkdiQaJi4VzroCFrN20= golang.org/x/sys v0.32.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= 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/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc= golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k= -golang.org/x/term v0.6.0/go.mod h1:m6U89DPEgQRMq3DNkDClhWw02AUbt2daBVO4cn4Hv9U= golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo= golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ= -golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8= -golang.org/x/text v0.14.0 h1:ScX5w1eTa3QqT8oi6+ziP7dTV1S2+ALU0bI+0zXKWiQ= golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU= golang.org/x/text v0.24.0 h1:dd5Bzh4yt5KYA8f9CJHCP4FB4D51c2c6JvN37xJJkJ0= golang.org/x/text v0.24.0/go.mod h1:L8rBsPeo2pSS+xqN0d5u2ikmjtmoJbDBT1b7nHvFCdU= @@ -330,8 +303,6 @@ golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8T golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= 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-20231012003039-104605ab7028 h1:+cNy6SZtPcJQH3LJVLOSmiC7MMxXNOb3PU/VUEz+EhU= -golang.org/x/xerrors v0.0.0-20231012003039-104605ab7028/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da h1:noIWHXmPHxILtqtCOPIhSt0ABwskkZKjD3bXGnZGpNY= golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da/go.mod h1:NDW/Ps6MPRej6fsCIbMTohpP40sJ/P/vI1MoTEGwX90= google.golang.org/genproto/googleapis/rpc v0.0.0-20240221002015-b0ce06bbee7c h1:NUsgEN92SQQqzfA+YtqYNqYmB3DMMYLlIwUZAQFVFbo= @@ -346,8 +317,6 @@ google.golang.org/protobuf v1.21.0/go.mod h1:47Nbq4nVaFHyn7ilMalzfO3qCViNmqZ2kzi google.golang.org/protobuf v1.23.0/go.mod h1:EGpADcykh3NcUnDUJcl1+ZksZNG86OlYog2l/sGQquU= google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw= google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc= -google.golang.org/protobuf v1.33.0 h1:uNO2rsAINq/JlFpSdYEKIZ0uKD/R9cpdv0T+yoGwGmI= -google.golang.org/protobuf v1.33.0/go.mod h1:c6P6GXX6sHbq/GpV6MGZEdwhWPcYBgnhAHhKbcUYpos= google.golang.org/protobuf v1.36.6 h1:z1NpPI8ku2WgiWnf+t9wTPsn6eP1L7ksHUlkfLvd9xY= google.golang.org/protobuf v1.36.6/go.mod h1:jduwjTPXsFjZGTmRluh+L6NjiWu7pchiJ2/5YcXBHnY= gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= diff --git a/messages.pb.go b/messages.pb.go index e4ea351..787fefc 100644 --- a/messages.pb.go +++ b/messages.pb.go @@ -12,8 +12,8 @@ // Code generated by protoc-gen-go. DO NOT EDIT. // versions: -// protoc-gen-go v1.32.0 -// protoc v4.25.2 +// protoc-gen-go v1.36.11 +// protoc v3.21.12 // source: messages.proto package meowlib @@ -23,6 +23,7 @@ import ( protoimpl "google.golang.org/protobuf/runtime/protoimpl" reflect "reflect" sync "sync" + unsafe "unsafe" ) const ( @@ -34,22 +35,19 @@ const ( // structure definnig a message as received by a server in protobuf format type PackedServerMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // The client public key for that server to get an answer + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // The ToServerMessage encrypted with the server public key |or| symetrical encryption as agreed earlier + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // The message signature with the client public key |eo| the reference to teh symetrical key used unknownFields protoimpl.UnknownFields - - From string `protobuf:"bytes,1,opt,name=from,proto3" json:"from,omitempty"` // The client public key for that server to get an answer - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // The ToServerMessage encrypted with the server public key |or| symetrical encryption as agreed earlier - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // The message signature with the client public key |eo| the reference to teh symetrical key used + sizeCache protoimpl.SizeCache } func (x *PackedServerMessage) Reset() { *x = PackedServerMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[0] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[0] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackedServerMessage) String() string { @@ -60,7 +58,7 @@ func (*PackedServerMessage) ProtoMessage() {} func (x *PackedServerMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[0] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -98,28 +96,25 @@ func (x *PackedServerMessage) GetSignature() []byte { // structure to hold an invitation through a server type Invitation struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // invitation payload, encrypted after step 2 + Timeout int32 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` // how long do I want the invitation to remain available on the server + ShortcodeLen int32 `protobuf:"varint,3,opt,name=shortcodeLen,proto3" json:"shortcodeLen,omitempty"` // len of the shortcode you wish for short url transmission + Shortcode string `protobuf:"bytes,4,opt,name=shortcode,proto3" json:"shortcode,omitempty"` // shortcode that the friend shall request to get the invitation + Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` // password to set for accessing invitation (optional) + Uuid string `protobuf:"bytes,6,opt,name=uuid,proto3" json:"uuid,omitempty"` // id that the friend gave you, that you should include to your reply to get recognized + Expiry int64 `protobuf:"varint,7,opt,name=expiry,proto3" json:"expiry,omitempty"` // the server allowed expiry date, it may be samller than the requested timeout according to server policy + Step int32 `protobuf:"varint,8,opt,name=step,proto3" json:"step,omitempty"` // progress in the inviattion process : 1=invite friend, 2=friend requests invitation, 3=friend's answer + From string `protobuf:"bytes,9,opt,name=from,proto3" json:"from,omitempty"` // used in step 3 the answer public key to check the signature in user message unknownFields protoimpl.UnknownFields - - Payload []byte `protobuf:"bytes,1,opt,name=payload,proto3" json:"payload,omitempty"` // invitation payload, encrypted after step 2 - Timeout int32 `protobuf:"varint,2,opt,name=timeout,proto3" json:"timeout,omitempty"` // how long do I want the invitation to remain available on the server - ShortcodeLen int32 `protobuf:"varint,3,opt,name=shortcodeLen,proto3" json:"shortcodeLen,omitempty"` // len of the shortcode you wish for short url transmission - Shortcode string `protobuf:"bytes,4,opt,name=shortcode,proto3" json:"shortcode,omitempty"` // shortcode that the friend shall request to get the invitation - Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"` // password to set for accessing invitation (optional) - Uuid string `protobuf:"bytes,6,opt,name=uuid,proto3" json:"uuid,omitempty"` // id that the friend gave you, that you should include to your reply to get recognized - Expiry int64 `protobuf:"varint,7,opt,name=expiry,proto3" json:"expiry,omitempty"` // the server allowed expiry date, it may be samller than the requested timeout according to server policy - Step int32 `protobuf:"varint,8,opt,name=step,proto3" json:"step,omitempty"` // progress in the inviattion process : 1=invite friend, 2=friend requests invitation, 3=friend's answer - From string `protobuf:"bytes,9,opt,name=from,proto3" json:"from,omitempty"` // used in step 3 the answer public key to check the signature in user message + sizeCache protoimpl.SizeCache } func (x *Invitation) Reset() { *x = Invitation{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[1] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[1] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Invitation) String() string { @@ -130,7 +125,7 @@ func (*Invitation) ProtoMessage() {} func (x *Invitation) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[1] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -210,23 +205,20 @@ func (x *Invitation) GetFrom() string { // structure for requesting incoming messages type ConversationRequest struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - LookupKey string `protobuf:"bytes,1,opt,name=lookup_key,json=lookupKey,proto3" json:"lookup_key,omitempty"` // lookup key for a conversation - DeliveryRequest bool `protobuf:"varint,2,opt,name=delivery_request,json=deliveryRequest,proto3" json:"delivery_request,omitempty"` // look for for delivery tracking, key is implicit, "from" field is used - SendTimestamp int64 `protobuf:"varint,3,opt,name=send_timestamp,json=sendTimestamp,proto3" json:"send_timestamp,omitempty"` - LookupSignature string `protobuf:"bytes,4,opt,name=lookup_signature,json=lookupSignature,proto3" json:"lookup_signature,omitempty"` // prove that I own the private key by signing that block + state protoimpl.MessageState `protogen:"open.v1"` + LookupKey string `protobuf:"bytes,1,opt,name=lookup_key,json=lookupKey,proto3" json:"lookup_key,omitempty"` // lookup key for a conversation + DeliveryRequest bool `protobuf:"varint,2,opt,name=delivery_request,json=deliveryRequest,proto3" json:"delivery_request,omitempty"` // look for for delivery tracking, key is implicit, "from" field is used + SendTimestamp int64 `protobuf:"varint,3,opt,name=send_timestamp,json=sendTimestamp,proto3" json:"send_timestamp,omitempty"` + LookupSignature string `protobuf:"bytes,4,opt,name=lookup_signature,json=lookupSignature,proto3" json:"lookup_signature,omitempty"` // prove that I own the private key by signing that block + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ConversationRequest) Reset() { *x = ConversationRequest{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[2] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[2] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConversationRequest) String() string { @@ -237,7 +229,7 @@ func (*ConversationRequest) ProtoMessage() {} func (x *ConversationRequest) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[2] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -281,22 +273,19 @@ func (x *ConversationRequest) GetLookupSignature() string { } type Meet struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + PublicStatus string `protobuf:"bytes,1,opt,name=public_status,json=publicStatus,proto3" json:"public_status,omitempty"` // Publish my online status, if the server is a meeting server + ContactCard *ContactCard `protobuf:"bytes,2,opt,name=contact_card,json=contactCard,proto3" json:"contact_card,omitempty"` // mine or the requester + Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // short description unknownFields protoimpl.UnknownFields - - PublicStatus string `protobuf:"bytes,1,opt,name=public_status,json=publicStatus,proto3" json:"public_status,omitempty"` // Publish my online status, if the server is a meeting server - ContactCard *ContactCard `protobuf:"bytes,2,opt,name=contact_card,json=contactCard,proto3" json:"contact_card,omitempty"` // mine or the requester - Message string `protobuf:"bytes,3,opt,name=message,proto3" json:"message,omitempty"` // short description + sizeCache protoimpl.SizeCache } func (x *Meet) Reset() { *x = Meet{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[3] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[3] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Meet) String() string { @@ -307,7 +296,7 @@ func (*Meet) ProtoMessage() {} func (x *Meet) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[3] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -344,23 +333,20 @@ func (x *Meet) GetMessage() string { } type Credentials struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // login + Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // password + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key + PrivateKey string `protobuf:"bytes,4,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` // private key unknownFields protoimpl.UnknownFields - - Login string `protobuf:"bytes,1,opt,name=login,proto3" json:"login,omitempty"` // login - Password string `protobuf:"bytes,2,opt,name=password,proto3" json:"password,omitempty"` // password - PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key - PrivateKey string `protobuf:"bytes,4,opt,name=private_key,json=privateKey,proto3" json:"private_key,omitempty"` // private key + sizeCache protoimpl.SizeCache } func (x *Credentials) Reset() { *x = Credentials{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[4] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[4] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Credentials) String() string { @@ -371,7 +357,7 @@ func (*Credentials) ProtoMessage() {} func (x *Credentials) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[4] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -416,10 +402,7 @@ func (x *Credentials) GetPrivateKey() string { // structure defining a message for a server, that will be encrypted, then sent in a "packedmessage" payload type ToServerMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - + state protoimpl.MessageState `protogen:"open.v1"` Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Type 1 : final destination / 2 : forward From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // My pub key for the server to send me an encrypter answer Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // optional payload for server @@ -433,15 +416,15 @@ type ToServerMessage struct { Timeout int64 `protobuf:"varint,11,opt,name=timeout,proto3" json:"timeout,omitempty"` // timeout expected by the client for the server to answer (long polling) VideoData *VideoData `protobuf:"bytes,12,opt,name=video_data,json=videoData,proto3" json:"video_data,omitempty"` // video call data Credentials *Credentials `protobuf:"bytes,13,opt,name=credentials,proto3" json:"credentials,omitempty"` // credentials for a new user or mandatory server creds + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ToServerMessage) Reset() { *x = ToServerMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[5] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[5] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ToServerMessage) String() string { @@ -452,7 +435,7 @@ func (*ToServerMessage) ProtoMessage() {} func (x *ToServerMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[5] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -560,30 +543,27 @@ func (x *ToServerMessage) GetCredentials() *Credentials { // structure defining a from server receiver message decrypted from a "packedmessage" payload type FromServerMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Type - ServerPublicKey string `protobuf:"bytes,2,opt,name=server_public_key,json=serverPublicKey,proto3" json:"server_public_key,omitempty"` // Pub key from the server - Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // - UuidAck string `protobuf:"bytes,4,opt,name=uuid_ack,json=uuidAck,proto3" json:"uuid_ack,omitempty"` // Ack for the last received ToServerMessage Uuid - ServerUuid string `protobuf:"bytes,5,opt,name=server_uuid,json=serverUuid,proto3" json:"server_uuid,omitempty"` // Provides the server uuid that replaced the client uuid - Chat []*PackedUserMessage `protobuf:"bytes,6,rep,name=chat,proto3" json:"chat,omitempty"` - KnownServers []*ServerCard `protobuf:"bytes,7,rep,name=known_servers,json=knownServers,proto3" json:"known_servers,omitempty"` - Invitation *Invitation `protobuf:"bytes,8,opt,name=invitation,proto3" json:"invitation,omitempty"` // invitation answer, for the third steps of any invitation - DeviceMessages []*PackedUserMessage `protobuf:"bytes,9,rep,name=device_messages,json=deviceMessages,proto3" json:"device_messages,omitempty"` // messages from other devices belonging to the same user - VideoData *VideoData `protobuf:"bytes,10,opt,name=video_data,json=videoData,proto3" json:"video_data,omitempty"` // video call data - ContactCard []*ContactCard `protobuf:"bytes,11,rep,name=contact_card,json=contactCard,proto3" json:"contact_card,omitempty"` // contact list for a personae + state protoimpl.MessageState `protogen:"open.v1"` + Type string `protobuf:"bytes,1,opt,name=type,proto3" json:"type,omitempty"` // Type + ServerPublicKey string `protobuf:"bytes,2,opt,name=server_public_key,json=serverPublicKey,proto3" json:"server_public_key,omitempty"` // Pub key from the server + Payload []byte `protobuf:"bytes,3,opt,name=payload,proto3" json:"payload,omitempty"` // + UuidAck string `protobuf:"bytes,4,opt,name=uuid_ack,json=uuidAck,proto3" json:"uuid_ack,omitempty"` // Ack for the last received ToServerMessage Uuid + ServerUuid string `protobuf:"bytes,5,opt,name=server_uuid,json=serverUuid,proto3" json:"server_uuid,omitempty"` // Provides the server uuid that replaced the client uuid + Chat []*PackedUserMessage `protobuf:"bytes,6,rep,name=chat,proto3" json:"chat,omitempty"` + KnownServers []*ServerCard `protobuf:"bytes,7,rep,name=known_servers,json=knownServers,proto3" json:"known_servers,omitempty"` + Invitation *Invitation `protobuf:"bytes,8,opt,name=invitation,proto3" json:"invitation,omitempty"` // invitation answer, for the third steps of any invitation + DeviceMessages []*PackedUserMessage `protobuf:"bytes,9,rep,name=device_messages,json=deviceMessages,proto3" json:"device_messages,omitempty"` // messages from other devices belonging to the same user + VideoData *VideoData `protobuf:"bytes,10,opt,name=video_data,json=videoData,proto3" json:"video_data,omitempty"` // video call data + ContactCard []*ContactCard `protobuf:"bytes,11,rep,name=contact_card,json=contactCard,proto3" json:"contact_card,omitempty"` // contact list for a personae + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *FromServerMessage) Reset() { *x = FromServerMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[6] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[6] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *FromServerMessage) String() string { @@ -594,7 +574,7 @@ func (*FromServerMessage) ProtoMessage() {} func (x *FromServerMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[6] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -687,23 +667,20 @@ func (x *FromServerMessage) GetContactCard() []*ContactCard { } type MatriochkaServer struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // Server Url + PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` // Server Public Key + Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"` // Optional, uuid for delivery confirmation + Delay int32 `protobuf:"varint,4,opt,name=delay,proto3" json:"delay,omitempty"` // Max delay requested for message forwarding or delivery tracking unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` // Server Url - PublicKey string `protobuf:"bytes,2,opt,name=publicKey,proto3" json:"publicKey,omitempty"` // Server Public Key - Uuid string `protobuf:"bytes,3,opt,name=uuid,proto3" json:"uuid,omitempty"` // Optional, uuid for delivery confirmation - Delay int32 `protobuf:"varint,4,opt,name=delay,proto3" json:"delay,omitempty"` // Max delay requested for message forwarding or delivery tracking + sizeCache protoimpl.SizeCache } func (x *MatriochkaServer) Reset() { *x = MatriochkaServer{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[7] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[7] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *MatriochkaServer) String() string { @@ -714,7 +691,7 @@ func (*MatriochkaServer) ProtoMessage() {} func (x *MatriochkaServer) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[7] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -758,23 +735,20 @@ func (x *MatriochkaServer) GetDelay() int32 { } type Matriochka struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + LookupKey string `protobuf:"bytes,1,opt,name=lookupKey,proto3" json:"lookupKey,omitempty"` // Optional, only if you want delivery tracking, less stealth + Prev *MatriochkaServer `protobuf:"bytes,2,opt,name=prev,proto3" json:"prev,omitempty"` // Optional, like above + Next *MatriochkaServer `protobuf:"bytes,3,opt,name=next,proto3" json:"next,omitempty"` // Next server to deliver the message to + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // Matriochka data unknownFields protoimpl.UnknownFields - - LookupKey string `protobuf:"bytes,1,opt,name=lookupKey,proto3" json:"lookupKey,omitempty"` // Optional, only if you want delivery tracking, less stealth - Prev *MatriochkaServer `protobuf:"bytes,2,opt,name=prev,proto3" json:"prev,omitempty"` // Optional, like above - Next *MatriochkaServer `protobuf:"bytes,3,opt,name=next,proto3" json:"next,omitempty"` // Next server to deliver the message to - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // Matriochka data + sizeCache protoimpl.SizeCache } func (x *Matriochka) Reset() { *x = Matriochka{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[8] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[8] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Matriochka) String() string { @@ -785,7 +759,7 @@ func (*Matriochka) ProtoMessage() {} func (x *Matriochka) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[8] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -830,26 +804,23 @@ func (x *Matriochka) GetData() []byte { // structure describing required server attributes type ServerCard struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // friendly server name + Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // description : owner type (company/private/university...), + PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key you must use to send encrypted messages to that server + Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // meow server url + Login string `protobuf:"bytes,5,opt,name=login,proto3" json:"login,omitempty"` // required login to access the server + Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` // password associated to the login + Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` // signature of all previous fields by the server itself unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // friendly server name - Description string `protobuf:"bytes,2,opt,name=description,proto3" json:"description,omitempty"` // description : owner type (company/private/university...), - PublicKey string `protobuf:"bytes,3,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"` // public key you must use to send encrypted messages to that server - Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // meow server url - Login string `protobuf:"bytes,5,opt,name=login,proto3" json:"login,omitempty"` // required login to access the server - Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` // password associated to the login - Signature string `protobuf:"bytes,7,opt,name=signature,proto3" json:"signature,omitempty"` // signature of all previous fields by the server itself + sizeCache protoimpl.SizeCache } func (x *ServerCard) Reset() { *x = ServerCard{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[9] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[9] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ServerCard) String() string { @@ -860,7 +831,7 @@ func (*ServerCard) ProtoMessage() {} func (x *ServerCard) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[9] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -926,27 +897,24 @@ func (x *ServerCard) GetSignature() string { // structure describing a user contact card ie the minimum set of attributes for exchanging identities type ContactCard struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contact nickname - ContactPublicKey string `protobuf:"bytes,2,opt,name=contact_public_key,json=contactPublicKey,proto3" json:"contact_public_key,omitempty"` // contact public key, will be used to authenticate her/his messages - EncryptionPublicKey string `protobuf:"bytes,3,opt,name=encryption_public_key,json=encryptionPublicKey,proto3" json:"encryption_public_key,omitempty"` // public key you must use to to write encrypted messages to that contact - LookupPublicKey string `protobuf:"bytes,4,opt,name=lookup_public_key,json=lookupPublicKey,proto3" json:"lookup_public_key,omitempty"` // public key you will use as "destination identifier" for her/him to lookup for your messages on the servers - PullServers []*ServerCard `protobuf:"bytes,5,rep,name=pull_servers,json=pullServers,proto3" json:"pull_servers,omitempty"` // list the servers where the contact will look for messages from you - Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` - InvitationId string `protobuf:"bytes,7,opt,name=invitation_id,json=invitationId,proto3" json:"invitation_id,omitempty"` - InvitationMessage string `protobuf:"bytes,8,opt,name=invitation_message,json=invitationMessage,proto3" json:"invitation_message,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contact nickname + ContactPublicKey string `protobuf:"bytes,2,opt,name=contact_public_key,json=contactPublicKey,proto3" json:"contact_public_key,omitempty"` // contact public key, will be used to authenticate her/his messages + EncryptionPublicKey string `protobuf:"bytes,3,opt,name=encryption_public_key,json=encryptionPublicKey,proto3" json:"encryption_public_key,omitempty"` // public key you must use to to write encrypted messages to that contact + LookupPublicKey string `protobuf:"bytes,4,opt,name=lookup_public_key,json=lookupPublicKey,proto3" json:"lookup_public_key,omitempty"` // public key you will use as "destination identifier" for her/him to lookup for your messages on the servers + PullServers []*ServerCard `protobuf:"bytes,5,rep,name=pull_servers,json=pullServers,proto3" json:"pull_servers,omitempty"` // list the servers where the contact will look for messages from you + Version uint32 `protobuf:"varint,6,opt,name=version,proto3" json:"version,omitempty"` + InvitationId string `protobuf:"bytes,7,opt,name=invitation_id,json=invitationId,proto3" json:"invitation_id,omitempty"` + InvitationMessage string `protobuf:"bytes,8,opt,name=invitation_message,json=invitationMessage,proto3" json:"invitation_message,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ContactCard) Reset() { *x = ContactCard{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[10] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[10] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ContactCard) String() string { @@ -957,7 +925,7 @@ func (*ContactCard) ProtoMessage() {} func (x *ContactCard) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[10] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1030,24 +998,21 @@ func (x *ContactCard) GetInvitationMessage() string { // structure for sending a message to be forwarded to another user in protobuf format type PackedUserMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // the peer's current conversation lookup public key - Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // the message UserMessage encrypted with the destination peer's public key - Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // the payload signature with the client identity private key - ServerTimestamp []int64 `protobuf:"varint,4,rep,packed,name=serverTimestamp,proto3" json:"serverTimestamp,omitempty"` // server time stamp, might be several in matriochka mode - ServerDeliveryUuid string `protobuf:"bytes,5,opt,name=server_delivery_uuid,json=serverDeliveryUuid,proto3" json:"server_delivery_uuid,omitempty"` // message uuid, for server delivery tracking, omitted if not delivery tracking desired + state protoimpl.MessageState `protogen:"open.v1"` + Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // the peer's current conversation lookup public key + Payload []byte `protobuf:"bytes,2,opt,name=payload,proto3" json:"payload,omitempty"` // the message UserMessage encrypted with the destination peer's public key + Signature []byte `protobuf:"bytes,3,opt,name=signature,proto3" json:"signature,omitempty"` // the payload signature with the client identity private key + ServerTimestamp []int64 `protobuf:"varint,4,rep,packed,name=serverTimestamp,proto3" json:"serverTimestamp,omitempty"` // server time stamp, might be several in matriochka mode + ServerDeliveryUuid string `protobuf:"bytes,5,opt,name=server_delivery_uuid,json=serverDeliveryUuid,proto3" json:"server_delivery_uuid,omitempty"` // message uuid, for server delivery tracking, omitted if not delivery tracking desired + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *PackedUserMessage) Reset() { *x = PackedUserMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[11] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[11] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *PackedUserMessage) String() string { @@ -1058,7 +1023,7 @@ func (*PackedUserMessage) ProtoMessage() {} func (x *PackedUserMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[11] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1109,27 +1074,24 @@ func (x *PackedUserMessage) GetServerDeliveryUuid() string { } type ConversationStatus struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` - AnswerToUuid string `protobuf:"bytes,2,opt,name=answer_to_uuid,json=answerToUuid,proto3" json:"answer_to_uuid,omitempty"` // message is an answer to another one, specify uuid here - LocalSequence uint64 `protobuf:"varint,3,opt,name=localSequence,proto3" json:"localSequence,omitempty"` // seq number in local conversation for custom reordering - Sent uint64 `protobuf:"varint,4,opt,name=sent,proto3" json:"sent,omitempty"` // timestamp of the message sent - Received uint64 `protobuf:"varint,5,opt,name=received,proto3" json:"received,omitempty"` // timestamp of the message received - Processed uint64 `protobuf:"varint,6,opt,name=processed,proto3" json:"processed,omitempty"` // timestamp of the message processed - MyNextIdentity *ContactCard `protobuf:"bytes,7,opt,name=my_next_identity,json=myNextIdentity,proto3" json:"my_next_identity,omitempty"` - PeerNextIdentityAck int32 `protobuf:"varint,8,opt,name=peer_next_identityAck,json=peerNextIdentityAck,proto3" json:"peer_next_identityAck,omitempty"` // version of the new peer accepted id + state protoimpl.MessageState `protogen:"open.v1"` + Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` + AnswerToUuid string `protobuf:"bytes,2,opt,name=answer_to_uuid,json=answerToUuid,proto3" json:"answer_to_uuid,omitempty"` // message is an answer to another one, specify uuid here + LocalSequence uint64 `protobuf:"varint,3,opt,name=localSequence,proto3" json:"localSequence,omitempty"` // seq number in local conversation for custom reordering + Sent uint64 `protobuf:"varint,4,opt,name=sent,proto3" json:"sent,omitempty"` // timestamp of the message sent + Received uint64 `protobuf:"varint,5,opt,name=received,proto3" json:"received,omitempty"` // timestamp of the message received + Processed uint64 `protobuf:"varint,6,opt,name=processed,proto3" json:"processed,omitempty"` // timestamp of the message processed + MyNextIdentity *ContactCard `protobuf:"bytes,7,opt,name=my_next_identity,json=myNextIdentity,proto3" json:"my_next_identity,omitempty"` + PeerNextIdentityAck int32 `protobuf:"varint,8,opt,name=peer_next_identityAck,json=peerNextIdentityAck,proto3" json:"peer_next_identityAck,omitempty"` // version of the new peer accepted id + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *ConversationStatus) Reset() { *x = ConversationStatus{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[12] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[12] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *ConversationStatus) String() string { @@ -1140,7 +1102,7 @@ func (*ConversationStatus) ProtoMessage() {} func (x *ConversationStatus) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[12] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1212,21 +1174,18 @@ func (x *ConversationStatus) GetPeerNextIdentityAck() int32 { } type Group struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` + Members []*ContactCard `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` unknownFields protoimpl.UnknownFields - - Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` - Members []*ContactCard `protobuf:"bytes,2,rep,name=members,proto3" json:"members,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Group) Reset() { *x = Group{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[13] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[13] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Group) String() string { @@ -1237,7 +1196,7 @@ func (*Group) ProtoMessage() {} func (x *Group) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[13] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1268,32 +1227,29 @@ func (x *Group) GetMembers() []*ContactCard { // structure defining information that might be exchanged between two peers. type UserMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // Lookupkey - From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // My public key for that contact - Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // Message type - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` - Status *ConversationStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` - Contact *ContactCard `protobuf:"bytes,6,opt,name=contact,proto3" json:"contact,omitempty"` - KnownServers *ServerCard `protobuf:"bytes,7,opt,name=knownServers,proto3" json:"knownServers,omitempty"` - Group *Group `protobuf:"bytes,8,opt,name=group,proto3" json:"group,omitempty"` - Files []*File `protobuf:"bytes,9,rep,name=files,proto3" json:"files,omitempty"` - CurrentLocation *Location `protobuf:"bytes,10,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` - Appdata []byte `protobuf:"bytes,11,opt,name=appdata,proto3" json:"appdata,omitempty"` - Invitation *Invitation `protobuf:"bytes,12,opt,name=invitation,proto3" json:"invitation,omitempty"` - VideoData *VideoData `protobuf:"bytes,13,opt,name=video_data,json=videoData,proto3" json:"video_data,omitempty"` + state protoimpl.MessageState `protogen:"open.v1"` + Destination string `protobuf:"bytes,1,opt,name=destination,proto3" json:"destination,omitempty"` // Lookupkey + From string `protobuf:"bytes,2,opt,name=from,proto3" json:"from,omitempty"` // My public key for that contact + Type string `protobuf:"bytes,3,opt,name=type,proto3" json:"type,omitempty"` // Message type + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` + Status *ConversationStatus `protobuf:"bytes,5,opt,name=status,proto3" json:"status,omitempty"` + Contact *ContactCard `protobuf:"bytes,6,opt,name=contact,proto3" json:"contact,omitempty"` + KnownServers *ServerCard `protobuf:"bytes,7,opt,name=knownServers,proto3" json:"knownServers,omitempty"` + Group *Group `protobuf:"bytes,8,opt,name=group,proto3" json:"group,omitempty"` + Files []*File `protobuf:"bytes,9,rep,name=files,proto3" json:"files,omitempty"` + CurrentLocation *Location `protobuf:"bytes,10,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` + Appdata []byte `protobuf:"bytes,11,opt,name=appdata,proto3" json:"appdata,omitempty"` + Invitation *Invitation `protobuf:"bytes,12,opt,name=invitation,proto3" json:"invitation,omitempty"` + VideoData *VideoData `protobuf:"bytes,13,opt,name=video_data,json=videoData,proto3" json:"video_data,omitempty"` + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *UserMessage) Reset() { *x = UserMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[14] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[14] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *UserMessage) String() string { @@ -1304,7 +1260,7 @@ func (*UserMessage) ProtoMessage() {} func (x *UserMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[14] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1411,23 +1367,20 @@ func (x *UserMessage) GetVideoData() *VideoData { } type File struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // the proposed filename + Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // the file size + Chunk uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"` // the chunk counter if file is sent by chunks + Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // the file/chunk content unknownFields protoimpl.UnknownFields - - Filename string `protobuf:"bytes,1,opt,name=filename,proto3" json:"filename,omitempty"` // the proposed filename - Size uint64 `protobuf:"varint,2,opt,name=size,proto3" json:"size,omitempty"` // the file size - Chunk uint32 `protobuf:"varint,3,opt,name=chunk,proto3" json:"chunk,omitempty"` // the chunk counter if file is sent by chunks - Data []byte `protobuf:"bytes,4,opt,name=data,proto3" json:"data,omitempty"` // the file/chunk content + sizeCache protoimpl.SizeCache } func (x *File) Reset() { *x = File{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[15] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[15] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *File) String() string { @@ -1438,7 +1391,7 @@ func (*File) ProtoMessage() {} func (x *File) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[15] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1482,23 +1435,20 @@ func (x *File) GetData() []byte { } type Location struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Time uint64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` + Latitude float32 `protobuf:"fixed32,2,opt,name=latitude,proto3" json:"latitude,omitempty"` + Longitude float32 `protobuf:"fixed32,3,opt,name=longitude,proto3" json:"longitude,omitempty"` + Altitude int32 `protobuf:"varint,4,opt,name=altitude,proto3" json:"altitude,omitempty"` unknownFields protoimpl.UnknownFields - - Time uint64 `protobuf:"varint,1,opt,name=time,proto3" json:"time,omitempty"` - Latitude float32 `protobuf:"fixed32,2,opt,name=latitude,proto3" json:"latitude,omitempty"` - Longitude float32 `protobuf:"fixed32,3,opt,name=longitude,proto3" json:"longitude,omitempty"` - Altitude int32 `protobuf:"varint,4,opt,name=altitude,proto3" json:"altitude,omitempty"` + sizeCache protoimpl.SizeCache } func (x *Location) Reset() { *x = Location{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[16] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[16] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *Location) String() string { @@ -1509,7 +1459,7 @@ func (*Location) ProtoMessage() {} func (x *Location) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[16] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1553,30 +1503,27 @@ func (x *Location) GetAltitude() int32 { } type DbMessage struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache - unknownFields protoimpl.UnknownFields - - Outbound bool `protobuf:"varint,1,opt,name=outbound,proto3" json:"outbound,omitempty"` // direction of the message - Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` - Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // text data - Status *ConversationStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` - Contact *ContactCard `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` - Group *Group `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"` - FilePaths []string `protobuf:"bytes,7,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"` - CurrentLocation *Location `protobuf:"bytes,8,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` - Appdata []byte `protobuf:"bytes,9,opt,name=appdata,proto3" json:"appdata,omitempty"` - Invitation *Invitation `protobuf:"bytes,10,opt,name=invitation,proto3" json:"invitation,omitempty"` - From string `protobuf:"bytes,11,opt,name=from,proto3" json:"from,omitempty"` // source peer uid, used when storing group conversations with more than one peer + state protoimpl.MessageState `protogen:"open.v1"` + Outbound bool `protobuf:"varint,1,opt,name=outbound,proto3" json:"outbound,omitempty"` // direction of the message + Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` + Data []byte `protobuf:"bytes,3,opt,name=data,proto3" json:"data,omitempty"` // text data + Status *ConversationStatus `protobuf:"bytes,4,opt,name=status,proto3" json:"status,omitempty"` + Contact *ContactCard `protobuf:"bytes,5,opt,name=contact,proto3" json:"contact,omitempty"` + Group *Group `protobuf:"bytes,6,opt,name=group,proto3" json:"group,omitempty"` + FilePaths []string `protobuf:"bytes,7,rep,name=file_paths,json=filePaths,proto3" json:"file_paths,omitempty"` + CurrentLocation *Location `protobuf:"bytes,8,opt,name=current_location,json=currentLocation,proto3" json:"current_location,omitempty"` + Appdata []byte `protobuf:"bytes,9,opt,name=appdata,proto3" json:"appdata,omitempty"` + Invitation *Invitation `protobuf:"bytes,10,opt,name=invitation,proto3" json:"invitation,omitempty"` + From string `protobuf:"bytes,11,opt,name=from,proto3" json:"from,omitempty"` // source peer uid, used when storing group conversations with more than one peer + unknownFields protoimpl.UnknownFields + sizeCache protoimpl.SizeCache } func (x *DbMessage) Reset() { *x = DbMessage{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[17] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[17] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *DbMessage) String() string { @@ -1587,7 +1534,7 @@ func (*DbMessage) ProtoMessage() {} func (x *DbMessage) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[17] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1680,24 +1627,21 @@ func (x *DbMessage) GetFrom() string { } type VideoData struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` + Room string `protobuf:"bytes,2,opt,name=room,proto3" json:"room,omitempty"` + Duration uint64 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` + Credentials []*VideoCredential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` + MediaQuery []string `protobuf:"bytes,5,rep,name=media_query,json=mediaQuery,proto3" json:"media_query,omitempty"` unknownFields protoimpl.UnknownFields - - Url string `protobuf:"bytes,1,opt,name=url,proto3" json:"url,omitempty"` - Room string `protobuf:"bytes,2,opt,name=room,proto3" json:"room,omitempty"` - Duration uint64 `protobuf:"varint,3,opt,name=duration,proto3" json:"duration,omitempty"` - Credentials []*VideoCredential `protobuf:"bytes,4,rep,name=credentials,proto3" json:"credentials,omitempty"` - MediaQuery []string `protobuf:"bytes,5,rep,name=media_query,json=mediaQuery,proto3" json:"media_query,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VideoData) Reset() { *x = VideoData{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[18] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[18] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VideoData) String() string { @@ -1708,7 +1652,7 @@ func (*VideoData) ProtoMessage() {} func (x *VideoData) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[18] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1759,22 +1703,19 @@ func (x *VideoData) GetMediaQuery() []string { } type VideoCredential struct { - state protoimpl.MessageState - sizeCache protoimpl.SizeCache + state protoimpl.MessageState `protogen:"open.v1"` + Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` + SharedKey string `protobuf:"bytes,2,opt,name=shared_key,json=sharedKey,proto3" json:"shared_key,omitempty"` + Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` unknownFields protoimpl.UnknownFields - - Username string `protobuf:"bytes,1,opt,name=username,proto3" json:"username,omitempty"` - SharedKey string `protobuf:"bytes,2,opt,name=shared_key,json=sharedKey,proto3" json:"shared_key,omitempty"` - Token string `protobuf:"bytes,3,opt,name=token,proto3" json:"token,omitempty"` + sizeCache protoimpl.SizeCache } func (x *VideoCredential) Reset() { *x = VideoCredential{} - if protoimpl.UnsafeEnabled { - mi := &file_messages_proto_msgTypes[19] - ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) - ms.StoreMessageInfo(mi) - } + mi := &file_messages_proto_msgTypes[19] + ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) + ms.StoreMessageInfo(mi) } func (x *VideoCredential) String() string { @@ -1785,7 +1726,7 @@ func (*VideoCredential) ProtoMessage() {} func (x *VideoCredential) ProtoReflect() protoreflect.Message { mi := &file_messages_proto_msgTypes[19] - if protoimpl.UnsafeEnabled && x != nil { + if x != nil { ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x)) if ms.LoadMessageInfo() == nil { ms.StoreMessageInfo(mi) @@ -1823,324 +1764,195 @@ func (x *VideoCredential) GetToken() string { var File_messages_proto protoreflect.FileDescriptor -var file_messages_proto_rawDesc = []byte{ - 0x0a, 0x0e, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, - 0x12, 0x07, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x22, 0x61, 0x0a, 0x13, 0x50, 0x61, 0x63, - 0x6b, 0x65, 0x64, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x1c, - 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xf2, 0x01, 0x0a, - 0x0a, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, - 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, - 0x22, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, 0x4c, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x05, 0x52, 0x0c, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, - 0x4c, 0x65, 0x6e, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x6f, 0x64, 0x65, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x6f, 0x72, 0x74, 0x63, 0x6f, 0x64, - 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x12, 0x0a, - 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, - 0x64, 0x12, 0x16, 0x0a, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, - 0x03, 0x52, 0x06, 0x65, 0x78, 0x70, 0x69, 0x72, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x74, 0x65, - 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x04, 0x73, 0x74, 0x65, 0x70, 0x12, 0x12, 0x0a, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, - 0x6d, 0x22, 0xb1, 0x01, 0x0a, 0x13, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x1d, 0x0a, 0x0a, 0x6c, 0x6f, 0x6f, - 0x6b, 0x75, 0x70, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x6c, - 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x29, 0x0a, 0x10, 0x64, 0x65, 0x6c, 0x69, - 0x76, 0x65, 0x72, 0x79, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x02, 0x20, 0x01, - 0x28, 0x08, 0x52, 0x0f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x52, 0x65, 0x71, 0x75, - 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x0e, 0x73, 0x65, 0x6e, 0x64, 0x5f, 0x74, 0x69, 0x6d, 0x65, - 0x73, 0x74, 0x61, 0x6d, 0x70, 0x18, 0x03, 0x20, 0x01, 0x28, 0x03, 0x52, 0x0d, 0x73, 0x65, 0x6e, - 0x64, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x29, 0x0a, 0x10, 0x6c, 0x6f, - 0x6f, 0x6b, 0x75, 0x70, 0x5f, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x53, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0x7e, 0x0a, 0x04, 0x4d, 0x65, 0x65, 0x74, 0x12, 0x23, 0x0a, - 0x0d, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x53, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x37, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x61, - 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, - 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0b, - 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x12, 0x18, 0x0a, 0x07, 0x6d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0x7f, 0x0a, 0x0b, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, - 0x69, 0x61, 0x6c, 0x73, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, - 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x1f, 0x0a, 0x0b, 0x70, 0x72, 0x69, 0x76, 0x61, 0x74, 0x65, - 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x70, 0x72, 0x69, 0x76, - 0x61, 0x74, 0x65, 0x4b, 0x65, 0x79, 0x22, 0xdd, 0x04, 0x0a, 0x0f, 0x54, 0x6f, 0x53, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, - 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, - 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, - 0x6f, 0x6d, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x3f, 0x0a, 0x0c, - 0x70, 0x75, 0x6c, 0x6c, 0x5f, 0x72, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x18, 0x04, 0x20, 0x03, - 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, - 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, - 0x52, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x36, 0x0a, - 0x08, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x1a, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, - 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x08, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x38, 0x0a, 0x0d, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x73, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, - 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x72, - 0x64, 0x52, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, - 0x42, 0x0a, 0x12, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x5f, 0x6d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, - 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, - 0x52, 0x11, 0x6d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x08, 0x20, 0x01, 0x28, - 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x33, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, - 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x43, 0x0a, 0x0f, - 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x18, - 0x0a, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, - 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, - 0x65, 0x52, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, - 0x73, 0x12, 0x18, 0x0a, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x18, 0x0b, 0x20, 0x01, - 0x28, 0x03, 0x52, 0x07, 0x74, 0x69, 0x6d, 0x65, 0x6f, 0x75, 0x74, 0x12, 0x31, 0x0a, 0x0a, 0x76, - 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x64, 0x61, 0x74, 0x61, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0b, 0x32, - 0x12, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x44, - 0x61, 0x74, 0x61, 0x52, 0x09, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x12, 0x36, - 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x0d, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x72, - 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, 0x65, - 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x22, 0xf9, 0x03, 0x0a, 0x11, 0x46, 0x72, 0x6f, 0x6d, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x74, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x12, 0x2a, 0x0a, 0x11, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, - 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x73, 0x65, 0x72, - 0x76, 0x65, 0x72, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x18, 0x0a, 0x07, - 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, - 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, 0x19, 0x0a, 0x08, 0x75, 0x75, 0x69, 0x64, 0x5f, 0x61, - 0x63, 0x6b, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x07, 0x75, 0x75, 0x69, 0x64, 0x41, 0x63, - 0x6b, 0x12, 0x1f, 0x0a, 0x0b, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x5f, 0x75, 0x75, 0x69, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0a, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x55, 0x75, - 0x69, 0x64, 0x12, 0x2e, 0x0a, 0x04, 0x63, 0x68, 0x61, 0x74, 0x18, 0x06, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, - 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x04, 0x63, 0x68, - 0x61, 0x74, 0x12, 0x38, 0x0a, 0x0d, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x5f, 0x73, 0x65, 0x72, 0x76, - 0x65, 0x72, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, 0x77, - 0x6c, 0x69, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0c, - 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x33, 0x0a, 0x0a, - 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x43, 0x0a, 0x0f, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x5f, 0x6d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x6d, 0x65, 0x6f, - 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, - 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x52, 0x0e, 0x64, 0x65, 0x76, 0x69, 0x63, 0x65, 0x4d, 0x65, - 0x73, 0x73, 0x61, 0x67, 0x65, 0x73, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6f, - 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, - 0x76, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x12, 0x37, 0x0a, 0x0c, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x63, 0x74, 0x5f, 0x63, 0x61, 0x72, 0x64, 0x18, 0x0b, 0x20, 0x03, 0x28, 0x0b, 0x32, - 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, - 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0b, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, - 0x72, 0x64, 0x22, 0x6c, 0x0a, 0x10, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x75, 0x62, 0x6c, - 0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, - 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x03, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x75, 0x75, 0x69, 0x64, 0x12, 0x14, 0x0a, 0x05, 0x64, 0x65, - 0x6c, 0x61, 0x79, 0x18, 0x04, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x64, 0x65, 0x6c, 0x61, 0x79, - 0x22, 0x9c, 0x01, 0x0a, 0x0a, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x12, - 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x09, 0x52, 0x09, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x4b, 0x65, 0x79, 0x12, 0x2d, 0x0a, - 0x04, 0x70, 0x72, 0x65, 0x76, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, - 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, - 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x04, 0x70, 0x72, 0x65, 0x76, 0x12, 0x2d, 0x0a, 0x04, - 0x6e, 0x65, 0x78, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x6d, 0x65, 0x6f, - 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4d, 0x61, 0x74, 0x72, 0x69, 0x6f, 0x63, 0x68, 0x6b, 0x61, 0x53, - 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x04, 0x6e, 0x65, 0x78, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, - 0xc3, 0x01, 0x0a, 0x0a, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x12, 0x12, - 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, - 0x6d, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, - 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, - 0x65, 0x79, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, - 0x4b, 0x65, 0x79, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x18, 0x05, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x1a, 0x0a, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x06, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, - 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, - 0x74, 0x75, 0x72, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, - 0x61, 0x74, 0x75, 0x72, 0x65, 0x22, 0xd5, 0x02, 0x0a, 0x0b, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, - 0x74, 0x43, 0x61, 0x72, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x2c, 0x0a, 0x12, 0x63, 0x6f, 0x6e, - 0x74, 0x61, 0x63, 0x74, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, 0x18, - 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x10, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x32, 0x0a, 0x15, 0x65, 0x6e, 0x63, 0x72, 0x79, - 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x13, 0x65, 0x6e, 0x63, 0x72, 0x79, 0x70, 0x74, 0x69, - 0x6f, 0x6e, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x2a, 0x0a, 0x11, 0x6c, - 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x5f, 0x70, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x5f, 0x6b, 0x65, 0x79, - 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0f, 0x6c, 0x6f, 0x6f, 0x6b, 0x75, 0x70, 0x50, 0x75, - 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x36, 0x0a, 0x0c, 0x70, 0x75, 0x6c, 0x6c, 0x5f, - 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x13, 0x2e, - 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, - 0x72, 0x64, 0x52, 0x0b, 0x70, 0x75, 0x6c, 0x6c, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, - 0x18, 0x0a, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0d, - 0x52, 0x07, 0x76, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e, 0x12, 0x23, 0x0a, 0x0d, 0x69, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x69, 0x64, 0x18, 0x07, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x0c, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x49, 0x64, 0x12, 0x2d, - 0x0a, 0x12, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6d, 0x65, 0x73, - 0x73, 0x61, 0x67, 0x65, 0x18, 0x08, 0x20, 0x01, 0x28, 0x09, 0x52, 0x11, 0x69, 0x6e, 0x76, 0x69, - 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x22, 0xc9, 0x01, - 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x65, 0x64, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, - 0x61, 0x67, 0x65, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, - 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, - 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x70, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x12, - 0x1c, 0x0a, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x09, 0x73, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x28, 0x0a, - 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, - 0x18, 0x04, 0x20, 0x03, 0x28, 0x03, 0x52, 0x0f, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x54, 0x69, - 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d, 0x70, 0x12, 0x30, 0x0a, 0x14, 0x73, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x5f, 0x64, 0x65, 0x6c, 0x69, 0x76, 0x65, 0x72, 0x79, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, - 0x05, 0x20, 0x01, 0x28, 0x09, 0x52, 0x12, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x44, 0x65, 0x6c, - 0x69, 0x76, 0x65, 0x72, 0x79, 0x55, 0x75, 0x69, 0x64, 0x22, 0xb6, 0x02, 0x0a, 0x12, 0x43, 0x6f, - 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, - 0x12, 0x12, 0x0a, 0x04, 0x75, 0x75, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, - 0x75, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0e, 0x61, 0x6e, 0x73, 0x77, 0x65, 0x72, 0x5f, 0x74, - 0x6f, 0x5f, 0x75, 0x75, 0x69, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0c, 0x61, 0x6e, - 0x73, 0x77, 0x65, 0x72, 0x54, 0x6f, 0x55, 0x75, 0x69, 0x64, 0x12, 0x24, 0x0a, 0x0d, 0x6c, 0x6f, - 0x63, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x0d, 0x6c, 0x6f, 0x63, 0x61, 0x6c, 0x53, 0x65, 0x71, 0x75, 0x65, 0x6e, 0x63, 0x65, - 0x12, 0x12, 0x0a, 0x04, 0x73, 0x65, 0x6e, 0x74, 0x18, 0x04, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, - 0x73, 0x65, 0x6e, 0x74, 0x12, 0x1a, 0x0a, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x04, 0x52, 0x08, 0x72, 0x65, 0x63, 0x65, 0x69, 0x76, 0x65, 0x64, - 0x12, 0x1c, 0x0a, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x04, 0x52, 0x09, 0x70, 0x72, 0x6f, 0x63, 0x65, 0x73, 0x73, 0x65, 0x64, 0x12, 0x3e, - 0x0a, 0x10, 0x6d, 0x79, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, 0x74, 0x69, - 0x74, 0x79, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, - 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0e, - 0x6d, 0x79, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x12, 0x32, - 0x0a, 0x15, 0x70, 0x65, 0x65, 0x72, 0x5f, 0x6e, 0x65, 0x78, 0x74, 0x5f, 0x69, 0x64, 0x65, 0x6e, - 0x74, 0x69, 0x74, 0x79, 0x41, 0x63, 0x6b, 0x18, 0x08, 0x20, 0x01, 0x28, 0x05, 0x52, 0x13, 0x70, - 0x65, 0x65, 0x72, 0x4e, 0x65, 0x78, 0x74, 0x49, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x74, 0x79, 0x41, - 0x63, 0x6b, 0x22, 0x4b, 0x0a, 0x05, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x12, 0x0a, 0x04, 0x6e, - 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, - 0x2e, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, - 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x22, - 0x94, 0x04, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, - 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, - 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x74, 0x69, 0x6e, 0x61, 0x74, 0x69, 0x6f, - 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, - 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, - 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, 0x0a, - 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1b, 0x2e, - 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, 0x72, 0x73, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, 0x74, 0x61, 0x74, - 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x18, 0x06, 0x20, - 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, - 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, - 0x63, 0x74, 0x12, 0x37, 0x0a, 0x0c, 0x6b, 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, - 0x72, 0x73, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, - 0x69, 0x62, 0x2e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x43, 0x61, 0x72, 0x64, 0x52, 0x0c, 0x6b, - 0x6e, 0x6f, 0x77, 0x6e, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x24, 0x0a, 0x05, 0x67, - 0x72, 0x6f, 0x75, 0x70, 0x18, 0x08, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6d, 0x65, 0x6f, - 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, - 0x70, 0x12, 0x23, 0x0a, 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x18, 0x09, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x0d, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x46, 0x69, 0x6c, 0x65, 0x52, - 0x05, 0x66, 0x69, 0x6c, 0x65, 0x73, 0x12, 0x3c, 0x0a, 0x10, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, - 0x74, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4c, 0x6f, 0x63, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, 0x4c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x64, 0x61, 0x74, 0x61, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x64, 0x61, 0x74, 0x61, 0x12, 0x33, - 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x0c, 0x20, 0x01, - 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x49, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, - 0x69, 0x6f, 0x6e, 0x12, 0x31, 0x0a, 0x0a, 0x76, 0x69, 0x64, 0x65, 0x6f, 0x5f, 0x64, 0x61, 0x74, - 0x61, 0x18, 0x0d, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x12, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, - 0x62, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x52, 0x09, 0x76, 0x69, 0x64, - 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x22, 0x60, 0x0a, 0x04, 0x46, 0x69, 0x6c, 0x65, 0x12, 0x1a, - 0x0a, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, - 0x52, 0x08, 0x66, 0x69, 0x6c, 0x65, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x12, 0x0a, 0x04, 0x73, 0x69, - 0x7a, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x04, 0x73, 0x69, 0x7a, 0x65, 0x12, 0x14, - 0x0a, 0x05, 0x63, 0x68, 0x75, 0x6e, 0x6b, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x05, 0x63, - 0x68, 0x75, 0x6e, 0x6b, 0x12, 0x12, 0x0a, 0x04, 0x64, 0x61, 0x74, 0x61, 0x18, 0x04, 0x20, 0x01, - 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, 0x22, 0x74, 0x0a, 0x08, 0x4c, 0x6f, 0x63, 0x61, - 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, - 0x28, 0x04, 0x52, 0x04, 0x74, 0x69, 0x6d, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x6c, 0x61, 0x74, 0x69, - 0x74, 0x75, 0x64, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x02, 0x52, 0x08, 0x6c, 0x61, 0x74, 0x69, - 0x74, 0x75, 0x64, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, 0x64, - 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x02, 0x52, 0x09, 0x6c, 0x6f, 0x6e, 0x67, 0x69, 0x74, 0x75, - 0x64, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x18, 0x04, - 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x61, 0x6c, 0x74, 0x69, 0x74, 0x75, 0x64, 0x65, 0x22, 0x9a, - 0x03, 0x0a, 0x09, 0x44, 0x62, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1a, 0x0a, 0x08, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x08, 0x52, 0x08, - 0x6f, 0x75, 0x74, 0x62, 0x6f, 0x75, 0x6e, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, - 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x12, 0x12, 0x0a, 0x04, - 0x64, 0x61, 0x74, 0x61, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x04, 0x64, 0x61, 0x74, 0x61, - 0x12, 0x33, 0x0a, 0x06, 0x73, 0x74, 0x61, 0x74, 0x75, 0x73, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, - 0x32, 0x1b, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x43, 0x6f, 0x6e, 0x76, 0x65, - 0x72, 0x73, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x74, 0x75, 0x73, 0x52, 0x06, 0x73, - 0x74, 0x61, 0x74, 0x75, 0x73, 0x12, 0x2e, 0x0a, 0x07, 0x63, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, - 0x18, 0x05, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x14, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, - 0x2e, 0x43, 0x6f, 0x6e, 0x74, 0x61, 0x63, 0x74, 0x43, 0x61, 0x72, 0x64, 0x52, 0x07, 0x63, 0x6f, - 0x6e, 0x74, 0x61, 0x63, 0x74, 0x12, 0x24, 0x0a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x06, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x0e, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x47, - 0x72, 0x6f, 0x75, 0x70, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x1d, 0x0a, 0x0a, 0x66, - 0x69, 0x6c, 0x65, 0x5f, 0x70, 0x61, 0x74, 0x68, 0x73, 0x18, 0x07, 0x20, 0x03, 0x28, 0x09, 0x52, - 0x09, 0x66, 0x69, 0x6c, 0x65, 0x50, 0x61, 0x74, 0x68, 0x73, 0x12, 0x3c, 0x0a, 0x10, 0x63, 0x75, - 0x72, 0x72, 0x65, 0x6e, 0x74, 0x5f, 0x6c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x08, - 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x4c, - 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0f, 0x63, 0x75, 0x72, 0x72, 0x65, 0x6e, 0x74, - 0x4c, 0x6f, 0x63, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x18, 0x0a, 0x07, 0x61, 0x70, 0x70, 0x64, - 0x61, 0x74, 0x61, 0x18, 0x09, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x61, 0x70, 0x70, 0x64, 0x61, - 0x74, 0x61, 0x12, 0x33, 0x0a, 0x0a, 0x69, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, - 0x18, 0x0a, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x13, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, - 0x2e, 0x49, 0x6e, 0x76, 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x0a, 0x69, 0x6e, 0x76, - 0x69, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x12, 0x0a, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x18, - 0x0b, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x66, 0x72, 0x6f, 0x6d, 0x22, 0xaa, 0x01, 0x0a, 0x09, - 0x56, 0x69, 0x64, 0x65, 0x6f, 0x44, 0x61, 0x74, 0x61, 0x12, 0x10, 0x0a, 0x03, 0x75, 0x72, 0x6c, - 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x03, 0x75, 0x72, 0x6c, 0x12, 0x12, 0x0a, 0x04, 0x72, - 0x6f, 0x6f, 0x6d, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x72, 0x6f, 0x6f, 0x6d, 0x12, - 0x1a, 0x0a, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x03, 0x20, 0x01, 0x28, - 0x04, 0x52, 0x08, 0x64, 0x75, 0x72, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3a, 0x0a, 0x0b, 0x63, - 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, - 0x32, 0x18, 0x2e, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x2e, 0x56, 0x69, 0x64, 0x65, 0x6f, - 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x52, 0x0b, 0x63, 0x72, 0x65, 0x64, - 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x73, 0x12, 0x1f, 0x0a, 0x0b, 0x6d, 0x65, 0x64, 0x69, 0x61, - 0x5f, 0x71, 0x75, 0x65, 0x72, 0x79, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x0a, 0x6d, 0x65, - 0x64, 0x69, 0x61, 0x51, 0x75, 0x65, 0x72, 0x79, 0x22, 0x62, 0x0a, 0x0f, 0x56, 0x69, 0x64, 0x65, - 0x6f, 0x43, 0x72, 0x65, 0x64, 0x65, 0x6e, 0x74, 0x69, 0x61, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x75, - 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x73, 0x68, 0x61, 0x72, 0x65, - 0x64, 0x5f, 0x6b, 0x65, 0x79, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x73, 0x68, 0x61, - 0x72, 0x65, 0x64, 0x4b, 0x65, 0x79, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, - 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x42, 0x21, 0x5a, 0x1f, - 0x66, 0x6f, 0x72, 0x67, 0x65, 0x2e, 0x72, 0x65, 0x64, 0x72, 0x6f, 0x6f, 0x6d, 0x2e, 0x6c, 0x69, - 0x6e, 0x6b, 0x2f, 0x79, 0x76, 0x65, 0x73, 0x2f, 0x6d, 0x65, 0x6f, 0x77, 0x6c, 0x69, 0x62, 0x62, - 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33, -} +const file_messages_proto_rawDesc = "" + + "\n" + + "\x0emessages.proto\x12\ameowlib\"a\n" + + "\x13PackedServerMessage\x12\x12\n" + + "\x04from\x18\x01 \x01(\tR\x04from\x12\x18\n" + + "\apayload\x18\x02 \x01(\fR\apayload\x12\x1c\n" + + "\tsignature\x18\x03 \x01(\fR\tsignature\"\xf2\x01\n" + + "\n" + + "Invitation\x12\x18\n" + + "\apayload\x18\x01 \x01(\fR\apayload\x12\x18\n" + + "\atimeout\x18\x02 \x01(\x05R\atimeout\x12\"\n" + + "\fshortcodeLen\x18\x03 \x01(\x05R\fshortcodeLen\x12\x1c\n" + + "\tshortcode\x18\x04 \x01(\tR\tshortcode\x12\x1a\n" + + "\bpassword\x18\x05 \x01(\tR\bpassword\x12\x12\n" + + "\x04uuid\x18\x06 \x01(\tR\x04uuid\x12\x16\n" + + "\x06expiry\x18\a \x01(\x03R\x06expiry\x12\x12\n" + + "\x04step\x18\b \x01(\x05R\x04step\x12\x12\n" + + "\x04from\x18\t \x01(\tR\x04from\"\xb1\x01\n" + + "\x13ConversationRequest\x12\x1d\n" + + "\n" + + "lookup_key\x18\x01 \x01(\tR\tlookupKey\x12)\n" + + "\x10delivery_request\x18\x02 \x01(\bR\x0fdeliveryRequest\x12%\n" + + "\x0esend_timestamp\x18\x03 \x01(\x03R\rsendTimestamp\x12)\n" + + "\x10lookup_signature\x18\x04 \x01(\tR\x0flookupSignature\"~\n" + + "\x04Meet\x12#\n" + + "\rpublic_status\x18\x01 \x01(\tR\fpublicStatus\x127\n" + + "\fcontact_card\x18\x02 \x01(\v2\x14.meowlib.ContactCardR\vcontactCard\x12\x18\n" + + "\amessage\x18\x03 \x01(\tR\amessage\"\x7f\n" + + "\vCredentials\x12\x14\n" + + "\x05login\x18\x01 \x01(\tR\x05login\x12\x1a\n" + + "\bpassword\x18\x02 \x01(\tR\bpassword\x12\x1d\n" + + "\n" + + "public_key\x18\x03 \x01(\tR\tpublicKey\x12\x1f\n" + + "\vprivate_key\x18\x04 \x01(\tR\n" + + "privateKey\"\xdd\x04\n" + + "\x0fToServerMessage\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12\x12\n" + + "\x04from\x18\x02 \x01(\tR\x04from\x12\x18\n" + + "\apayload\x18\x03 \x01(\fR\apayload\x12?\n" + + "\fpull_request\x18\x04 \x03(\v2\x1c.meowlib.ConversationRequestR\vpullRequest\x126\n" + + "\bmessages\x18\x05 \x03(\v2\x1a.meowlib.PackedUserMessageR\bmessages\x128\n" + + "\rknown_servers\x18\x06 \x03(\v2\x13.meowlib.ServerCardR\fknownServers\x12B\n" + + "\x12matriochka_message\x18\a \x01(\v2\x13.meowlib.MatriochkaR\x11matriochkaMessage\x12\x12\n" + + "\x04uuid\x18\b \x01(\tR\x04uuid\x123\n" + + "\n" + + "invitation\x18\t \x01(\v2\x13.meowlib.InvitationR\n" + + "invitation\x12C\n" + + "\x0fdevice_messages\x18\n" + + " \x03(\v2\x1a.meowlib.PackedUserMessageR\x0edeviceMessages\x12\x18\n" + + "\atimeout\x18\v \x01(\x03R\atimeout\x121\n" + + "\n" + + "video_data\x18\f \x01(\v2\x12.meowlib.VideoDataR\tvideoData\x126\n" + + "\vcredentials\x18\r \x01(\v2\x14.meowlib.CredentialsR\vcredentials\"\xf9\x03\n" + + "\x11FromServerMessage\x12\x12\n" + + "\x04type\x18\x01 \x01(\tR\x04type\x12*\n" + + "\x11server_public_key\x18\x02 \x01(\tR\x0fserverPublicKey\x12\x18\n" + + "\apayload\x18\x03 \x01(\fR\apayload\x12\x19\n" + + "\buuid_ack\x18\x04 \x01(\tR\auuidAck\x12\x1f\n" + + "\vserver_uuid\x18\x05 \x01(\tR\n" + + "serverUuid\x12.\n" + + "\x04chat\x18\x06 \x03(\v2\x1a.meowlib.PackedUserMessageR\x04chat\x128\n" + + "\rknown_servers\x18\a \x03(\v2\x13.meowlib.ServerCardR\fknownServers\x123\n" + + "\n" + + "invitation\x18\b \x01(\v2\x13.meowlib.InvitationR\n" + + "invitation\x12C\n" + + "\x0fdevice_messages\x18\t \x03(\v2\x1a.meowlib.PackedUserMessageR\x0edeviceMessages\x121\n" + + "\n" + + "video_data\x18\n" + + " \x01(\v2\x12.meowlib.VideoDataR\tvideoData\x127\n" + + "\fcontact_card\x18\v \x03(\v2\x14.meowlib.ContactCardR\vcontactCard\"l\n" + + "\x10MatriochkaServer\x12\x10\n" + + "\x03url\x18\x01 \x01(\tR\x03url\x12\x1c\n" + + "\tpublicKey\x18\x02 \x01(\tR\tpublicKey\x12\x12\n" + + "\x04uuid\x18\x03 \x01(\tR\x04uuid\x12\x14\n" + + "\x05delay\x18\x04 \x01(\x05R\x05delay\"\x9c\x01\n" + + "\n" + + "Matriochka\x12\x1c\n" + + "\tlookupKey\x18\x01 \x01(\tR\tlookupKey\x12-\n" + + "\x04prev\x18\x02 \x01(\v2\x19.meowlib.MatriochkaServerR\x04prev\x12-\n" + + "\x04next\x18\x03 \x01(\v2\x19.meowlib.MatriochkaServerR\x04next\x12\x12\n" + + "\x04data\x18\x04 \x01(\fR\x04data\"\xc3\x01\n" + + "\n" + + "ServerCard\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12 \n" + + "\vdescription\x18\x02 \x01(\tR\vdescription\x12\x1d\n" + + "\n" + + "public_key\x18\x03 \x01(\tR\tpublicKey\x12\x10\n" + + "\x03url\x18\x04 \x01(\tR\x03url\x12\x14\n" + + "\x05login\x18\x05 \x01(\tR\x05login\x12\x1a\n" + + "\bpassword\x18\x06 \x01(\tR\bpassword\x12\x1c\n" + + "\tsignature\x18\a \x01(\tR\tsignature\"\xd5\x02\n" + + "\vContactCard\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12,\n" + + "\x12contact_public_key\x18\x02 \x01(\tR\x10contactPublicKey\x122\n" + + "\x15encryption_public_key\x18\x03 \x01(\tR\x13encryptionPublicKey\x12*\n" + + "\x11lookup_public_key\x18\x04 \x01(\tR\x0flookupPublicKey\x126\n" + + "\fpull_servers\x18\x05 \x03(\v2\x13.meowlib.ServerCardR\vpullServers\x12\x18\n" + + "\aversion\x18\x06 \x01(\rR\aversion\x12#\n" + + "\rinvitation_id\x18\a \x01(\tR\finvitationId\x12-\n" + + "\x12invitation_message\x18\b \x01(\tR\x11invitationMessage\"\xc9\x01\n" + + "\x11PackedUserMessage\x12 \n" + + "\vdestination\x18\x01 \x01(\tR\vdestination\x12\x18\n" + + "\apayload\x18\x02 \x01(\fR\apayload\x12\x1c\n" + + "\tsignature\x18\x03 \x01(\fR\tsignature\x12(\n" + + "\x0fserverTimestamp\x18\x04 \x03(\x03R\x0fserverTimestamp\x120\n" + + "\x14server_delivery_uuid\x18\x05 \x01(\tR\x12serverDeliveryUuid\"\xb6\x02\n" + + "\x12ConversationStatus\x12\x12\n" + + "\x04uuid\x18\x01 \x01(\tR\x04uuid\x12$\n" + + "\x0eanswer_to_uuid\x18\x02 \x01(\tR\fanswerToUuid\x12$\n" + + "\rlocalSequence\x18\x03 \x01(\x04R\rlocalSequence\x12\x12\n" + + "\x04sent\x18\x04 \x01(\x04R\x04sent\x12\x1a\n" + + "\breceived\x18\x05 \x01(\x04R\breceived\x12\x1c\n" + + "\tprocessed\x18\x06 \x01(\x04R\tprocessed\x12>\n" + + "\x10my_next_identity\x18\a \x01(\v2\x14.meowlib.ContactCardR\x0emyNextIdentity\x122\n" + + "\x15peer_next_identityAck\x18\b \x01(\x05R\x13peerNextIdentityAck\"K\n" + + "\x05Group\x12\x12\n" + + "\x04name\x18\x01 \x01(\tR\x04name\x12.\n" + + "\amembers\x18\x02 \x03(\v2\x14.meowlib.ContactCardR\amembers\"\x94\x04\n" + + "\vUserMessage\x12 \n" + + "\vdestination\x18\x01 \x01(\tR\vdestination\x12\x12\n" + + "\x04from\x18\x02 \x01(\tR\x04from\x12\x12\n" + + "\x04type\x18\x03 \x01(\tR\x04type\x12\x12\n" + + "\x04data\x18\x04 \x01(\fR\x04data\x123\n" + + "\x06status\x18\x05 \x01(\v2\x1b.meowlib.ConversationStatusR\x06status\x12.\n" + + "\acontact\x18\x06 \x01(\v2\x14.meowlib.ContactCardR\acontact\x127\n" + + "\fknownServers\x18\a \x01(\v2\x13.meowlib.ServerCardR\fknownServers\x12$\n" + + "\x05group\x18\b \x01(\v2\x0e.meowlib.GroupR\x05group\x12#\n" + + "\x05files\x18\t \x03(\v2\r.meowlib.FileR\x05files\x12<\n" + + "\x10current_location\x18\n" + + " \x01(\v2\x11.meowlib.LocationR\x0fcurrentLocation\x12\x18\n" + + "\aappdata\x18\v \x01(\fR\aappdata\x123\n" + + "\n" + + "invitation\x18\f \x01(\v2\x13.meowlib.InvitationR\n" + + "invitation\x121\n" + + "\n" + + "video_data\x18\r \x01(\v2\x12.meowlib.VideoDataR\tvideoData\"`\n" + + "\x04File\x12\x1a\n" + + "\bfilename\x18\x01 \x01(\tR\bfilename\x12\x12\n" + + "\x04size\x18\x02 \x01(\x04R\x04size\x12\x14\n" + + "\x05chunk\x18\x03 \x01(\rR\x05chunk\x12\x12\n" + + "\x04data\x18\x04 \x01(\fR\x04data\"t\n" + + "\bLocation\x12\x12\n" + + "\x04time\x18\x01 \x01(\x04R\x04time\x12\x1a\n" + + "\blatitude\x18\x02 \x01(\x02R\blatitude\x12\x1c\n" + + "\tlongitude\x18\x03 \x01(\x02R\tlongitude\x12\x1a\n" + + "\baltitude\x18\x04 \x01(\x05R\baltitude\"\x9a\x03\n" + + "\tDbMessage\x12\x1a\n" + + "\boutbound\x18\x01 \x01(\bR\boutbound\x12\x12\n" + + "\x04type\x18\x02 \x01(\tR\x04type\x12\x12\n" + + "\x04data\x18\x03 \x01(\fR\x04data\x123\n" + + "\x06status\x18\x04 \x01(\v2\x1b.meowlib.ConversationStatusR\x06status\x12.\n" + + "\acontact\x18\x05 \x01(\v2\x14.meowlib.ContactCardR\acontact\x12$\n" + + "\x05group\x18\x06 \x01(\v2\x0e.meowlib.GroupR\x05group\x12\x1d\n" + + "\n" + + "file_paths\x18\a \x03(\tR\tfilePaths\x12<\n" + + "\x10current_location\x18\b \x01(\v2\x11.meowlib.LocationR\x0fcurrentLocation\x12\x18\n" + + "\aappdata\x18\t \x01(\fR\aappdata\x123\n" + + "\n" + + "invitation\x18\n" + + " \x01(\v2\x13.meowlib.InvitationR\n" + + "invitation\x12\x12\n" + + "\x04from\x18\v \x01(\tR\x04from\"\xaa\x01\n" + + "\tVideoData\x12\x10\n" + + "\x03url\x18\x01 \x01(\tR\x03url\x12\x12\n" + + "\x04room\x18\x02 \x01(\tR\x04room\x12\x1a\n" + + "\bduration\x18\x03 \x01(\x04R\bduration\x12:\n" + + "\vcredentials\x18\x04 \x03(\v2\x18.meowlib.VideoCredentialR\vcredentials\x12\x1f\n" + + "\vmedia_query\x18\x05 \x03(\tR\n" + + "mediaQuery\"b\n" + + "\x0fVideoCredential\x12\x1a\n" + + "\busername\x18\x01 \x01(\tR\busername\x12\x1d\n" + + "\n" + + "shared_key\x18\x02 \x01(\tR\tsharedKey\x12\x14\n" + + "\x05token\x18\x03 \x01(\tR\x05tokenB!Z\x1fforge.redroom.link/yves/meowlibb\x06proto3" var ( file_messages_proto_rawDescOnce sync.Once - file_messages_proto_rawDescData = file_messages_proto_rawDesc + file_messages_proto_rawDescData []byte ) func file_messages_proto_rawDescGZIP() []byte { file_messages_proto_rawDescOnce.Do(func() { - file_messages_proto_rawDescData = protoimpl.X.CompressGZIP(file_messages_proto_rawDescData) + file_messages_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_messages_proto_rawDesc), len(file_messages_proto_rawDesc))) }) return file_messages_proto_rawDescData } var file_messages_proto_msgTypes = make([]protoimpl.MessageInfo, 20) -var file_messages_proto_goTypes = []interface{}{ +var file_messages_proto_goTypes = []any{ (*PackedServerMessage)(nil), // 0: meowlib.PackedServerMessage (*Invitation)(nil), // 1: meowlib.Invitation (*ConversationRequest)(nil), // 2: meowlib.ConversationRequest @@ -2209,253 +2021,11 @@ func file_messages_proto_init() { if File_messages_proto != nil { return } - if !protoimpl.UnsafeEnabled { - file_messages_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackedServerMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Invitation); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConversationRequest); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Meet); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Credentials); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ToServerMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*FromServerMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*MatriochkaServer); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Matriochka); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ServerCard); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ContactCard); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[11].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*PackedUserMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[12].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*ConversationStatus); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[13].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Group); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[14].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*UserMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[15].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*File); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[16].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*Location); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[17].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*DbMessage); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[18].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VideoData); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - file_messages_proto_msgTypes[19].Exporter = func(v interface{}, i int) interface{} { - switch v := v.(*VideoCredential); i { - case 0: - return &v.state - case 1: - return &v.sizeCache - case 2: - return &v.unknownFields - default: - return nil - } - } - } type x struct{} out := protoimpl.TypeBuilder{ File: protoimpl.DescBuilder{ GoPackagePath: reflect.TypeOf(x{}).PkgPath(), - RawDescriptor: file_messages_proto_rawDesc, + RawDescriptor: unsafe.Slice(unsafe.StringData(file_messages_proto_rawDesc), len(file_messages_proto_rawDesc)), NumEnums: 0, NumMessages: 20, NumExtensions: 0, @@ -2466,7 +2036,6 @@ func file_messages_proto_init() { MessageInfos: file_messages_proto_msgTypes, }.Build() File_messages_proto = out.File - file_messages_proto_rawDesc = nil file_messages_proto_goTypes = nil file_messages_proto_depIdxs = nil } diff --git a/server/identity.go b/server/identity.go index 8a2e894..4db1acf 100644 --- a/server/identity.go +++ b/server/identity.go @@ -16,7 +16,7 @@ const key = "3pw0c8#6ZG8{75b5;3?fe80$2" type Identity struct { ServerName string `json:"servername,omitempty"` ServerDesc string `json:"serverdesc,omitempty"` - ServerKp meowlib.KeyPair `json:"server_kp,omitempty"` + ServerKp *meowlib.KeyPair `json:"server_kp,omitempty"` Status string `json:"status,omitempty"` OwnerName string `json:"owner_name,omitempty"` OwnerPublicKey string `json:"owner_public_key,omitempty"` @@ -27,9 +27,13 @@ type Identity struct { func CreateIdentity(ServerName string, ServerDesc string) *Identity { var id Identity + var err error id.ServerName = ServerName id.ServerDesc = ServerDesc - id.ServerKp = meowlib.NewKeyPair() + id.ServerKp, err = meowlib.NewKeyPair() + if err != nil { + return nil + } return &id } diff --git a/server/invitation.go b/server/invitation.go index 2e40f81..bca8726 100644 --- a/server/invitation.go +++ b/server/invitation.go @@ -1,15 +1,21 @@ package server import ( + "crypto/rand" "errors" - "math/rand" + "fmt" + "math/big" + "strings" "time" "github.com/go-redis/redis" ) -func (r *RedisRouter) StoreInvitation(invitation []byte, timeout int, password string, serverTimeout int, urlLen int) (string, time.Time) { - id := r.createShortId(urlLen) +func (r *RedisRouter) StoreInvitation(invitation []byte, timeout int, password string, serverTimeout int, urlLen int) (string, time.Time, error) { + id, err := r.createShortId(urlLen) + if err != nil { + return "", time.Time{}, fmt.Errorf("failed to create invitation ID: %w", err) + } if timeout > serverTimeout { timeout = serverTimeout } @@ -17,7 +23,7 @@ func (r *RedisRouter) StoreInvitation(invitation []byte, timeout int, password s if len(password) > 0 { r.Client.Set("mwpw:"+id, password, 0) //, time.Duration(timeout*1000000)) } - return id, time.Now().Add(time.Duration(timeout * 1000000)).UTC() + return id, time.Now().Add(time.Duration(timeout * 1000000)).UTC(), nil } func (r *RedisRouter) GetInvitation(id string, password string) ([]byte, error) { @@ -54,17 +60,26 @@ func (r *RedisRouter) GetAnswerToInvitation(id string) ([]byte, error) { return []byte(mwan), nil } -func (r *RedisRouter) createShortId(length int) string { - id := "" +func (r *RedisRouter) createShortId(length int) (string, error) { alphabet := "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" + alphabetLen := big.NewInt(int64(len(alphabet))) + // for not in redis for { - for i := 1; i <= length; i++ { - id += string(alphabet[rand.Intn(61)]) + var id strings.Builder + id.Grow(length) + + for i := 0; i < length; i++ { + n, err := rand.Int(rand.Reader, alphabetLen) + if err != nil { + return "", fmt.Errorf("random generation failed: %w", err) + } + id.WriteByte(alphabet[n.Int64()]) } - if r.Client.Get("mwiv:"+id).Err() == redis.Nil { - break + + idStr := id.String() + if r.Client.Get("mwiv:"+idStr).Err() == redis.Nil { + return idStr, nil } } - return id } diff --git a/server/router.go b/server/router.go index 52e76d6..f8163a9 100644 --- a/server/router.go +++ b/server/router.go @@ -272,7 +272,10 @@ func (r *RedisRouter) handleInvitation(msg *meowlib.ToServerMessage) (*meowlib.F switch msg.Invitation.Step { // create invitation => provide shortcode and expiry case 1: - url, expiry := r.StoreInvitation(msg.Invitation.Payload, int(msg.Invitation.Timeout), msg.Invitation.Password, r.InvitationTimeout, int(msg.Invitation.ShortcodeLen)) + url, expiry, err := r.StoreInvitation(msg.Invitation.Payload, int(msg.Invitation.Timeout), msg.Invitation.Password, r.InvitationTimeout, int(msg.Invitation.ShortcodeLen)) + if err != nil { + return nil, err + } from_server.Invitation = &meowlib.Invitation{} from_server.Invitation.Shortcode = url from_server.Invitation.Expiry = expiry.UTC().Unix() diff --git a/setup_req.sh b/setup_req.sh new file mode 100755 index 0000000..1498563 --- /dev/null +++ b/setup_req.sh @@ -0,0 +1,4 @@ +#!/bin/bash +sudo apt install -y protobuf-compiler +go install google.golang.org/protobuf/cmd/protoc-gen-go@latest +go install github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc@latest