Skip to content
Snippets Groups Projects
Commit d32d915b authored by Josh Brooks's avatar Josh Brooks
Browse files

Compile proto

parent f17caaa7
No related branches found
No related tags found
4 merge requests!510Release,!419rewrote the health tracker to both consider if there are waiting rounds and...,!397Fully Decentralized channels,!340Project/channels
...@@ -44,6 +44,9 @@ type ChannelMessage struct { ...@@ -44,6 +44,9 @@ type ChannelMessage struct {
// Payload is the actual message payload. It will be processed differently // Payload is the actual message payload. It will be processed differently
// based on the PayloadType. // based on the PayloadType.
Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"` Payload []byte `protobuf:"bytes,4,opt,name=Payload,proto3" json:"Payload,omitempty"`
// nickname is the name which the user is using for this message
// it will not be longer than 24 characters
Nickname string `protobuf:"bytes,5,opt,name=Nickname,proto3" json:"Nickname,omitempty"`
} }
func (x *ChannelMessage) Reset() { func (x *ChannelMessage) Reset() {
...@@ -106,6 +109,13 @@ func (x *ChannelMessage) GetPayload() []byte { ...@@ -106,6 +109,13 @@ func (x *ChannelMessage) GetPayload() []byte {
return nil return nil
} }
func (x *ChannelMessage) GetNickname() string {
if x != nil {
return x.Nickname
}
return ""
}
// UserMessage is a message sent by a user who is a member within the channel. // UserMessage is a message sent by a user who is a member within the channel.
type UserMessage struct { type UserMessage struct {
state protoimpl.MessageState state protoimpl.MessageState
...@@ -116,27 +126,14 @@ type UserMessage struct { ...@@ -116,27 +126,14 @@ type UserMessage struct {
// end-user has submitted to the channel. This is a serialization of the // end-user has submitted to the channel. This is a serialization of the
// ChannelMessage. // ChannelMessage.
Message []byte `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"` Message []byte `protobuf:"bytes,1,opt,name=Message,proto3" json:"Message,omitempty"`
// ValidationSignature is the signature validating this user owns their
// username and may send messages to the channel under this username. This
// signature is provided by UD and may be validated by all members of the
// channel.
//
// ValidationSignature = Sig(UD_ECCPrivKey, Username | ECCPublicKey | UsernameLease)
ValidationSignature []byte `protobuf:"bytes,2,opt,name=ValidationSignature,proto3" json:"ValidationSignature,omitempty"`
// Signature is the signature proving this message has been sent by the // Signature is the signature proving this message has been sent by the
// owner of this user's public key. // owner of this user's public key.
// //
// Signature = Sig(User_ECCPublicKey, Message) // Signature = Sig(User_ECCPublicKey, Message)
Signature []byte `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"` Signature []byte `protobuf:"bytes,3,opt,name=Signature,proto3" json:"Signature,omitempty"`
// Username is the username the user has registered with the channel and
// with UD.
Username string `protobuf:"bytes,4,opt,name=Username,proto3" json:"Username,omitempty"`
// ECCPublicKey is the user's EC Public key. This is provided by the // ECCPublicKey is the user's EC Public key. This is provided by the
// network. // network.
ECCPublicKey []byte `protobuf:"bytes,5,opt,name=ECCPublicKey,proto3" json:"ECCPublicKey,omitempty"` ECCPublicKey []byte `protobuf:"bytes,5,opt,name=ECCPublicKey,proto3" json:"ECCPublicKey,omitempty"`
// UsernameLease is the lease that has been provided to the username. This
// value is provide by UD.
UsernameLease int64 `protobuf:"varint,6,opt,name=UsernameLease,proto3" json:"UsernameLease,omitempty"`
} }
func (x *UserMessage) Reset() { func (x *UserMessage) Reset() {
...@@ -178,13 +175,6 @@ func (x *UserMessage) GetMessage() []byte { ...@@ -178,13 +175,6 @@ func (x *UserMessage) GetMessage() []byte {
return nil return nil
} }
func (x *UserMessage) GetValidationSignature() []byte {
if x != nil {
return x.ValidationSignature
}
return nil
}
func (x *UserMessage) GetSignature() []byte { func (x *UserMessage) GetSignature() []byte {
if x != nil { if x != nil {
return x.Signature return x.Signature
...@@ -192,13 +182,6 @@ func (x *UserMessage) GetSignature() []byte { ...@@ -192,13 +182,6 @@ func (x *UserMessage) GetSignature() []byte {
return nil return nil
} }
func (x *UserMessage) GetUsername() string {
if x != nil {
return x.Username
}
return ""
}
func (x *UserMessage) GetECCPublicKey() []byte { func (x *UserMessage) GetECCPublicKey() []byte {
if x != nil { if x != nil {
return x.ECCPublicKey return x.ECCPublicKey
...@@ -206,43 +189,31 @@ func (x *UserMessage) GetECCPublicKey() []byte { ...@@ -206,43 +189,31 @@ func (x *UserMessage) GetECCPublicKey() []byte {
return nil return nil
} }
func (x *UserMessage) GetUsernameLease() int64 {
if x != nil {
return x.UsernameLease
}
return 0
}
var File_channelMessages_proto protoreflect.FileDescriptor var File_channelMessages_proto protoreflect.FileDescriptor
var file_channelMessages_proto_rawDesc = []byte{ var file_channelMessages_proto_rawDesc = []byte{
0x0a, 0x15, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x0a, 0x15, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65,
0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x08, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c,
0x73, 0x22, 0x7c, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x65, 0x73, 0x73, 0x73, 0x22, 0x98, 0x01, 0x0a, 0x0e, 0x43, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x4d, 0x65, 0x73,
0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20, 0x01, 0x73, 0x61, 0x67, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x01, 0x20,
0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x6f, 0x75, 0x01, 0x28, 0x03, 0x52, 0x05, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x52, 0x6f,
0x6e, 0x64, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x52, 0x6f, 0x75, 0x6e, 0x75, 0x6e, 0x64, 0x49, 0x44, 0x18, 0x02, 0x20, 0x01, 0x28, 0x04, 0x52, 0x07, 0x52, 0x6f, 0x75,
0x64, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54, 0x79, 0x6e, 0x64, 0x49, 0x44, 0x12, 0x20, 0x0a, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x54,
0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x79, 0x70, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x0b, 0x50, 0x61, 0x79, 0x6c, 0x6f,
0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x61, 0x64, 0x54, 0x79, 0x70, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61,
0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64, 0x22, 0x64, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x50, 0x61, 0x79, 0x6c, 0x6f, 0x61, 0x64,
0xdd, 0x01, 0x0a, 0x0b, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x12, 0x1a, 0x0a, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x05, 0x20, 0x01,
0x18, 0x0a, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x28, 0x09, 0x52, 0x08, 0x4e, 0x69, 0x63, 0x6b, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x69, 0x0a, 0x0b,
0x52, 0x07, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x30, 0x0a, 0x13, 0x56, 0x61, 0x6c, 0x55, 0x73, 0x65, 0x72, 0x4d, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x18, 0x0a, 0x07, 0x4d,
0x69, 0x64, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x65, 0x73, 0x73, 0x61, 0x67, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x07, 0x4d, 0x65,
0x18, 0x02, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x13, 0x56, 0x61, 0x6c, 0x69, 0x64, 0x61, 0x74, 0x69, 0x73, 0x73, 0x61, 0x67, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75,
0x6f, 0x6e, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1c, 0x0a, 0x09, 0x53, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x53, 0x69, 0x67, 0x6e, 0x61, 0x74,
0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x09, 0x75, 0x72, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x45, 0x43, 0x43, 0x50, 0x75, 0x62, 0x6c, 0x69, 0x63,
0x53, 0x69, 0x67, 0x6e, 0x61, 0x74, 0x75, 0x72, 0x65, 0x12, 0x1a, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x45, 0x43, 0x43, 0x50, 0x75,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x55, 0x73, 0x65, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x42, 0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x6c, 0x61,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x22, 0x0a, 0x0c, 0x45, 0x43, 0x43, 0x50, 0x75, 0x62, 0x6c, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c, 0x69, 0x78, 0x78, 0x69, 0x72, 0x2f, 0x63, 0x6c,
0x69, 0x63, 0x4b, 0x65, 0x79, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0c, 0x52, 0x0c, 0x45, 0x43, 0x43, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70,
0x50, 0x75, 0x62, 0x6c, 0x69, 0x63, 0x4b, 0x65, 0x79, 0x12, 0x24, 0x0a, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x03,
0x52, 0x0d, 0x55, 0x73, 0x65, 0x72, 0x6e, 0x61, 0x6d, 0x65, 0x4c, 0x65, 0x61, 0x73, 0x65, 0x42,
0x24, 0x5a, 0x22, 0x67, 0x69, 0x74, 0x6c, 0x61, 0x62, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x65, 0x6c,
0x69, 0x78, 0x78, 0x69, 0x72, 0x2f, 0x63, 0x6c, 0x69, 0x65, 0x6e, 0x74, 0x2f, 0x63, 0x68, 0x61,
0x6e, 0x6e, 0x65, 0x6c, 0x73, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
} }
var ( var (
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment