diff --git a/dns/nameserver.go b/dns/nameserver.go index c05c09715..81c616c50 100644 --- a/dns/nameserver.go +++ b/dns/nameserver.go @@ -53,9 +53,6 @@ type NameServerGroup struct { ID string `gorm:"primaryKey"` // AccountID is a reference to Account that this object belongs AccountID string `gorm:"index"` - // AccountSeqID is a per-account monotonically increasing identifier used as the - // compact wire id when sending NetworkMap components to capable peers. - AccountSeqID uint32 `json:"-" gorm:"index:idx_nameserver_groups_account_seq_id;not null;default:0"` // Name group name Name string // Description group description diff --git a/management/internals/shared/grpc/components_encoder.go b/management/internals/shared/grpc/components_encoder.go index d67102b79..ba9a040d1 100644 --- a/management/internals/shared/grpc/components_encoder.go +++ b/management/internals/shared/grpc/components_encoder.go @@ -449,11 +449,11 @@ func (e *componentEncoder) encodeNameServerGroups(nsgs []*nbdns.NameServerGroup) continue } entry := &proto.NameServerGroupRaw{ - Id: nsg.AccountSeqID, + Id: nsg.ID, Name: nsg.Name, Description: nsg.Description, Nameservers: encodeNameServers(nsg.NameServers), - GroupIds: e.groupIDsToSeq(nsg.Groups), + GroupIds: nsg.Groups, Primary: nsg.Primary, Domains: nsg.Domains, Enabled: nsg.Enabled, diff --git a/shared/management/proto/management.pb.go b/shared/management/proto/management.pb.go index 229e7c401..29afc6ad9 100644 --- a/shared/management/proto/management.pb.go +++ b/shared/management/proto/management.pb.go @@ -6131,13 +6131,13 @@ type NameServerGroupRaw struct { sizeCache protoimpl.SizeCache unknownFields protoimpl.UnknownFields - Id uint32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"` // nameserver_groups.account_seq_id + Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"` // Reuses the legacy NameServer wire shape (IP as string). Nameservers []*NameServer `protobuf:"bytes,4,rep,name=nameservers,proto3" json:"nameservers,omitempty"` - // Group ids (account_seq_id) the NSG distributes nameservers to. - GroupIds []uint32 `protobuf:"varint,5,rep,packed,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` + // Group ids the NSG distributes nameservers to. + GroupIds []string `protobuf:"bytes,5,rep,name=group_ids,json=groupIds,proto3" json:"group_ids,omitempty"` Primary bool `protobuf:"varint,6,opt,name=primary,proto3" json:"primary,omitempty"` Domains []string `protobuf:"bytes,7,rep,name=domains,proto3" json:"domains,omitempty"` Enabled bool `protobuf:"varint,8,opt,name=enabled,proto3" json:"enabled,omitempty"` @@ -6176,11 +6176,11 @@ func (*NameServerGroupRaw) Descriptor() ([]byte, []int) { return file_management_proto_rawDescGZIP(), []int{69} } -func (x *NameServerGroupRaw) GetId() uint32 { +func (x *NameServerGroupRaw) GetId() string { if x != nil { return x.Id } - return 0 + return "" } func (x *NameServerGroupRaw) GetName() string { @@ -6204,7 +6204,7 @@ func (x *NameServerGroupRaw) GetNameservers() []*NameServer { return nil } -func (x *NameServerGroupRaw) GetGroupIds() []uint32 { +func (x *NameServerGroupRaw) GetGroupIds() []string { if x != nil { return x.GroupIds } @@ -7676,7 +7676,7 @@ var file_management_proto_rawDesc = []byte{ 0x18, 0x0f, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0d, 0x73, 0x6b, 0x69, 0x70, 0x41, 0x75, 0x74, 0x6f, 0x41, 0x70, 0x70, 0x6c, 0x79, 0x22, 0xb5, 0x02, 0x0a, 0x12, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x61, 0x77, 0x12, 0x0e, 0x0a, 0x02, - 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, + 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x02, 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, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, @@ -7684,7 +7684,7 @@ var file_management_proto_rawDesc = []byte{ 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x6d, 0x61, 0x6e, 0x61, 0x67, 0x65, 0x6d, 0x65, 0x6e, 0x74, 0x2e, 0x4e, 0x61, 0x6d, 0x65, 0x53, 0x65, 0x72, 0x76, 0x65, 0x72, 0x52, 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x73, 0x65, 0x72, 0x76, 0x65, 0x72, 0x73, 0x12, 0x1b, 0x0a, 0x09, - 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0d, 0x52, + 0x67, 0x72, 0x6f, 0x75, 0x70, 0x5f, 0x69, 0x64, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x09, 0x52, 0x08, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x49, 0x64, 0x73, 0x12, 0x18, 0x0a, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x18, 0x06, 0x20, 0x01, 0x28, 0x08, 0x52, 0x07, 0x70, 0x72, 0x69, 0x6d, 0x61, 0x72, 0x79, 0x12, 0x18, 0x0a, 0x07, 0x64, 0x6f, 0x6d, 0x61, 0x69, 0x6e, 0x73, 0x18, 0x07, diff --git a/shared/management/proto/management.proto b/shared/management/proto/management.proto index 20f7fe59c..6531e16a3 100644 --- a/shared/management/proto/management.proto +++ b/shared/management/proto/management.proto @@ -1148,13 +1148,13 @@ message RouteRaw { // legacy NameServerGroup (which is the wire-trimmed shape consumed by // proto.DNSConfig and lacks the Name/Description/Groups/Enabled fields). message NameServerGroupRaw { - uint32 id = 1; // nameserver_groups.account_seq_id + string id = 1; string name = 2; string description = 3; // Reuses the legacy NameServer wire shape (IP as string). repeated NameServer nameservers = 4; - // Group ids (account_seq_id) the NSG distributes nameservers to. - repeated uint32 group_ids = 5; + // Group ids the NSG distributes nameservers to. + repeated string group_ids = 5; bool primary = 6; repeated string domains = 7; bool enabled = 8;