Skip to content

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

chore: api update (#14612)

ecmadao44d76e6d8e57
diff --git a/backend/api/v1/project_service.go b/backend/api/v1/project_service.go
index 9bbe4f60f3..833bfd809c 100644
--- a/backend/api/v1/project_service.go
+++ b/backend/api/v1/project_service.go
@@ -1477,8 +1477,10 @@ func (s *ProjectService) validateIAMPolicy(ctx context.Context, policy *v1pb.Iam
if err != nil {
return status.Errorf(codes.Internal, "failed to list roles: %v", err)
}
- roleMessages = append(roleMessages, s.iamManager.PredefinedRoles...)
- roles := convertToRoles(roleMessages)
+ roles := convertToRoles(roleMessages, v1pb.Role_CUSTOM)
+ for _, predefinedRole := range s.iamManager.PredefinedRoles {
+ roles = append(roles, convertToRole(predefinedRole, v1pb.Role_BUILT_IN))
+ }
return s.validateBindings(policy.Bindings, roles, maximumRoleExpiration)
}
diff --git a/backend/api/v1/role_service.go b/backend/api/v1/role_service.go
index fdaacc79bc..91749dd5d1 100644
--- a/backend/api/v1/role_service.go
+++ b/backend/api/v1/role_service.go
@@ -39,14 +39,46 @@ func (s *RoleService) ListRoles(ctx context.Context, _ *v1pb.ListRolesRequest) (
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to list roles: %v", err)
}
- roleMessages = append(roleMessages, s.iamManager.PredefinedRoles...)
- roles := convertToRoles(roleMessages)
+
+ roles := convertToRoles(roleMessages, v1pb.Role_CUSTOM)
+ for _, predefinedRole := range s.iamManager.PredefinedRoles {
+ roles = append(roles, convertToRole(predefinedRole, v1pb.Role_BUILT_IN))
+ }
return &v1pb.ListRolesResponse{
Roles: roles,
}, nil
}
+// GetRole gets a role.
+func (s *RoleService) GetRole(ctx context.Context, request *v1pb.GetRoleRequest) (*v1pb.Role, error) {
+ roleName := request.Name
+ roleID, err := common.GetRoleID(roleName)
+ if err != nil {
+ return nil, status.Error(codes.InvalidArgument, err.Error())
+ }
+ role, err := s.store.GetRole(ctx, roleID)
+ if err != nil {
+ return nil, status.Errorf(codes.Internal, "failed to get role: %v", err)
+ }
+ if role != nil {
+ return convertToRole(role, v1pb.Role_CUSTOM), nil
+ }
+ if predefinedRole := s.getBuildinRole(roleID); predefinedRole != nil {
+ return convertToRole(predefinedRole, v1pb.Role_BUILT_IN), nil
+ }
+ return nil, status.Errorf(codes.NotFound, "role not found: %s", roleID)
+}
+
+func (s *RoleService) getBuildinRole(roleID string) *store.RoleMessage {
+ for _, predefinedRole := range s.iamManager.PredefinedRoles {
+ if predefinedRole.ResourceID == roleID {
+ return predefinedRole
+ }
+ }
+ return nil
+}
+
// CreateRole creates a new role.
func (s *RoleService) CreateRole(ctx context.Context, request *v1pb.CreateRoleRequest) (*v1pb.Role, error) {
if err := s.licenseService.IsFeatureEnabled(api.FeatureCustomRole); err != nil {
@@ -57,6 +89,10 @@ func (s *RoleService) CreateRole(ctx context.Context, request *v1pb.CreateRoleRe
return nil, status.Errorf(codes.Internal, "principal ID not found")
}
+ if predefinedRole := s.getBuildinRole(request.RoleId); predefinedRole != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "role %s is a built-in role", request.RoleId)
+ }
+
if err := validateResourceID(request.RoleId); err != nil {
return nil, err
}
@@ -81,7 +117,7 @@ func (s *RoleService) CreateRole(ctx context.Context, request *v1pb.CreateRoleRe
if err := s.iamManager.ReloadCache(ctx); err != nil {
return nil, err
}
- return convertToRole(roleMessage), nil
+ return convertToRole(roleMessage, v1pb.Role_CUSTOM), nil
}
// UpdateRole updates an existing role.
@@ -100,6 +136,9 @@ func (s *RoleService) UpdateRole(ctx context.Context, request *v1pb.UpdateRoleRe
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
+ if predefinedRole := s.getBuildinRole(roleID); predefinedRole != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "cannot change the build-in role %s", request.Role.Name)
+ }
role, err := s.store.GetRole(ctx, roleID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get role: %v", err)
@@ -144,7 +183,7 @@ func (s *RoleService) UpdateRole(ctx context.Context, request *v1pb.UpdateRoleRe
if err := s.iamManager.ReloadCache(ctx); err != nil {
return nil, err
}
- return convertToRole(roleMessage), nil
+ return convertToRole(roleMessage, v1pb.Role_CUSTOM), nil
}
// DeleteRole deletes an existing role.
@@ -153,6 +192,9 @@ func (s *RoleService) DeleteRole(ctx context.Context, request *v1pb.DeleteRoleRe
if err != nil {
return nil, status.Error(codes.InvalidArgument, err.Error())
}
+ if predefinedRole := s.getBuildinRole(roleID); predefinedRole != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "cannot delete the build-in role %s", request.Name)
+ }
role, err := s.store.GetRole(ctx, roleID)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to get role: %v", err)
@@ -178,15 +220,15 @@ func (s *RoleService) DeleteRole(ctx context.Context, request *v1pb.DeleteRoleRe
return &emptypb.Empty{}, nil
}
-func convertToRoles(roleMessages []*store.RoleMessage) []*v1pb.Role {
+func convertToRoles(roleMessages []*store.RoleMessage, roleType v1pb.Role_Type) []*v1pb.Role {
var roles []*v1pb.Role
for _, roleMessage := range roleMessages {
- roles = append(roles, convertToRole(roleMessage))
+ roles = append(roles, convertToRole(roleMessage, roleType))
}
return roles
}
-func convertToRole(role *store.RoleMessage) *v1pb.Role {
+func convertToRole(role *store.RoleMessage, roleType v1pb.Role_Type) *v1pb.Role {
var permissions []string
for p := range role.Permissions {
permissions = append(permissions, p)
@@ -197,5 +239,6 @@ func convertToRole(role *store.RoleMessage) *v1pb.Role {
Title: role.Name,
Description: role.Description,
Permissions: permissions,
+ Type: roleType,
}
}
diff --git a/backend/api/v1/vcs_connector_service.go b/backend/api/v1/vcs_connector_service.go
index 8c0c0ca41e..7c8811fc70 100644
--- a/backend/api/v1/vcs_connector_service.go
+++ b/backend/api/v1/vcs_connector_service.go
@@ -6,6 +6,7 @@ import (
"fmt"
"log/slog"
"strings"
+ "time"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/status"
@@ -394,8 +395,8 @@ func convertStoreVCSConnector(ctx context.Context, stores *store.Store, vcsConne
v1VCSConnector := &v1pb.VCSConnector{
Name: fmt.Sprintf("%s/%s%s", common.FormatProject(vcsConnector.ProjectID), common.VCSConnectorPrefix, vcsConnector.ResourceID),
- CreateTime: timestamppb.New(vcsConnector.CreatedTime),
- UpdateTime: timestamppb.New(vcsConnector.UpdatedTime),
+ CreateTime: timestamppb.New(time.Unix(vcsConnector.CreatedTs, 0)),
+ UpdateTime: timestamppb.New(time.Unix(vcsConnector.UpdatedTs, 0)),
Creator: fmt.Sprintf("users/%s", creator.Email),
Updater: fmt.Sprintf("users/%s", updater.Email),
Title: vcsConnector.Payload.Title,
diff --git a/backend/component/iam/acl.yaml b/backend/component/iam/acl.yaml
index 027a83bfaa..3d63ec40d3 100644
--- a/backend/component/iam/acl.yaml
+++ b/backend/component/iam/acl.yaml
@@ -85,6 +85,7 @@ roles:
- bb.roles.create
- bb.roles.delete
- bb.roles.list
+ - bb.roles.get
- bb.roles.update
- bb.rollouts.create
- bb.rollouts.get
@@ -215,6 +216,7 @@ roles:
- bb.roles.create
- bb.roles.delete
- bb.roles.list
+ - bb.roles.get
- bb.roles.update
- bb.rollouts.create
- bb.rollouts.get
@@ -265,6 +267,7 @@ roles:
- bb.reviewConfigs.list
- bb.risks.list
- bb.roles.list
+ - bb.roles.get
- bb.settings.get
- bb.settings.list
- bb.groups.create
diff --git a/backend/component/iam/permission.go b/backend/component/iam/permission.go
index 00793f84ca..b470752a51 100644
--- a/backend/component/iam/permission.go
+++ b/backend/component/iam/permission.go
@@ -86,6 +86,7 @@ const (
PermissionRolesCreate Permission = "bb.roles.create"
PermissionRolesDelete Permission = "bb.roles.delete"
PermissionRolesList Permission = "bb.roles.list"
+ PermissionRolesGet Permission = "bb.roles.get"
PermissionRolesUpdate Permission = "bb.roles.update"
PermissionRolloutsCreate Permission = "bb.rollouts.create"
PermissionRolloutsGet Permission = "bb.rollouts.get"
@@ -216,6 +217,7 @@ var allPermissions = []Permission{
PermissionRolesCreate,
PermissionRolesDelete,
PermissionRolesList,
+ PermissionRolesGet,
PermissionRolesUpdate,
PermissionRolloutsCreate,
PermissionRolloutsGet,
diff --git a/backend/component/iam/permission.yaml b/backend/component/iam/permission.yaml
index 728bd2af0f..f62f1e2686 100644
--- a/backend/component/iam/permission.yaml
+++ b/backend/component/iam/permission.yaml
@@ -87,6 +87,7 @@ permissions:
- bb.roles.create
- bb.roles.delete
- bb.roles.list
+ - bb.roles.get
- bb.roles.update
- bb.rollouts.create
- bb.rollouts.get
diff --git a/backend/store/vcs_connector.go b/backend/store/vcs_connector.go
index 651d7ea4af..e8ef8bd085 100644
--- a/backend/store/vcs_connector.go
+++ b/backend/store/vcs_connector.go
@@ -25,11 +25,11 @@ type VCSConnectorMessage struct {
Payload *storepb.VCSConnector
// Output only fields
- UID int
- CreatorID int
- UpdaterID int
- CreatedTime time.Time
- UpdatedTime time.Time
+ UID int
+ CreatorID int
+ UpdaterID int
+ CreatedTs int64
+ UpdatedTs int64
}
// FindVCSConnectorMessage is the API message for finding VCS connectors.
@@ -95,7 +95,9 @@ func (s *Store) ListVCSConnectors(ctx context.Context, find *FindVCSConnectorMes
vcs_connector.resource_id,
vcs_connector.creator_id,
vcs_connector.updater_id,
- vcs_connector.payload
+ vcs_connector.payload,
+ vcs_connector.created_ts,
+ vcs_connector.updated_ts
FROM vcs_connector
LEFT JOIN project ON project.id = vcs_connector.project_id
LEFT JOIN vcs ON vcs.id = vcs_connector.vcs_id
@@ -120,6 +122,8 @@ func (s *Store) ListVCSConnectors(ctx context.Context, find *FindVCSConnectorMes
&vcsConnector.CreatorID,
&vcsConnector.UpdaterID,
&payloadStr,
+ &vcsConnector.CreatedTs,
+ &vcsConnector.UpdatedTs,
); err != nil {
return nil, err
}
@@ -169,7 +173,7 @@ func (s *Store) CreateVCSConnector(ctx context.Context, create *VCSConnectorMess
payload
)
VALUES ($1, $2, $3, $4, $5, $6)
- RETURNING id
+ RETURNING id, created_ts, updated_ts
`
if err := tx.QueryRowContext(ctx, query,
create.CreatorID,
@@ -180,6 +184,8 @@ func (s *Store) CreateVCSConnector(ctx context.Context, create *VCSConnectorMess
payload,
).Scan(
&create.UID,
+ &create.CreatedTs,
+ &create.UpdatedTs,
); err != nil {
return nil, err
}
diff --git a/frontend/src/types/iam/permission.ts b/frontend/src/types/iam/permission.ts
index 9766517721..b11d1e5410 100644
--- a/frontend/src/types/iam/permission.ts
+++ b/frontend/src/types/iam/permission.ts
@@ -103,6 +103,7 @@ export type Permission =
| "bb.roles.create"
| "bb.roles.delete"
| "bb.roles.list"
+ | "bb.roles.get"
| "bb.roles.update"
| "bb.groups.create"
| "bb.groups.update"
@@ -129,9 +130,7 @@ export type QueryPermission = PickLiteral<
| "bb.sql.admin"
>;
-export const QueryPermissionQueryOnly: QueryPermission[] = [
- "bb.sql.select",
-];
+export const QueryPermissionQueryOnly: QueryPermission[] = ["bb.sql.select"];
export const QueryPermissionQueryAny: QueryPermission[] = [
"bb.sql.select",
"bb.sql.info",
diff --git a/frontend/src/types/proto/v1/role_service.ts b/frontend/src/types/proto/v1/role_service.ts
index e1570faa1a..dac5fe1d3c 100644
--- a/frontend/src/types/proto/v1/role_service.ts
+++ b/frontend/src/types/proto/v1/role_service.ts
@@ -55,6 +55,14 @@ export interface CreateRoleRequest {
roleId: string;
}
+export interface GetRoleRequest {
+ /**
+ * The name of the role to retrieve.
+ * Format: roles/{role}
+ */
+ name: string;
+}
+
export interface UpdateRoleRequest {
role: Role | undefined;
updateMask:
@@ -75,6 +83,60 @@ export interface Role {
title: string;
description: string;
permissions: string[];
+ type: Role_Type;
+}
+
+export enum Role_Type {
+ TYPE_UNSPECIFIED = "TYPE_UNSPECIFIED",
+ BUILT_IN = "BUILT_IN",
+ CUSTOM = "CUSTOM",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function role_TypeFromJSON(object: any): Role_Type {
+ switch (object) {
+ case 0:
+ case "TYPE_UNSPECIFIED":
+ return Role_Type.TYPE_UNSPECIFIED;
+ case 1:
+ case "BUILT_IN":
+ return Role_Type.BUILT_IN;
+ case 2:
+ case "CUSTOM":
+ return Role_Type.CUSTOM;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Role_Type.UNRECOGNIZED;
+ }
+}
+
+export function role_TypeToJSON(object: Role_Type): string {
+ switch (object) {
+ case Role_Type.TYPE_UNSPECIFIED:
+ return "TYPE_UNSPECIFIED";
+ case Role_Type.BUILT_IN:
+ return "BUILT_IN";
+ case Role_Type.CUSTOM:
+ return "CUSTOM";
+ case Role_Type.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function role_TypeToNumber(object: Role_Type): number {
+ switch (object) {
+ case Role_Type.TYPE_UNSPECIFIED:
+ return 0;
+ case Role_Type.BUILT_IN:
+ return 1;
+ case Role_Type.CUSTOM:
+ return 2;
+ case Role_Type.UNRECOGNIZED:
+ default:
+ return -1;
+ }
}
function createBaseListRolesRequest(): ListRolesRequest {
@@ -305,6 +367,64 @@ export const CreateRoleRequest: MessageFns<CreateRoleRequest> = {
},
};
+function createBaseGetRoleRequest(): GetRoleRequest {
+ return { name: "" };
+}
+
+export const GetRoleRequest: MessageFns<GetRoleRequest> = {
+ encode(message: GetRoleRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
+ if (message.name !== "") {
+ writer.uint32(10).string(message.name);
+ }
+ return writer;
+ },
+
+ decode(input: BinaryReader | Uint8Array, length?: number): GetRoleRequest {
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseGetRoleRequest();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1: {
+ if (tag !== 10) {
+ break;
+ }
+
+ message.name = reader.string();
+ continue;
+ }
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skip(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): GetRoleRequest {
+ return { name: isSet(object.name) ? globalThis.String(object.name) : "" };
+ },
+
+ toJSON(message: GetRoleRequest): unknown {
+ const obj: any = {};
+ if (message.name !== "") {
+ obj.name = message.name;
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<GetRoleRequest>): GetRoleRequest {
+ return GetRoleRequest.fromPartial(base ?? {});
+ },
+ fromPartial(object: DeepPartial<GetRoleRequest>): GetRoleRequest {
+ const message = createBaseGetRoleRequest();
+ message.name = object.name ?? "";
+ return message;
+ },
+};
+
function createBaseUpdateRoleRequest(): UpdateRoleRequest {
return { role: undefined, updateMask: undefined, allowMissing: false };
}
@@ -456,7 +576,7 @@ export const DeleteRoleRequest: MessageFns<DeleteRoleRequest> = {
};
function createBaseRole(): Role {
- return { name: "", title: "", description: "", permissions: [] };
+ return { name: "", title: "", description: "", permissions: [], type: Role_Type.TYPE_UNSPECIFIED };
}
export const Role: MessageFns<Role> = {
@@ -473,6 +593,9 @@ export const Role: MessageFns<Role> = {
for (const v of message.permissions) {
writer.uint32(34).string(v!);
}
+ if (message.type !== Role_Type.TYPE_UNSPECIFIED) {
+ writer.uint32(40).int32(role_TypeToNumber(message.type));
+ }
return writer;
},
@@ -515,6 +638,14 @@ export const Role: MessageFns<Role> = {
message.permissions.push(reader.string());
continue;
}
+ case 5: {
+ if (tag !== 40) {
+ break;
+ }
+
+ message.type = role_TypeFromJSON(reader.int32());
+ continue;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -532,6 +663,7 @@ export const Role: MessageFns<Role> = {
permissions: globalThis.Array.isArray(object?.permissions)
? object.permissions.map((e: any) => globalThis.String(e))
: [],
+ type: isSet(object.type) ? role_TypeFromJSON(object.type) : Role_Type.TYPE_UNSPECIFIED,
};
},
@@ -549,6 +681,9 @@ export const Role: MessageFns<Role> = {
if (message.permissions?.length) {
obj.permissions = message.permissions;
}
+ if (message.type !== Role_Type.TYPE_UNSPECIFIED) {
+ obj.type = role_TypeToJSON(message.type);
+ }
return obj;
},
@@ -561,6 +696,7 @@ export const Role: MessageFns<Role> = {
message.title = object.title ?? "";
message.description = object.description ?? "";
message.permissions = object.permissions?.map((e) => e) || [];
+ message.type = object.type ?? Role_Type.TYPE_UNSPECIFIED;
return message;
},
};
@@ -584,6 +720,45 @@ export const RoleServiceDefinition = {
},
},
},
+ getRole: {
+ name: "GetRole",
+ requestType: GetRoleRequest,
+ requestStream: false,
+ responseType: Role,
+ responseStream: false,
+ options: {
+ _unknownFields: {
+ 8410: [new Uint8Array([4, 110, 97, 109, 101])],
+ 800010: [new Uint8Array([12, 98, 98, 46, 114, 111, 108, 101, 115, 46, 103, 101, 116])],
+ 800016: [new Uint8Array([1])],
+ 578365826: [
+ new Uint8Array([
+ 20,
+ 18,
+ 18,
+ 47,
+ 118,
+ 49,
+ 47,
+ 123,
+ 110,
+ 97,
+ 109,
+ 101,
+ 61,
+ 114,
+ 111,
+ 108,
+ 101,
+ 115,
+ 47,
+ 42,
+ 125,
+ ]),
+ ],
+ },
+ },
+ },
createRole: {
name: "CreateRole",
requestType: CreateRoleRequest,
diff --git a/frontend/src/views/project/ProjectVersionControlCreate.vue b/frontend/src/views/project/ProjectVersionControlCreate.vue
index 3685fc69d4..af7f3606d5 100644
--- a/frontend/src/views/project/ProjectVersionControlCreate.vue
+++ b/frontend/src/views/project/ProjectVersionControlCreate.vue
@@ -1,22 +1,44 @@
<template>
- <RepositorySetupWizard
- :project="project"
- @cancel="onCancel"
- @finish="onFinish"
- />
+ <div class="space-y-4 h-full flex flex-col">
+ <BBAttention
+ v-if="!externalUrl"
+ class="w-full border-none"
+ type="error"
+ :title="$t('banner.external-url')"
+ :description="$t('settings.general.workspace.external-url.description')"
+ >
+ <template #action>
+ <NButton type="primary" @click="configureSetting">
+ {{ $t("common.configure-now") }}
+ </NButton>
+ </template>
+ </BBAttention>
+ <div class="flex-1">
+ <RepositorySetupWizard
+ :project="project"
+ @cancel="onCancel"
+ @finish="onFinish"
+ />
+ </div>
+ </div>
</template>
<script lang="ts" setup>
+import { NButton } from "naive-ui";
import { computed } from "vue";
import { useI18n } from "vue-i18n";
import { useRouter } from "vue-router";
+import { BBAttention } from "@/bbkit";
import RepositorySetupWizard from "@/components/RepositorySetupWizard.vue";
import { PROJECT_V1_ROUTE_GITOPS } from "@/router/dashboard/projectV1";
+import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";
+import { SQL_EDITOR_SETTING_GENERAL_MODULE } from "@/router/sqlEditor";
import {
pushNotification,
useVCSConnectorStore,
useProjectV1Store,
useProjectByName,
+ useActuatorV1Store,
} from "@/store";
import { projectNamePrefix } from "@/store/modules/v1/common";
import { Workflow } from "@/types/proto/v1/project_service";
@@ -42,6 +64,18 @@ const onCancel = () => {
});
};
+const configureSetting = () => {
+ router.push({
+ name: router.currentRoute.value.name?.toString().startsWith("sql-editor")
+ ? SQL_EDITOR_SETTING_GENERAL_MODULE
+ : SETTING_ROUTE_WORKSPACE_GENERAL,
+ });
+};
+
+const externalUrl = computed(
+ () => useActuatorV1Store().serverInfo?.externalUrl ?? ""
+);
+
const onFinish = () => {
if (vcsConnectorList.value.length >= 1) {
// Update workflow type in local cache.
diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yaml
index bae7316065..e35299438a 100644
--- a/proto/gen/grpc-doc/openapi.yaml
+++ b/proto/gen/grpc-doc/openapi.yaml
@@ -7446,6 +7446,30 @@ paths:
schema:
$ref: '#/components/schemas/Status'
/v1/roles/{role}:
+ get:
+ tags:
+ - RoleService
+ operationId: RoleService_GetRole
+ parameters:
+ - name: role
+ in: path
+ description: The role id.
+ required: true
+ schema:
+ type: string
+ responses:
+ "200":
+ description: OK
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Role'
+ default:
+ description: Default error response
+ content:
+ application/json:
+ schema:
+ $ref: '#/components/schemas/Status'
delete:
tags:
- RoleService
@@ -13220,6 +13244,13 @@ components:
type: array
items:
type: string
+ type:
+ enum:
+ - TYPE_UNSPECIFIED
+ - BUILT_IN
+ - CUSTOM
+ type: string
+ format: enum
Rollout:
required:
- plan
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index a288236f21..717be8fd65 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -637,11 +637,14 @@
- [v1/role_service.proto](#v1_role_service-proto)
- [CreateRoleRequest](#bytebase-v1-CreateRoleRequest)
- [DeleteRoleRequest](#bytebase-v1-DeleteRoleRequest)
+ - [GetRoleRequest](#bytebase-v1-GetRoleRequest)
- [ListRolesRequest](#bytebase-v1-ListRolesRequest)
- [ListRolesResponse](#bytebase-v1-ListRolesResponse)
- [Role](#bytebase-v1-Role)
- [UpdateRoleRequest](#bytebase-v1-UpdateRoleRequest)
+ - [Role.Type](#bytebase-v1-Role-Type)
+
- [RoleService](#bytebase-v1-RoleService)
- [v1/rollout_service.proto](#v1_rollout_service-proto)
@@ -10336,6 +10339,21 @@ This value should be 4-63 characters, and valid characters are /[a-z][A-Z][0-9]/
+<a name="bytebase-v1-GetRoleRequest"></a>
+
+### GetRoleRequest
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| name | [string](#string) | | The name of the role to retrieve. Format: roles/{role} |
+
+
+
+
+
+
<a name="bytebase-v1-ListRolesRequest"></a>
### ListRolesRequest
@@ -10382,6 +10400,7 @@ When paginating, all other parameters provided to `ListRoles` must match the cal
| title | [string](#string) | | |
| description | [string](#string) | | |
| permissions | [string](#string) | repeated | |
+| type | [Role.Type](#bytebase-v1-Role-Type) | | |
@@ -10406,6 +10425,19 @@ When paginating, all other parameters provided to `ListRoles` must match the cal
+
+<a name="bytebase-v1-Role-Type"></a>
+
+### Role.Type
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| TYPE_UNSPECIFIED | 0 | |
+| BUILT_IN | 1 | |
+| CUSTOM | 2 | |
+
+
@@ -10419,6 +10451,7 @@ When paginating, all other parameters provided to `ListRoles` must match the cal
| Method Name | Request Type | Response Type | Description |
| ----------- | ------------ | ------------- | ------------|
| ListRoles | [ListRolesRequest](#bytebase-v1-ListRolesRequest) | [ListRolesResponse](#bytebase-v1-ListRolesResponse) | |
+| GetRole | [GetRoleRequest](#bytebase-v1-GetRoleRequest) | [Role](#bytebase-v1-Role) | |
| CreateRole | [CreateRoleRequest](#bytebase-v1-CreateRoleRequest) | [Role](#bytebase-v1-Role) | |
| UpdateRole | [UpdateRoleRequest](#bytebase-v1-UpdateRoleRequest) | [Role](#bytebase-v1-Role) | |
| DeleteRole | [DeleteRoleRequest](#bytebase-v1-DeleteRoleRequest) | [.google.protobuf.Empty](#google-protobuf-Empty) | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index e13c4e4203..c4ff52993c 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -2607,6 +2607,10 @@
<a href="#bytebase.v1.DeleteRoleRequest"><span class="badge">M</span>DeleteRoleRequest</a>
</li>
+ <li>
+ <a href="#bytebase.v1.GetRoleRequest"><span class="badge">M</span>GetRoleRequest</a>
+ </li>
+
<li>
<a href="#bytebase.v1.ListRolesRequest"><span class="badge">M</span>ListRolesRequest</a>
</li>
@@ -2624,6 +2628,10 @@
</li>
+ <li>
+ <a href="#bytebase.v1.Role.Type"><span class="badge">E</span>Role.Type</a>
+ </li>
+
<li>
@@ -28736,6 +28744,31 @@ are /[a-z][A-Z][0-9]/. </p></td>
+ <h3 id="bytebase.v1.GetRoleRequest">GetRoleRequest</h3>
+ <p></p>
+
+
+ <table class="field-table">
+ <thead>
+ <tr><td>Field</td><td>Type</td><td>Label</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>name</td>
+ <td><a href="#string">string</a></td>
+ <td></td>
+ <td><p>The name of the role to retrieve.
+Format: roles/{role} </p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
+
+
+
+
<h3 id="bytebase.v1.ListRolesRequest">ListRolesRequest</h3>
<p></p>
@@ -28846,6 +28879,13 @@ If this field is omitted, there are no subsequent pages. </p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>type</td>
+ <td><a href="#bytebase.v1.Role.Type">Role.Type</a></td>
+ <td></td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
@@ -28893,6 +28933,35 @@ If this field is omitted, there are no subsequent pages. </p></td>
+ <h3 id="bytebase.v1.Role.Type">Role.Type</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>TYPE_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>BUILT_IN</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>CUSTOM</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
@@ -28912,6 +28981,13 @@ If this field is omitted, there are no subsequent pages. </p></td>
<td><p></p></td>
</tr>
+ <tr>
+ <td>GetRole</td>
+ <td><a href="#bytebase.v1.GetRoleRequest">GetRoleRequest</a></td>
+ <td><a href="#bytebase.v1.Role">Role</a></td>
+ <td><p></p></td>
+ </tr>
+
<tr>
<td>CreateRole</td>
<td><a href="#bytebase.v1.CreateRoleRequest">CreateRoleRequest</a></td>
@@ -28963,6 +29039,16 @@ If this field is omitted, there are no subsequent pages. </p></td>
+ <tr>
+ <td>GetRole</td>
+ <td>GET</td>
+ <td>/v1/{name=roles/*}</td>
+ <td></td>
+ </tr>
+
+
+
+
<tr>
<td>CreateRole</td>
<td>POST</td>
diff --git a/proto/generated-go/v1/role_service.pb.go b/proto/generated-go/v1/role_service.pb.go
index 034c97ff90..b9c33dbdb8 100644
--- a/proto/generated-go/v1/role_service.pb.go
+++ b/proto/generated-go/v1/role_service.pb.go
@@ -23,6 +23,55 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+type Role_Type int32
+
+const (
+ Role_TYPE_UNSPECIFIED Role_Type = 0
+ Role_BUILT_IN Role_Type = 1
+ Role_CUSTOM Role_Type = 2
+)
+
+// Enum value maps for Role_Type.
+var (
+ Role_Type_name = map[int32]string{
+ 0: "TYPE_UNSPECIFIED",
+ 1: "BUILT_IN",
+ 2: "CUSTOM",
+ }
+ Role_Type_value = map[string]int32{
+ "TYPE_UNSPECIFIED": 0,
+ "BUILT_IN": 1,
+ "CUSTOM": 2,
+ }
+)
+
+func (x Role_Type) Enum() *Role_Type {
+ p := new(Role_Type)
+ *p = x
+ return p
+}
+
+func (x Role_Type) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Role_Type) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_role_service_proto_enumTypes[0].Descriptor()
+}
+
+func (Role_Type) Type() protoreflect.EnumType {
+ return &file_v1_role_service_proto_enumTypes[0]
+}
+
+func (x Role_Type) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Role_Type.Descriptor instead.
+func (Role_Type) EnumDescriptor() ([]byte, []int) {
+ return file_v1_role_service_proto_rawDescGZIP(), []int{6, 0}
+}
+
type ListRolesRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -200,6 +249,53 @@ func (x *CreateRoleRequest) GetRoleId() string {
return ""
}
+type GetRoleRequest struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of the role to retrieve.
+ // Format: roles/{role}
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+}
+
+func (x *GetRoleRequest) Reset() {
+ *x = GetRoleRequest{}
+ mi := &file_v1_role_service_proto_msgTypes[3]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+}
+
+func (x *GetRoleRequest) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*GetRoleRequest) ProtoMessage() {}
+
+func (x *GetRoleRequest) ProtoReflect() protoreflect.Message {
+ mi := &file_v1_role_service_proto_msgTypes[3]
+ if x != nil {
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ if ms.LoadMessageInfo() == nil {
+ ms.StoreMessageInfo(mi)
+ }
+ return ms
+ }
+ return mi.MessageOf(x)
+}
+
+// Deprecated: Use GetRoleRequest.ProtoReflect.Descriptor instead.
+func (*GetRoleRequest) Descriptor() ([]byte, []int) {
+ return file_v1_role_service_proto_rawDescGZIP(), []int{3}
+}
+
+func (x *GetRoleRequest) GetName() string {
+ if x != nil {
+ return x.Name
+ }
+ return ""
+}
+
type UpdateRoleRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
@@ -213,7 +309,7 @@ type UpdateRoleRequest struct {
func (x *UpdateRoleRequest) Reset() {
*x = UpdateRoleRequest{}
- mi := &file_v1_role_service_proto_msgTypes[3]
+ mi := &file_v1_role_service_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -225,7 +321,7 @@ func (x *UpdateRoleRequest) String() string {
func (*UpdateRoleRequest) ProtoMessage() {}
func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_role_service_proto_msgTypes[3]
+ mi := &file_v1_role_service_proto_msgTypes[4]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -238,7 +334,7 @@ func (x *UpdateRoleRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use UpdateRoleRequest.ProtoReflect.Descriptor instead.
func (*UpdateRoleRequest) Descriptor() ([]byte, []int) {
- return file_v1_role_service_proto_rawDescGZIP(), []int{3}
+ return file_v1_role_service_proto_rawDescGZIP(), []int{4}
}
func (x *UpdateRoleRequest) GetRole() *Role {
@@ -273,7 +369,7 @@ type DeleteRoleRequest struct {
func (x *DeleteRoleRequest) Reset() {
*x = DeleteRoleRequest{}
- mi := &file_v1_role_service_proto_msgTypes[4]
+ mi := &file_v1_role_service_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -285,7 +381,7 @@ func (x *DeleteRoleRequest) String() string {
func (*DeleteRoleRequest) ProtoMessage() {}
func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message {
- mi := &file_v1_role_service_proto_msgTypes[4]
+ mi := &file_v1_role_service_proto_msgTypes[5]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -298,7 +394,7 @@ func (x *DeleteRoleRequest) ProtoReflect() protoreflect.Message {
// Deprecated: Use DeleteRoleRequest.ProtoReflect.Descriptor instead.
func (*DeleteRoleRequest) Descriptor() ([]byte, []int) {
- return file_v1_role_service_proto_rawDescGZIP(), []int{4}
+ return file_v1_role_service_proto_rawDescGZIP(), []int{5}
}
func (x *DeleteRoleRequest) GetName() string {
@@ -314,15 +410,16 @@ type Role struct {
unknownFields protoimpl.UnknownFields
// Format: roles/{role}
- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
- Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
- Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
- Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"`
+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
+ Title string `protobuf:"bytes,2,opt,name=title,proto3" json:"title,omitempty"`
+ Description string `protobuf:"bytes,3,opt,name=description,proto3" json:"description,omitempty"`
+ Permissions []string `protobuf:"bytes,4,rep,name=permissions,proto3" json:"permissions,omitempty"`
+ Type Role_Type `protobuf:"varint,5,opt,name=type,proto3,enum=bytebase.v1.Role_Type" json:"type,omitempty"`
}
func (x *Role) Reset() {
*x = Role{}
- mi := &file_v1_role_service_proto_msgTypes[5]
+ mi := &file_v1_role_service_proto_msgTypes[6]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -334,7 +431,7 @@ func (x *Role) String() string {
func (*Role) ProtoMessage() {}
func (x *Role) ProtoReflect() protoreflect.Message {
- mi := &file_v1_role_service_proto_msgTypes[5]
+ mi := &file_v1_role_service_proto_msgTypes[6]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -347,7 +444,7 @@ func (x *Role) ProtoReflect() protoreflect.Message {
// Deprecated: Use Role.ProtoReflect.Descriptor instead.
func (*Role) Descriptor() ([]byte, []int) {
- return file_v1_role_service_proto_rawDescGZIP(), []int{5}
+ return file_v1_role_service_proto_rawDescGZIP(), []int{6}
}
func (x *Role) GetName() string {
@@ -378,6 +475,13 @@ func (x *Role) GetPermissions() []string {
return nil
}
+func (x *Role) GetType() Role_Type {
+ if x != nil {
+ return x.Type
+ }
+ return Role_TYPE_UNSPECIFIED
+}
+
var File_v1_role_service_proto protoreflect.FileDescriptor
var file_v1_role_service_proto_rawDesc = []byte{
@@ -413,66 +517,83 @@ var file_v1_role_service_proto_rawDesc = []byte{
0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x72,
0x6f, 0x6c, 0x65, 0x12, 0x1d, 0x0a, 0x07, 0x72, 0x6f, 0x6c, 0x65, 0x5f, 0x69, 0x64, 0x18, 0x02,
0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x06, 0x72, 0x6f, 0x6c, 0x65,
- 0x49, 0x64, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c,
- 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f, 0x6c, 0x65,
- 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x12,
- 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x18, 0x02,
- 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72,
- 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61, 0x73, 0x6b,
- 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x23, 0x0a, 0x0d,
- 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x18, 0x03, 0x20,
- 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73, 0x69, 0x6e,
- 0x67, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52,
- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,
- 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x13, 0x0a, 0x11, 0x62,
- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x6f, 0x6c, 0x65,
- 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9a, 0x01, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12,
- 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01,
- 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 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, 0x6f, 0x6e, 0x12, 0x20, 0x0a, 0x0b, 0x70,
- 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09,
- 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x3a, 0x24, 0xea,
- 0x41, 0x21, 0x0a, 0x11, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d,
- 0x2f, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x6f,
- 0x6c, 0x65, 0x7d, 0x32, 0x92, 0x04, 0x0a, 0x0b, 0x52, 0x6f, 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76,
- 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73,
- 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c,
- 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,
- 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,
- 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22,
- 0x26, 0x8a, 0xea, 0x30, 0x0d, 0x62, 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x6c, 0x69,
- 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76,
- 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74,
- 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65,
+ 0x49, 0x64, 0x22, 0x40, 0x0a, 0x0e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71,
+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01,
+ 0x28, 0x09, 0x42, 0x1a, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x13, 0x0a, 0x11, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04,
+ 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x9c, 0x01, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52,
+ 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x25, 0x0a, 0x04, 0x72, 0x6f,
+ 0x6c, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f, 0x6c,
+ 0x65, 0x12, 0x3b, 0x0a, 0x0b, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x46, 0x69, 0x65, 0x6c, 0x64, 0x4d, 0x61,
+ 0x73, 0x6b, 0x52, 0x0a, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x4d, 0x61, 0x73, 0x6b, 0x12, 0x23,
+ 0x0a, 0x0d, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x5f, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6e, 0x67, 0x18,
+ 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0c, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x4d, 0x69, 0x73, 0x73,
+ 0x69, 0x6e, 0x67, 0x22, 0x43, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c,
+ 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2e, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65,
+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x1a, 0xe2, 0x41, 0x01, 0x02, 0xfa, 0x41, 0x13, 0x0a,
+ 0x11, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x6f,
+ 0x6c, 0x65, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0xfe, 0x01, 0x0a, 0x04, 0x52, 0x6f, 0x6c,
+ 0x65, 0x12, 0x12, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x02,
+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 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, 0x6f, 0x6e, 0x12, 0x20, 0x0a,
+ 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x04, 0x20, 0x03,
+ 0x28, 0x09, 0x52, 0x0b, 0x70, 0x65, 0x72, 0x6d, 0x69, 0x73, 0x73, 0x69, 0x6f, 0x6e, 0x73, 0x12,
+ 0x2a, 0x0a, 0x04, 0x74, 0x79, 0x70, 0x65, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65,
+ 0x2e, 0x54, 0x79, 0x70, 0x65, 0x52, 0x04, 0x74, 0x79, 0x70, 0x65, 0x22, 0x36, 0x0a, 0x04, 0x54,
+ 0x79, 0x70, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50,
+ 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c, 0x0a, 0x08, 0x42, 0x55, 0x49,
+ 0x4c, 0x54, 0x5f, 0x49, 0x4e, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x43, 0x55, 0x53, 0x54, 0x4f,
+ 0x4d, 0x10, 0x02, 0x3a, 0x24, 0xea, 0x41, 0x21, 0x0a, 0x11, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x63, 0x6f, 0x6d, 0x2f, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x0c, 0x72, 0x6f, 0x6c,
+ 0x65, 0x73, 0x2f, 0x7b, 0x72, 0x6f, 0x6c, 0x65, 0x7d, 0x32, 0x84, 0x05, 0x0a, 0x0b, 0x52, 0x6f,
+ 0x6c, 0x65, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x72, 0x0a, 0x09, 0x4c, 0x69, 0x73,
+ 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x1d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,
+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65,
+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
+ 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x73, 0x52, 0x65, 0x73,
+ 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x26, 0x8a, 0xea, 0x30, 0x0d, 0x62, 0x62, 0x2e, 0x72, 0x6f,
+ 0x6c, 0x65, 0x73, 0x2e, 0x6c, 0x69, 0x73, 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93,
+ 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x70, 0x0a,
+ 0x07, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1b, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,
+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65,
0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,
- 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x32, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62,
- 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30,
- 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x04, 0x72, 0x6f, 0x6c,
- 0x65, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x94, 0x01, 0x0a,
- 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,
- 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79,
- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x53,
- 0xda, 0x41, 0x10, 0x72, 0x6f, 0x6c, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d,
- 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e,
- 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f,
- 0x7b, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x6f, 0x6c, 0x65, 0x73,
- 0x2f, 0x2a, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f,
- 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,
- 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,
- 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74,
- 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x3c, 0xda, 0x41, 0x04, 0x6e,
- 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e,
- 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3,
- 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,
- 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 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,
+ 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x35, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d,
+ 0x65, 0x8a, 0xea, 0x30, 0x0c, 0x62, 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x67, 0x65,
+ 0x74, 0x90, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31,
+ 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12,
+ 0x73, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,
+ 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,
+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65,
+ 0x22, 0x32, 0x8a, 0xea, 0x30, 0x0f, 0x62, 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x63,
+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x90, 0xea, 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4,
+ 0x93, 0x02, 0x11, 0x3a, 0x04, 0x72, 0x6f, 0x6c, 0x65, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x72,
+ 0x6f, 0x6c, 0x65, 0x73, 0x12, 0x94, 0x01, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52,
+ 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75,
+ 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,
+ 0x31, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x22, 0x53, 0xda, 0x41, 0x10, 0x72, 0x6f, 0x6c, 0x65, 0x2c,
+ 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x8a, 0xea, 0x30, 0x0f, 0x62,
+ 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x90, 0xea,
+ 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x72, 0x6f,
+ 0x6c, 0x65, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x72, 0x6f, 0x6c, 0x65, 0x2e, 0x6e, 0x61,
+ 0x6d, 0x65, 0x3d, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0a,
+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x52,
+ 0x6f, 0x6c, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f,
+ 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70,
+ 0x74, 0x79, 0x22, 0x3c, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x8a, 0xea, 0x30, 0x0f, 0x62,
+ 0x62, 0x2e, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x90, 0xea,
+ 0x30, 0x01, 0x98, 0xea, 0x30, 0x01, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76,
+ 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x2f, 0x2a, 0x7d,
+ 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 (
@@ -487,35 +608,41 @@ func file_v1_role_service_proto_rawDescGZIP() []byte {
return file_v1_role_service_proto_rawDescData
}
-var file_v1_role_service_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
+var file_v1_role_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_v1_role_service_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
var file_v1_role_service_proto_goTypes = []any{
- (*ListRolesRequest)(nil), // 0: bytebase.v1.ListRolesRequest
- (*ListRolesResponse)(nil), // 1: bytebase.v1.ListRolesResponse
- (*CreateRoleRequest)(nil), // 2: bytebase.v1.CreateRoleRequest
- (*UpdateRoleRequest)(nil), // 3: bytebase.v1.UpdateRoleRequest
- (*DeleteRoleRequest)(nil), // 4: bytebase.v1.DeleteRoleRequest
- (*Role)(nil), // 5: bytebase.v1.Role
- (*fieldmaskpb.FieldMask)(nil), // 6: google.protobuf.FieldMask
- (*emptypb.Empty)(nil), // 7: google.protobuf.Empty
+ (Role_Type)(0), // 0: bytebase.v1.Role.Type
+ (*ListRolesRequest)(nil), // 1: bytebase.v1.ListRolesRequest
+ (*ListRolesResponse)(nil), // 2: bytebase.v1.ListRolesResponse
+ (*CreateRoleRequest)(nil), // 3: bytebase.v1.CreateRoleRequest
+ (*GetRoleRequest)(nil), // 4: bytebase.v1.GetRoleRequest
+ (*UpdateRoleRequest)(nil), // 5: bytebase.v1.UpdateRoleRequest
+ (*DeleteRoleRequest)(nil), // 6: bytebase.v1.DeleteRoleRequest
+ (*Role)(nil), // 7: bytebase.v1.Role
+ (*fieldmaskpb.FieldMask)(nil), // 8: google.protobuf.FieldMask
+ (*emptypb.Empty)(nil), // 9: google.protobuf.Empty
}
var file_v1_role_service_proto_depIdxs = []int32{
- 5, // 0: bytebase.v1.ListRolesResponse.roles:type_name -> bytebase.v1.Role
- 5, // 1: bytebase.v1.CreateRoleRequest.role:type_name -> bytebase.v1.Role
- 5, // 2: bytebase.v1.UpdateRoleRequest.role:type_name -> bytebase.v1.Role
- 6, // 3: bytebase.v1.UpdateRoleRequest.update_mask:type_name -> google.protobuf.FieldMask
- 0, // 4: bytebase.v1.RoleService.ListRoles:input_type -> bytebase.v1.ListRolesRequest
- 2, // 5: bytebase.v1.RoleService.CreateRole:input_type -> bytebase.v1.CreateRoleRequest
- 3, // 6: bytebase.v1.RoleService.UpdateRole:input_type -> bytebase.v1.UpdateRoleRequest
- 4, // 7: bytebase.v1.RoleService.DeleteRole:input_type -> bytebase.v1.DeleteRoleRequest
- 1, // 8: bytebase.v1.RoleService.ListRoles:output_type -> bytebase.v1.ListRolesResponse
- 5, // 9: bytebase.v1.RoleService.CreateRole:output_type -> bytebase.v1.Role
- 5, // 10: bytebase.v1.RoleService.UpdateRole:output_type -> bytebase.v1.Role
- 7, // 11: bytebase.v1.RoleService.DeleteRole:output_type -> google.protobuf.Empty
- 8, // [8:12] is the sub-list for method output_type
- 4, // [4:8] is the sub-list for method input_type
- 4, // [4:4] is the sub-list for extension type_name
- 4, // [4:4] is the sub-list for extension extendee
- 0, // [0:4] is the sub-list for field type_name
+ 7, // 0: bytebase.v1.ListRolesResponse.roles:type_name -> bytebase.v1.Role
+ 7, // 1: bytebase.v1.CreateRoleRequest.role:type_name -> bytebase.v1.Role
+ 7, // 2: bytebase.v1.UpdateRoleRequest.role:type_name -> bytebase.v1.Role
+ 8, // 3: bytebase.v1.UpdateRoleRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 0, // 4: bytebase.v1.Role.type:type_name -> bytebase.v1.Role.Type
+ 1, // 5: bytebase.v1.RoleService.ListRoles:input_type -> bytebase.v1.ListRolesRequest
+ 4, // 6: bytebase.v1.RoleService.GetRole:input_type -> bytebase.v1.GetRoleRequest
+ 3, // 7: bytebase.v1.RoleService.CreateRole:input_type -> bytebase.v1.CreateRoleRequest
+ 5, // 8: bytebase.v1.RoleService.UpdateRole:input_type -> bytebase.v1.UpdateRoleRequest
+ 6, // 9: bytebase.v1.RoleService.DeleteRole:input_type -> bytebase.v1.DeleteRoleRequest
+ 2, // 10: bytebase.v1.RoleService.ListRoles:output_type -> bytebase.v1.ListRolesResponse
+ 7, // 11: bytebase.v1.RoleService.GetRole:output_type -> bytebase.v1.Role
+ 7, // 12: bytebase.v1.RoleService.CreateRole:output_type -> bytebase.v1.Role
+ 7, // 13: bytebase.v1.RoleService.UpdateRole:output_type -> bytebase.v1.Role
+ 9, // 14: bytebase.v1.RoleService.DeleteRole:output_type -> google.protobuf.Empty
+ 10, // [10:15] is the sub-list for method output_type
+ 5, // [5:10] is the sub-list for method input_type
+ 5, // [5:5] is the sub-list for extension type_name
+ 5, // [5:5] is the sub-list for extension extendee
+ 0, // [0:5] is the sub-list for field type_name
}
func init() { file_v1_role_service_proto_init() }
@@ -529,13 +656,14 @@ func file_v1_role_service_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: file_v1_role_service_proto_rawDesc,
- NumEnums: 0,
- NumMessages: 6,
+ NumEnums: 1,
+ NumMessages: 7,
NumExtensions: 0,
NumServices: 1,
},
GoTypes: file_v1_role_service_proto_goTypes,
DependencyIndexes: file_v1_role_service_proto_depIdxs,
+ EnumInfos: file_v1_role_service_proto_enumTypes,
MessageInfos: file_v1_role_service_proto_msgTypes,
}.Build()
File_v1_role_service_proto = out.File
diff --git a/proto/generated-go/v1/role_service.pb.gw.go b/proto/generated-go/v1/role_service.pb.gw.go
index b8b23b13b3..91c48d24f1 100644
--- a/proto/generated-go/v1/role_service.pb.gw.go
+++ b/proto/generated-go/v1/role_service.pb.gw.go
@@ -67,6 +67,42 @@ func local_request_RoleService_ListRoles_0(ctx context.Context, marshaler runtim
return msg, metadata, err
}
+func request_RoleService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetRoleRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := client.GetRole(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
+ return msg, metadata, err
+}
+
+func local_request_RoleService_GetRole_0(ctx context.Context, marshaler runtime.Marshaler, server RoleServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
+ var (
+ protoReq GetRoleRequest
+ metadata runtime.ServerMetadata
+ err error
+ )
+ val, ok := pathParams["name"]
+ if !ok {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")
+ }
+ protoReq.Name, err = runtime.String(val)
+ if err != nil {
+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)
+ }
+ msg, err := server.GetRole(ctx, &protoReq)
+ return msg, metadata, err
+}
+
var filter_RoleService_CreateRole_0 = &utilities.DoubleArray{Encoding: map[string]int{"role": 0}, Base: []int{1, 1, 0}, Check: []int{0, 1, 2}}
func request_RoleService_CreateRole_0(ctx context.Context, marshaler runtime.Marshaler, client RoleServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
@@ -245,6 +281,26 @@ func RegisterRoleServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux
}
forward_RoleService_ListRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
+ mux.Handle(http.MethodGet, pattern_RoleService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ var stream runtime.ServerTransportStream
+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.RoleService/GetRole", runtime.WithHTTPPathPattern("/v1/{name=roles/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := local_request_RoleService_GetRole_0(annotatedContext, inboundMarshaler, server, req, pathParams)
+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_RoleService_GetRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
mux.Handle(http.MethodPost, pattern_RoleService_CreateRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -362,6 +418,23 @@ func RegisterRoleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
}
forward_RoleService_ListRoles_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
+ mux.Handle(http.MethodGet, pattern_RoleService_GetRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
+ ctx, cancel := context.WithCancel(req.Context())
+ defer cancel()
+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
+ annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.RoleService/GetRole", runtime.WithHTTPPathPattern("/v1/{name=roles/*}"))
+ if err != nil {
+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ resp, md, err := request_RoleService_GetRole_0(annotatedContext, inboundMarshaler, client, req, pathParams)
+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
+ if err != nil {
+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
+ return
+ }
+ forward_RoleService_GetRole_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
+ })
mux.Handle(http.MethodPost, pattern_RoleService_CreateRole_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
@@ -418,6 +491,7 @@ func RegisterRoleServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux
var (
pattern_RoleService_ListRoles_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, ""))
+ pattern_RoleService_GetRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "roles", "name"}, ""))
pattern_RoleService_CreateRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "roles"}, ""))
pattern_RoleService_UpdateRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "roles", "role.name"}, ""))
pattern_RoleService_DeleteRole_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "roles", "name"}, ""))
@@ -425,6 +499,7 @@ var (
var (
forward_RoleService_ListRoles_0 = runtime.ForwardResponseMessage
+ forward_RoleService_GetRole_0 = runtime.ForwardResponseMessage
forward_RoleService_CreateRole_0 = runtime.ForwardResponseMessage
forward_RoleService_UpdateRole_0 = runtime.ForwardResponseMessage
forward_RoleService_DeleteRole_0 = runtime.ForwardResponseMessage
diff --git a/proto/generated-go/v1/role_service_grpc.pb.go b/proto/generated-go/v1/role_service_grpc.pb.go
index 8a84357695..039922c6b3 100644
--- a/proto/generated-go/v1/role_service_grpc.pb.go
+++ b/proto/generated-go/v1/role_service_grpc.pb.go
@@ -21,6 +21,7 @@ const _ = grpc.SupportPackageIsVersion9
const (
RoleService_ListRoles_FullMethodName = "/bytebase.v1.RoleService/ListRoles"
+ RoleService_GetRole_FullMethodName = "/bytebase.v1.RoleService/GetRole"
RoleService_CreateRole_FullMethodName = "/bytebase.v1.RoleService/CreateRole"
RoleService_UpdateRole_FullMethodName = "/bytebase.v1.RoleService/UpdateRole"
RoleService_DeleteRole_FullMethodName = "/bytebase.v1.RoleService/DeleteRole"
@@ -31,6 +32,7 @@ const (
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type RoleServiceClient interface {
ListRoles(ctx context.Context, in *ListRolesRequest, opts ...grpc.CallOption) (*ListRolesResponse, error)
+ GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error)
CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*Role, error)
UpdateRole(ctx context.Context, in *UpdateRoleRequest, opts ...grpc.CallOption) (*Role, error)
DeleteRole(ctx context.Context, in *DeleteRoleRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)
@@ -54,6 +56,16 @@ func (c *roleServiceClient) ListRoles(ctx context.Context, in *ListRolesRequest,
return out, nil
}
+func (c *roleServiceClient) GetRole(ctx context.Context, in *GetRoleRequest, opts ...grpc.CallOption) (*Role, error) {
+ cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
+ out := new(Role)
+ err := c.cc.Invoke(ctx, RoleService_GetRole_FullMethodName, in, out, cOpts...)
+ if err != nil {
+ return nil, err
+ }
+ return out, nil
+}
+
func (c *roleServiceClient) CreateRole(ctx context.Context, in *CreateRoleRequest, opts ...grpc.CallOption) (*Role, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(Role)
@@ -89,6 +101,7 @@ func (c *roleServiceClient) DeleteRole(ctx context.Context, in *DeleteRoleReques
// for forward compatibility.
type RoleServiceServer interface {
ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error)
+ GetRole(context.Context, *GetRoleRequest) (*Role, error)
CreateRole(context.Context, *CreateRoleRequest) (*Role, error)
UpdateRole(context.Context, *UpdateRoleRequest) (*Role, error)
DeleteRole(context.Context, *DeleteRoleRequest) (*emptypb.Empty, error)
@@ -105,6 +118,9 @@ type UnimplementedRoleServiceServer struct{}
func (UnimplementedRoleServiceServer) ListRoles(context.Context, *ListRolesRequest) (*ListRolesResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method ListRoles not implemented")
}
+func (UnimplementedRoleServiceServer) GetRole(context.Context, *GetRoleRequest) (*Role, error) {
+ return nil, status.Errorf(codes.Unimplemented, "method GetRole not implemented")
+}
func (UnimplementedRoleServiceServer) CreateRole(context.Context, *CreateRoleRequest) (*Role, error) {
return nil, status.Errorf(codes.Unimplemented, "method CreateRole not implemented")
}
@@ -153,6 +169,24 @@ func _RoleService_ListRoles_Handler(srv interface{}, ctx context.Context, dec fu
return interceptor(ctx, in, info, handler)
}
+func _RoleService_GetRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
+ in := new(GetRoleRequest)
+ if err := dec(in); err != nil {
+ return nil, err
+ }
+ if interceptor == nil {
+ return srv.(RoleServiceServer).GetRole(ctx, in)
+ }
+ info := &grpc.UnaryServerInfo{
+ Server: srv,
+ FullMethod: RoleService_GetRole_FullMethodName,
+ }
+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {
+ return srv.(RoleServiceServer).GetRole(ctx, req.(*GetRoleRequest))
+ }
+ return interceptor(ctx, in, info, handler)
+}
+
func _RoleService_CreateRole_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(CreateRoleRequest)
if err := dec(in); err != nil {
@@ -218,6 +252,10 @@ var RoleService_ServiceDesc = grpc.ServiceDesc{
MethodName: "ListRoles",
Handler: _RoleService_ListRoles_Handler,
},
+ {
+ MethodName: "GetRole",
+ Handler: _RoleService_GetRole_Handler,
+ },
{
MethodName: "CreateRole",
Handler: _RoleService_CreateRole_Handler,
diff --git a/proto/v1/role_service.proto b/proto/v1/role_service.proto
index 7689f14077..a8ee58d88f 100644
--- a/proto/v1/role_service.proto
+++ b/proto/v1/role_service.proto
@@ -18,6 +18,12 @@ service RoleService {
option (bytebase.v1.permission) = "bb.roles.list";
option (bytebase.v1.auth_method) = IAM;
}
+ rpc GetRole(GetRoleRequest) returns (Role) {
+ option (google.api.http) = {get: "/v1/{name=roles/*}"};
+ option (google.api.method_signature) = "name";
+ option (bytebase.v1.permission) = "bb.roles.get";
+ option (bytebase.v1.auth_method) = IAM;
+ }
rpc CreateRole(CreateRoleRequest) returns (Role) {
option (google.api.http) = {
post: "/v1/roles"
@@ -82,6 +88,15 @@ message CreateRoleRequest {
string role_id = 2 [(google.api.field_behavior) = REQUIRED];
}
+message GetRoleRequest {
+ // The name of the role to retrieve.
+ // Format: roles/{role}
+ string name = 1 [
+ (google.api.field_behavior) = REQUIRED,
+ (google.api.resource_reference) = {type: "bytebase.com/Role"}
+ ];
+}
+
message UpdateRoleRequest {
Role role = 1;
google.protobuf.FieldMask update_mask = 2;
@@ -108,4 +123,12 @@ message Role {
string title = 2;
string description = 3;
repeated string permissions = 4;
+
+ enum Type {
+ TYPE_UNSPECIFIED = 0;
+ BUILT_IN = 1;
+ CUSTOM = 2;
+ }
+
+ Type type = 5;
}