Skip to content

Database governance built for humans and agents — controlling changes and access across every major database.

chore: fix the proto names (#4012)

Danny Xufcca234147a0
diff --git a/proto/generated-go/v1/database_role.pb.go b/proto/generated-go/v1/database_role.pb.go
index 40960d64f3..e248e48c62 100644
--- a/proto/generated-go/v1/database_role.pb.go
+++ b/proto/generated-go/v1/database_role.pb.go
@@ -208,17 +208,17 @@ func (x *DatabaseRole) GetAttribute() *DatabaseRoleAttribute {
return nil
}
-// DatabaseRoleList is the API message for role list.
-type DatabaseRoleList struct {
+// ListDatabaseRoleResponse is the API message for role list.
+type ListDatabaseRoleResponse struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
- RoleList []*DatabaseRole `protobuf:"bytes,1,rep,name=role_list,json=roleList,proto3" json:"role_list,omitempty"`
+ Roles []*DatabaseRole `protobuf:"bytes,1,rep,name=roles,proto3" json:"roles,omitempty"`
}
-func (x *DatabaseRoleList) Reset() {
- *x = DatabaseRoleList{}
+func (x *ListDatabaseRoleResponse) Reset() {
+ *x = ListDatabaseRoleResponse{}
if protoimpl.UnsafeEnabled {
mi := &file_v1_database_role_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -226,13 +226,13 @@ func (x *DatabaseRoleList) Reset() {
}
}
-func (x *DatabaseRoleList) String() string {
+func (x *ListDatabaseRoleResponse) String() string {
return protoimpl.X.MessageStringOf(x)
}
-func (*DatabaseRoleList) ProtoMessage() {}
+func (*ListDatabaseRoleResponse) ProtoMessage() {}
-func (x *DatabaseRoleList) ProtoReflect() protoreflect.Message {
+func (x *ListDatabaseRoleResponse) ProtoReflect() protoreflect.Message {
mi := &file_v1_database_role_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -244,14 +244,14 @@ func (x *DatabaseRoleList) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
-// Deprecated: Use DatabaseRoleList.ProtoReflect.Descriptor instead.
-func (*DatabaseRoleList) Descriptor() ([]byte, []int) {
+// Deprecated: Use ListDatabaseRoleResponse.ProtoReflect.Descriptor instead.
+func (*ListDatabaseRoleResponse) Descriptor() ([]byte, []int) {
return file_v1_database_role_proto_rawDescGZIP(), []int{2}
}
-func (x *DatabaseRoleList) GetRoleList() []*DatabaseRole {
+func (x *ListDatabaseRoleResponse) GetRoles() []*DatabaseRole {
if x != nil {
- return x.RoleList
+ return x.Roles
}
return nil
}
@@ -376,32 +376,32 @@ var file_v1_database_role_proto_rawDesc = []byte{
0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x74,
0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75,
0x74, 0x65, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74,
- 0x69, 0x6c, 0x22, 0x4a, 0x0a, 0x10, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f,
- 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x12, 0x36, 0x0a, 0x09, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x6c,
- 0x69, 0x73, 0x74, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,
- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65,
- 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x72, 0x6f, 0x6c, 0x65, 0x4c, 0x69, 0x73, 0x74, 0x22, 0xa6,
- 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x55,
- 0x70, 0x73, 0x65, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,
- 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61, 0x73,
- 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08, 0x70,
- 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x10, 0x63, 0x6f,
- 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18, 0x03,
- 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69,
- 0x6f, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x76, 0x61,
- 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x48,
- 0x02, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x88, 0x01, 0x01,
- 0x12, 0x45, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x05, 0x20,
- 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
- 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x41, 0x74,
- 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x48, 0x03, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69,
- 0x62, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x73, 0x73,
- 0x77, 0x6f, 0x72, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
- 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76, 0x61,
- 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61, 0x74,
- 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72,
- 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x33,
+ 0x69, 0x6c, 0x22, 0x4b, 0x0a, 0x18, 0x4c, 0x69, 0x73, 0x74, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61,
+ 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2f,
+ 0x0a, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x19, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61,
+ 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x22,
+ 0xa6, 0x02, 0x0a, 0x12, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65,
+ 0x55, 0x70, 0x73, 0x65, 0x72, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x1f, 0x0a, 0x08, 0x70, 0x61,
+ 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x48, 0x00, 0x52, 0x08,
+ 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x88, 0x01, 0x01, 0x12, 0x2e, 0x0a, 0x10, 0x63,
+ 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x05, 0x48, 0x01, 0x52, 0x0f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63, 0x74,
+ 0x69, 0x6f, 0x6e, 0x4c, 0x69, 0x6d, 0x69, 0x74, 0x88, 0x01, 0x01, 0x12, 0x24, 0x0a, 0x0b, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,
+ 0x48, 0x02, 0x52, 0x0a, 0x76, 0x61, 0x6c, 0x69, 0x64, 0x55, 0x6e, 0x74, 0x69, 0x6c, 0x88, 0x01,
+ 0x01, 0x12, 0x45, 0x0a, 0x09, 0x61, 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x18, 0x05,
+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x76, 0x31, 0x2e, 0x44, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x41,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x48, 0x03, 0x52, 0x09, 0x61, 0x74, 0x74, 0x72,
+ 0x69, 0x62, 0x75, 0x74, 0x65, 0x88, 0x01, 0x01, 0x42, 0x0b, 0x0a, 0x09, 0x5f, 0x70, 0x61, 0x73,
+ 0x73, 0x77, 0x6f, 0x72, 0x64, 0x42, 0x13, 0x0a, 0x11, 0x5f, 0x63, 0x6f, 0x6e, 0x6e, 0x65, 0x63,
+ 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x6c, 0x69, 0x6d, 0x69, 0x74, 0x42, 0x0e, 0x0a, 0x0c, 0x5f, 0x76,
+ 0x61, 0x6c, 0x69, 0x64, 0x5f, 0x75, 0x6e, 0x74, 0x69, 0x6c, 0x42, 0x0c, 0x0a, 0x0a, 0x5f, 0x61,
+ 0x74, 0x74, 0x72, 0x69, 0x62, 0x75, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65,
+ 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f,
+ 0x74, 0x6f, 0x33,
}
var (
@@ -418,14 +418,14 @@ func file_v1_database_role_proto_rawDescGZIP() []byte {
var file_v1_database_role_proto_msgTypes = make([]protoimpl.MessageInfo, 4)
var file_v1_database_role_proto_goTypes = []interface{}{
- (*DatabaseRoleAttribute)(nil), // 0: bytebase.v1.DatabaseRoleAttribute
- (*DatabaseRole)(nil), // 1: bytebase.v1.DatabaseRole
- (*DatabaseRoleList)(nil), // 2: bytebase.v1.DatabaseRoleList
- (*DatabaseRoleUpsert)(nil), // 3: bytebase.v1.DatabaseRoleUpsert
+ (*DatabaseRoleAttribute)(nil), // 0: bytebase.v1.DatabaseRoleAttribute
+ (*DatabaseRole)(nil), // 1: bytebase.v1.DatabaseRole
+ (*ListDatabaseRoleResponse)(nil), // 2: bytebase.v1.ListDatabaseRoleResponse
+ (*DatabaseRoleUpsert)(nil), // 3: bytebase.v1.DatabaseRoleUpsert
}
var file_v1_database_role_proto_depIdxs = []int32{
0, // 0: bytebase.v1.DatabaseRole.attribute:type_name -> bytebase.v1.DatabaseRoleAttribute
- 1, // 1: bytebase.v1.DatabaseRoleList.role_list:type_name -> bytebase.v1.DatabaseRole
+ 1, // 1: bytebase.v1.ListDatabaseRoleResponse.roles:type_name -> bytebase.v1.DatabaseRole
0, // 2: bytebase.v1.DatabaseRoleUpsert.attribute:type_name -> bytebase.v1.DatabaseRoleAttribute
3, // [3:3] is the sub-list for method output_type
3, // [3:3] is the sub-list for method input_type
@@ -465,7 +465,7 @@ func file_v1_database_role_proto_init() {
}
}
file_v1_database_role_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
- switch v := v.(*DatabaseRoleList); i {
+ switch v := v.(*ListDatabaseRoleResponse); i {
case 0:
return &v.state
case 1:
diff --git a/proto/v1/database_role.proto b/proto/v1/database_role.proto
index 6c2e43bfea..f8f585345d 100644
--- a/proto/v1/database_role.proto
+++ b/proto/v1/database_role.proto
@@ -45,9 +45,9 @@ message DatabaseRole {
DatabaseRoleAttribute attribute = 5;
}
-// DatabaseRoleList is the API message for role list.
-message DatabaseRoleList {
- repeated DatabaseRole role_list = 1;
+// ListDatabaseRoleResponse is the API message for role list.
+message ListDatabaseRoleResponse {
+ repeated DatabaseRole roles = 1;
}
// DatabaseRoleUpsert is the API message for upserting a database role.
diff --git a/server/openapi_instance.go b/server/openapi_instance.go
index 77b32b7959..29759939f9 100644
--- a/server/openapi_instance.go
+++ b/server/openapi_instance.go
@@ -221,11 +221,9 @@ func (s *Server) listDatabaseRole(c echo.Context) error {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to list the role").SetInternal(err)
}
- c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
-
- response := &v1pb.DatabaseRoleList{}
+ response := &v1pb.ListDatabaseRoleResponse{}
for _, role := range roleList {
- response.RoleList = append(response.RoleList, &v1pb.DatabaseRole{
+ response.Roles = append(response.Roles, &v1pb.DatabaseRole{
Name: role.Name,
InstanceId: int32(instance.ID),
ConnectionLimit: role.ConnectionLimit,
@@ -233,11 +231,12 @@ func (s *Server) listDatabaseRole(c echo.Context) error {
Attribute: role.Attribute,
})
}
-
metadataBytes, err := protojson.Marshal(response)
if err != nil {
return err
}
+
+ c.Response().Header().Set(echo.HeaderContentType, echo.MIMEApplicationJSONCharsetUTF8)
if _, err := c.Response().Write(metadataBytes); err != nil {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to write schema response for role list").SetInternal(err)
}