Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
feat: implement user group (#12088)
ecmadao4dc4c5334fdb
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.goindex 41127442e0..ba84462501 100644--- a/backend/api/v1/auth_service.go+++ b/backend/api/v1/auth_service.go@@ -546,7 +546,7 @@ func convertToUser(user *store.UserMessage) *v1pb.User {}convertedUser := &v1pb.User{- Name: fmt.Sprintf("%s%d", common.UserNamePrefix, user.ID),+ Name: common.FormatUserUID(user.ID),State: convertDeletedToState(user.MemberDeleted),Email: user.Email,Phone: user.Phone,diff --git a/backend/api/v1/issue_service_convert.go b/backend/api/v1/issue_service_convert.goindex 5ab929501b..afba8e36e6 100644--- a/backend/api/v1/issue_service_convert.go+++ b/backend/api/v1/issue_service_convert.go@@ -54,7 +54,7 @@ func convertToIssue(ctx context.Context, s *store.Store, issue *store.IssueMessaApprovalFindingDone: false,ApprovalFindingError: "",Subscribers: nil,- Creator: fmt.Sprintf("%s%s", common.UserNamePrefix, issue.Creator.Email),+ Creator: common.FormatUserEmail(issue.Creator.Email),CreateTime: timestamppb.New(issue.CreatedTime),UpdateTime: timestamppb.New(issue.UpdatedTime),Plan: "",@@ -73,11 +73,11 @@ func convertToIssue(ctx context.Context, s *store.Store, issue *store.IssueMessaissueV1.Rollout = fmt.Sprintf("%s%s/%s%d", common.ProjectNamePrefix, issue.Project.ResourceID, common.RolloutPrefix, *issue.PipelineUID)}if issue.Assignee != nil {- issueV1.Assignee = fmt.Sprintf("%s%s", common.UserNamePrefix, issue.Assignee.Email)+ issueV1.Assignee = common.FormatUserEmail(issue.Assignee.Email)}for _, subscriber := range issue.Subscribers {- issueV1.Subscribers = append(issueV1.Subscribers, fmt.Sprintf("%s%s", common.UserNamePrefix, subscriber.Email))+ issueV1.Subscribers = append(issueV1.Subscribers, common.FormatUserEmail(subscriber.Email))}if issuePayload.Approval != nil {diff --git a/backend/api/v1/logging_service.go b/backend/api/v1/logging_service.goindex 3c5fe71210..00608c238f 100644--- a/backend/api/v1/logging_service.go+++ b/backend/api/v1/logging_service.go@@ -357,7 +357,7 @@ func convertToLogEntity(ctx context.Context, stores *store.Store, activity *storif user == nil {return nil, errors.Errorf("cannot found user with id %d", activity.ContainerUID)}- resource = fmt.Sprintf("%s%s", common.UserNamePrefix, user.Email)+ resource = common.FormatUserEmail(user.Email)caseapi.ActivityIssueCreate,api.ActivityIssueCommentCreate,@@ -413,7 +413,7 @@ func convertToLogEntity(ctx context.Context, stores *store.Store, activity *storreturn &v1pb.LogEntity{Name: fmt.Sprintf("%s/%s%d", parent, common.LogNamePrefix, activity.UID),- Creator: fmt.Sprintf("%s%s", common.UserNamePrefix, user.Email),+ Creator: common.FormatUserEmail(user.Email),Resource: resource,Action: convertToActionType(activity.Type),Level: convertToLogLevel(activity.Level),diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.goindex bec5bb9f3d..6d088b54e0 100644--- a/backend/api/v1/setting_service.go+++ b/backend/api/v1/setting_service.go@@ -579,7 +579,7 @@ func (s *SettingService) convertToSettingMessage(ctx context.Context, setting *sreturn nil, status.Errorf(codes.Internal, fmt.Sprintf("failed to get creator: %v", err))}if creator != nil {- template.Creator = fmt.Sprintf("%s%s", common.UserNamePrefix, creator.Email)+ template.Creator = common.FormatUserEmail(creator.Email)}v1Value.Rules = append(v1Value.Rules, &v1pb.WorkspaceApprovalSetting_Rule{Condition: rule.Condition,diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.goindex 58dd941838..9d7f3f3b5a 100644--- a/backend/api/v1/sql_service.go+++ b/backend/api/v1/sql_service.go@@ -749,7 +749,7 @@ func (s *SQLService) convertToV1QueryHistory(ctx context.Context, history *storeStatement: history.Statement,Error: history.Payload.Error,Database: history.Database,- Creator: fmt.Sprintf("%s%s", common.UserNamePrefix, user.Email),+ Creator: common.FormatUserEmail(user.Email),CreateTime: timestamppb.New(history.CreatedTime),Duration: history.Payload.Duration,Type: historyType,diff --git a/backend/api/v1/user_group.go b/backend/api/v1/user_group.goindex 9db51e57d4..86377bdc81 100644--- a/backend/api/v1/user_group.go+++ b/backend/api/v1/user_group.go@@ -7,6 +7,7 @@ import ("google.golang.org/grpc/codes""google.golang.org/grpc/status""google.golang.org/protobuf/types/known/emptypb"+ "google.golang.org/protobuf/types/known/timestamppb""github.com/bytebase/bytebase/backend/common""github.com/bytebase/bytebase/backend/store"@@ -39,7 +40,7 @@ func (s *UserGroupService) GetUserGroup(ctx context.Context, request *v1pb.GetUsreturn nil, status.Errorf(codes.Internal, err.Error())}- return convertToV1Group(group), nil+ return s.convertToV1Group(ctx, group)}// ListUserGroups lists all groups.@@ -50,15 +51,19 @@ func (s *UserGroupService) ListUserGroups(ctx context.Context, _ *v1pb.ListUserG}response := &v1pb.ListUserGroupsResponse{}- for _, group := range groups {- response.Groups = append(response.Groups, convertToV1Group(group))+ for _, groupMessage := range groups {+ group, err := s.convertToV1Group(ctx, groupMessage)+ if err != nil {+ return nil, err+ }+ response.Groups = append(response.Groups, group)}return response, nil}// CreateUserGroup creates a group.func (s *UserGroupService) CreateUserGroup(ctx context.Context, request *v1pb.CreateUserGroupRequest) (*v1pb.UserGroup, error) {- groupMessage, err := convertToGroupMessage(request.Group)+ groupMessage, err := s.convertToGroupMessage(ctx, request.Group)if err != nil {return nil, status.Errorf(codes.InvalidArgument, err.Error())}@@ -73,7 +78,7 @@ func (s *UserGroupService) CreateUserGroup(ctx context.Context, request *v1pb.Crreturn nil, status.Errorf(codes.Internal, err.Error())}- return convertToV1Group(group), nil+ return s.convertToV1Group(ctx, group)}// UpdateUserGroup updates a group.@@ -89,7 +94,6 @@ func (s *UserGroupService) UpdateUserGroup(ctx context.Context, request *v1pb.Up}patch := &store.UpdateUserGroupMessage{}-for _, path := range request.UpdateMask.Paths {switch path {case "title":@@ -97,7 +101,7 @@ func (s *UserGroupService) UpdateUserGroup(ctx context.Context, request *v1pb.Upcase "description":patch.Description = &request.Group.Descriptioncase "members":- payload, err := convertToGroupPayload(request.Group)+ payload, err := s.convertToGroupPayload(ctx, request.Group)if err != nil {return nil, status.Errorf(codes.InvalidArgument, err.Error())}@@ -112,7 +116,7 @@ func (s *UserGroupService) UpdateUserGroup(ctx context.Context, request *v1pb.Upreturn nil, status.Errorf(codes.Internal, err.Error())}- return convertToV1Group(groupMessage), nil+ return s.convertToV1Group(ctx, groupMessage)}// DeleteUserGroup deletes a group.@@ -129,11 +133,23 @@ func (s *UserGroupService) DeleteUserGroup(ctx context.Context, request *v1pb.Dereturn &emptypb.Empty{}, nil}-func convertToGroupPayload(group *v1pb.UserGroup) (*storepb.UserGroupPayload, error) {+func (s *UserGroupService) convertToGroupPayload(ctx context.Context, group *v1pb.UserGroup) (*storepb.UserGroupPayload, error) {payload := &storepb.UserGroupPayload{}for _, member := range group.Members {+ email, err := common.GetUserEmail(member.Member)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get member email, error %v", err)+ }+ user, err := s.store.GetUserByEmail(ctx, email)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get member %s, error %v", member.Member, err)+ }+ if user == nil {+ return nil, status.Errorf(codes.InvalidArgument, "cannot found member %s", member.Member)+ }+m := &storepb.UserGroupMember{- Member: member.Member,+ Member: common.FormatUserUID(user.ID),}switch member.Role {case v1pb.UserGroupMember_MEMBER:@@ -148,7 +164,7 @@ func convertToGroupPayload(group *v1pb.UserGroup) (*storepb.UserGroupPayload, erreturn payload, nil}-func convertToGroupMessage(group *v1pb.UserGroup) (*store.UserGroupMessage, error) {+func (s *UserGroupService) convertToGroupMessage(ctx context.Context, group *v1pb.UserGroup) (*store.UserGroupMessage, error) {email, err := common.GetUserGroupEmail(group.Name)if err != nil {return nil, status.Errorf(codes.InvalidArgument, err.Error())@@ -161,7 +177,7 @@ func convertToGroupMessage(group *v1pb.UserGroup) (*store.UserGroupMessage, erroPayload: &storepb.UserGroupPayload{},}- payload, err := convertToGroupPayload(group)+ payload, err := s.convertToGroupPayload(ctx, group)if err != nil {return nil, status.Errorf(codes.InvalidArgument, err.Error())}@@ -169,17 +185,38 @@ func convertToGroupMessage(group *v1pb.UserGroup) (*store.UserGroupMessage, erroreturn groupMessage, nil}-func convertToV1Group(groupMessage *store.UserGroupMessage) *v1pb.UserGroup {+func (s *UserGroupService) convertToV1Group(ctx context.Context, groupMessage *store.UserGroupMessage) (*v1pb.UserGroup, error) {+ creator, err := s.store.GetUserByID(ctx, groupMessage.CreatorUID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get creator, error %v", err)+ }+ if creator == nil {+ return nil, status.Errorf(codes.NotFound, "creator %d not found", groupMessage.CreatorUID)+ }+group := &v1pb.UserGroup{Name: fmt.Sprintf("%s%s", common.UserGroupPrefix, groupMessage.Email),Title: groupMessage.Title,Description: groupMessage.Description,- Creator: fmt.Sprintf("%s%d", common.UserNamePrefix, groupMessage.CreatorUID),+ Creator: common.FormatUserEmail(creator.Email),+ CreateTime: timestamppb.New(groupMessage.CreatedTime),}for _, member := range groupMessage.Payload.Members {+ uid, err := common.GetUserID(member.Member)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get member id, error %v", err)+ }+ user, err := s.store.GetUserByID(ctx, uid)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get member, error %v", err)+ }+ if user == nil {+ continue+ }+m := &v1pb.UserGroupMember{- Member: member.Member,+ Member: common.FormatUserEmail(user.Email),Role: v1pb.UserGroupMember_ROLE_UNSPECIFIED,}switch member.Role {@@ -191,5 +228,5 @@ func convertToV1Group(groupMessage *store.UserGroupMessage) *v1pb.UserGroup {group.Members = append(group.Members, m)}- return group+ return group, nil}diff --git a/backend/store/user_group.go b/backend/store/user_group.goindex 5337f93c4c..8ed94d2841 100644--- a/backend/store/user_group.go+++ b/backend/store/user_group.go@@ -33,6 +33,7 @@ type UserGroupMessage struct {Description stringCreatorUID intPayload *storepb.UserGroupPayload+ CreatedTime time.Time}// GetUserGroup gets a group.@@ -97,12 +98,14 @@ func (*Store) listUserGroupImpl(ctx context.Context, tx *Tx, find *FindUserGrouprows, err := tx.QueryContext(ctx, fmt.Sprintf(`SELECTemail,+ created_ts,creator_id,name,description,payloadFROM user_groupWHERE %s+ ORDER BY created_ts DESC`, strings.Join(where, " AND ")), args...)if err != nil {return nil, err@@ -112,8 +115,10 @@ func (*Store) listUserGroupImpl(ctx context.Context, tx *Tx, find *FindUserGroupfor rows.Next() {var group UserGroupMessagevar payload []byte+ var createdTs int64if err := rows.Scan(&group.Email,+ &createdTs,&group.CreatorUID,&group.Title,&group.Description,@@ -121,7 +126,7 @@ func (*Store) listUserGroupImpl(ctx context.Context, tx *Tx, find *FindUserGroup); err != nil {return nil, err}-+ group.CreatedTime = time.Unix(createdTs, 0)groupPayload := storepb.UserGroupPayload{}if err := protojson.Unmarshal(payload, &groupPayload); err != nil {return nil, err@@ -152,6 +157,7 @@ func (s *Store) CreateUserGroup(ctx context.Context, create *UserGroupMessage, cdescription,payload) VALUES ($1, $2, $3, $4, $5, $6)+ RETURNING created_ts`payloadBytes, err := protojson.Marshal(create.Payload)if err != nil {@@ -164,7 +170,8 @@ func (s *Store) CreateUserGroup(ctx context.Context, create *UserGroupMessage, c}defer tx.Rollback()- if _, err := tx.ExecContext(+ var createdTs int64+ if err := tx.QueryRowContext(ctx,query,create.Email,@@ -173,9 +180,10 @@ func (s *Store) CreateUserGroup(ctx context.Context, create *UserGroupMessage, ccreate.Title,create.Description,payloadBytes,- ); err != nil {+ ).Scan(&createdTs); err != nil {return nil, err}+ create.CreatedTime = time.Unix(createdTs, 0)if err := tx.Commit(); err != nil {return nil, errors.Wrap(err, "failed to commit")@@ -211,18 +219,22 @@ func (s *Store) UpdateUserGroup(ctx context.Context, email string, patch *Updatevar group UserGroupMessagevar payload []byte+ var createdTs int64+if err := tx.QueryRowContext(ctx, fmt.Sprintf(`UPDATE user_groupSET %sWHERE email = $%dRETURNINGemail,+ created_ts,creator_id,name,description,payload`, strings.Join(set, ", "), len(set)+1), args...).Scan(&group.Email,+ &createdTs,&group.CreatorUID,&group.Title,&group.Description,@@ -231,6 +243,7 @@ func (s *Store) UpdateUserGroup(ctx context.Context, email string, patch *Updatereturn nil, err}+ group.CreatedTime = time.Unix(createdTs, 0)groupPayload := storepb.UserGroupPayload{}if err := protojson.Unmarshal(payload, &groupPayload); err != nil {return nil, errdiff --git a/frontend/src/components/ProvideDashboardContext.vue b/frontend/src/components/ProvideDashboardContext.vueindex 52a174a55d..f2f78726af 100644--- a/frontend/src/components/ProvideDashboardContext.vue+++ b/frontend/src/components/ProvideDashboardContext.vue@@ -15,6 +15,7 @@ import {useUserStore,useUIStateStore,useDatabaseV1Store,+ useUserGroupStore,} from "@/store";import { projectNamePrefix } from "@/store/modules/v1/common";import { PolicyResourceType } from "@/types/proto/v1/org_policy_service";@@ -52,6 +53,7 @@ onMounted(async () => {// Then prepare the other resources.await Promise.all([useUserStore().fetchUserList(),+ useUserGroupStore().fetchGroupList(),useEnvironmentV1Store().fetchEnvironments(),useInstanceV1Store().fetchInstanceList(),useProjectV1Store().fetchProjectList(true /* showDeleted */),diff --git a/frontend/src/components/User/Settings/CreateGroupDrawer.vue b/frontend/src/components/User/Settings/CreateGroupDrawer.vuenew file mode 100644index 0000000000..43a4a6416a--- /dev/null+++ b/frontend/src/components/User/Settings/CreateGroupDrawer.vue@@ -0,0 +1,362 @@+<template>+ <Drawer @close="$emit('close')">+ <DrawerContent+ class="w-[50rem] max-w-[90vw] relative"+ :title="+ isCreating+ ? $t('settings.members.groups.add-group')+ : $t('settings.members.groups.update-group')+ "+ >+ <template #default>+ <div class="flex flex-col gap-y-4">+ <div class="flex flex-col gap-y-2">+ <div>+ <label class="textlabel block">+ {{ $t("settings.members.groups.form.email") }}+ <span class="text-red-600">*</span>+ </label>+ <span class="textinfolabel">+ {{ $t("settings.members.groups.form.email-tips") }}+ </span>+ </div>+ <NInput+ v-model:value="state.group.email"+ :disabled="!isCreating || !allowEdit"+ placeholder="The unique email"+ />+ </div>+ <div class="flex flex-col gap-y-2">+ <label class="textlabel block">+ {{ $t("settings.members.groups.form.title") }}+ <span class="text-red-600">*</span>+ </label>+ <NInput v-model:value="state.group.title" :disabled="!allowEdit" />+ </div>+ <div class="flex flex-col gap-y-2">+ <label class="textlabel block">+ {{ $t("settings.members.groups.form.description") }}+ </label>+ <NInput+ v-model:value="state.group.description"+ :disabled="!allowEdit"+ />+ </div>+ <div class="flex flex-col gap-y-2">+ <label class="textlabel block">+ {{ $t("settings.members.groups.form.members") }}+ <span class="text-red-600">*</span>+ </label>+ <div class="flex flex-col space-y-2">+ <div+ v-for="(member, i) in state.group.members"+ :key="member.member"+ class="w-full flex items-center space-x-3"+ >+ <UserSelect+ :user="getUserUidForMember(member)"+ :multiple="false"+ :size="'medium'"+ :include-all="false"+ @update:user="(uid: string) => updateMemberEmail(i, uid)"+ />+ <GroupMemberRoleSelect+ :value="member.role"+ :size="'medium'"+ @update:value="+ (role: UserGroupMember_Role) => updateMemberRole(i, role)+ "+ />+ <div class="pl-5 flex justify-end">+ <NButton+ quaternary+ circle+ size="tiny"+ @click="deleteMember(i)"+ >+ <template #icon>+ <Trash2Icon class="w-4 h-auto" />+ </template>+ </NButton>+ </div>+ </div>+ </div>+ <div>+ <NButton :disabled="!allowEdit" @click="addMember">+ {{ $t("settings.members.groups.form.add-member") }}+ </NButton>+ </div>+ </div>+ </div>+ </template>+ <template #footer>+ <div class="w-full flex justify-between items-center">+ <div>+ <NPopconfirm+ v-if="!isCreating"+ :disabled="!allowEdit"+ @positive-click="handleDeleteGroup"+ >+ <template #trigger>+ <NButton+ quaternary+ size="small"+ :disabled="!allowEdit"+ @click.stop+ >+ <template #icon>+ <Trash2Icon class="w-4 h-auto" />+ </template>+ <template #default>+ {{ $t("common.delete") }}+ </template>+ </NButton>+ </template>++ <template #default>+ <div>+ {{ $t("settings.members.action.delete-confirm-title") }}+ </div>+ </template>+ </NPopconfirm>+ </div>++ <div class="flex flex-row items-center justify-end gap-x-3">+ <NButton @click="$emit('close')">+ {{ $t("common.cancel") }}+ </NButton>+ <NTooltip :disabled="!errorMessage">+ <template #trigger>+ <NButton+ type="primary"+ :disabled="!allowEdit || !allowConfirm"+ :loading="state.isRequesting"+ @click="tryCreateOrUpdateGroup"+ >+ {{ $t("common.confirm") }}+ </NButton>+ </template>+ <span class="w-56 text-sm">+ {{ errorMessage }}+ </span>+ </NTooltip>+ </div>+ </div>+ </template>+ </DrawerContent>+ </Drawer>+</template>++<script lang="ts" setup>+import { cloneDeep, isEqual } from "lodash-es";+import { Trash2Icon } from "lucide-vue-next";+import { NPopconfirm, NButton, NInput, NTooltip } from "naive-ui";+import { computed, reactive } from "vue";+import { useI18n } from "vue-i18n";+import {+ useUserGroupStore,+ useCurrentUserV1,+ pushNotification,+ useUserStore,+} from "@/store";+import {+ getGroupEmail,+ userNamePrefix,+ userGroupNamePrefix,+} from "@/store/modules/v1/common";+import { getUserEmailFromIdentifier } from "@/store/modules/v1/common";+import {+ UserGroup,+ UserGroupMember,+ UserGroupMember_Role,+} from "@/types/proto/v1/user_group";+import { isValidEmail } from "@/utils";+import { extractUserUID } from "@/utils";++interface LocalState {+ isRequesting: boolean;+ group: {+ email: string;+ title: string;+ description: string;+ members: UserGroupMember[];+ };+}++const props = defineProps<{+ group?: UserGroup;+}>();++const emit = defineEmits<{+ (event: "close"): void;+}>();++const { t } = useI18n();+const userStore = useUserStore();+const groupStore = useUserGroupStore();+const currentUserV1 = useCurrentUserV1();++const state = reactive<LocalState>({+ isRequesting: false,+ group: {+ email: getGroupEmail(props.group?.name ?? ""),+ title: props.group?.title ?? "",+ description: props.group?.description ?? "",+ members: cloneDeep(props.group?.members ?? []),+ },+});++const isCreating = computed(() => !props.group);++const selfMemberInGroup = computed(() => {+ return props.group?.members.find(+ (member) =>+ getUserEmailFromIdentifier(member.member) === currentUserV1.value.email+ );+});++const allowEdit = computed(() => {+ if (selfMemberInGroup.value?.role === UserGroupMember_Role.OWNER) {+ return true;+ }+ // TODO(ed): permission check+ return true;+});++const validGroup = computed(() => {+ const memberMap = new Map<string, UserGroupMember>();+ for (const member of state.group.members) {+ if (!member.member) {+ continue;+ }+ if (+ !memberMap.has(member.member) ||+ member.role === UserGroupMember_Role.OWNER+ ) {+ memberMap.set(member.member, member);+ }+ }+ return UserGroup.fromPartial({+ name: `${userGroupNamePrefix}${state.group.email}`,+ title: state.group.title,+ creator: props.group?.creator ?? "",+ description: state.group.description,+ members: [...memberMap.values()],+ });+});++const errorMessage = computed(() => {+ if (!isValidEmail(state.group.email)) {+ return "Invalid group email";+ }+ if (!state.group.title) {+ return "Title is required";+ }+ if (!validGroup.value.members.length) {+ return "At least select 1 member for the group";+ }+ if (+ !validGroup.value.members.some(+ (member) => member.role === UserGroupMember_Role.OWNER+ )+ ) {+ return "At least has 1 owner in the group";+ }++ return "";+});++const allowConfirm = computed(() => {+ if (errorMessage.value) {+ return false;+ }++ return !isEqual(props.group, validGroup.value);+});++const addMember = () => {+ const member = UserGroupMember.fromPartial({+ role:+ state.group.members.length === 0+ ? UserGroupMember_Role.OWNER+ : UserGroupMember_Role.MEMBER,+ });+ state.group.members.push(member);+};++const getUserUidForMember = (member: UserGroupMember) => {+ if (!member.member) {+ return;+ }+ const email = getUserEmailFromIdentifier(member.member);+ const user = userStore.getUserByEmail(email);+ if (!user) {+ return;+ }+ return extractUserUID(user.name);+};++const updateMemberEmail = (index: number, uid: string) => {+ const user = userStore.getUserById(uid);+ if (!user) {+ return;+ }+ state.group.members[index] = {+ ...state.group.members[index],+ member: `${userNamePrefix}${user.email}`,+ };+};++const updateMemberRole = (index: number, role: UserGroupMember_Role) => {+ state.group.members[index] = {+ ...state.group.members[index],+ role,+ };+};++const deleteMember = (index: number) => {+ state.group.members.splice(index, 1);+};++const handleDeleteGroup = async () => {+ if (!props.group) {+ return;+ }+ await groupStore.deleteGroup(props.group.name);+ pushNotification({+ module: "bytebase",+ style: "INFO",+ title: t("common.deleted"),+ });+ emit("close");+};++const tryCreateOrUpdateGroup = async () => {+ state.isRequesting = true;++ try {+ if (isCreating.value) {+ await groupStore.createGroup(validGroup.value);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.created"),+ });+ } else {+ await groupStore.updateGroup(validGroup.value, [+ "title",+ "description",+ "members",+ ]);+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.updated"),+ });+ }+ emit("close");+ } finally {+ state.isRequesting = false;+ }+};+</script>diff --git a/frontend/src/components/User/Settings/UserDataTable/cells/UserGroupsCell.vue b/frontend/src/components/User/Settings/UserDataTable/cells/UserGroupsCell.vuenew file mode 100644index 0000000000..09c6b77a04--- /dev/null+++ b/frontend/src/components/User/Settings/UserDataTable/cells/UserGroupsCell.vue@@ -0,0 +1,45 @@+<template>+ <div class="flex flex-row items-center flex-wrap gap-2">+ <NTag+ v-for="group in userGroups"+ :key="group.name"+ class="!cursor-pointer hover:bg-gray-200"+ @click="$emit('select-group', group)"+ >+ {{ group.title }}+ </NTag>+ <span v-if="userGroups.length === 0">-</span>+ </div>+</template>++<script lang="ts" setup>+import { NTag } from "naive-ui";+import { computed } from "vue";+import { useUserGroupStore } from "@/store";+import { getUserEmailFromIdentifier } from "@/store/modules/v1/common";+import type { User } from "@/types/proto/v1/auth_service";+import type { UserGroup } from "@/types/proto/v1/user_group";++const props = defineProps<{+ user: User;+}>();++defineEmits<{+ (event: "select-group", group: UserGroup): void;+}>();++const groupStore = useUserGroupStore();++const userGroups = computed(() => {+ const groups = [];+ for (const group of groupStore.groupList) {+ for (const member of group.members) {+ if (getUserEmailFromIdentifier(member.member) === props.user.email) {+ groups.push(group);+ break;+ }+ }+ }+ return groups;+});+</script>diff --git a/frontend/src/components/User/Settings/UserDataTable/index.vue b/frontend/src/components/User/Settings/UserDataTable/index.vueindex 6b3b22cf0c..e1866c8414 100644--- a/frontend/src/components/User/Settings/UserDataTable/index.vue+++ b/frontend/src/components/User/Settings/UserDataTable/index.vue@@ -24,7 +24,9 @@ import { computed, reactive, h } from "vue";import { useI18n } from "vue-i18n";import { useUserStore } from "@/store";import type { User } from "@/types/proto/v1/auth_service";+import type { UserGroup } from "@/types/proto/v1/user_group";import { copyServiceKeyToClipboardIfNeeded } from "../common";+import UserGroupsCell from "./cells/UserGroupsCell.vue";import UserNameCell from "./cells/UserNameCell.vue";import UserOperationsCell from "./cells/UserOperationsCell.vue";import UserRolesCell from "./cells/UserRolesCell.vue";@@ -40,6 +42,7 @@ defineProps<{const emit = defineEmits<{(event: "update-user", user: User): void;+ (event: "select-group", group: UserGroup): void;}>();const { t } = useI18n();@@ -70,6 +73,16 @@ const columns = computed(() => {});},},+ {+ key: "groups",+ title: t("settings.members.table.groups"),+ render: (user: User) => {+ return h(UserGroupsCell, {+ user,+ "onSelect-group": (group) => emit("select-group", group),+ });+ },+ },{key: "operations",title: "",diff --git a/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupMemberRoleSelect.vue b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupMemberRoleSelect.vuenew file mode 100644index 0000000000..0efb3ea8c1--- /dev/null+++ b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupMemberRoleSelect.vue@@ -0,0 +1,44 @@+<template>+ <NSelect+ :filterable="false"+ :virtual-scroll="true"+ :multiple="false"+ :value="value"+ :size="size"+ :options="options"+ @update:value="(val: UserGroupMember_Role) => $emit('update:value', val)"+ />+</template>++<script lang="ts" setup>+import type { SelectOption } from "naive-ui";+import { computed } from "vue";+import { useI18n } from "vue-i18n";+import {+ UserGroupMember_Role,+ userGroupMember_RoleToJSON,+} from "@/types/proto/v1/user_group";++defineProps<{+ value: UserGroupMember_Role;+ size: "tiny" | "small" | "medium" | "large";+}>();++defineEmits<{+ (event: "update:value", value: UserGroupMember_Role): void;+}>();++const { t } = useI18n();++const options = computed(() => {+ return [+ UserGroupMember_Role.OWNER,+ UserGroupMember_Role.MEMBER,+ ].map<SelectOption>((role) => ({+ value: role,+ label: t(+ `settings.members.groups.form.role.${userGroupMember_RoleToJSON(role).toLowerCase()}`+ ),+ }));+});+</script>diff --git a/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupOperationsCell.vue b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupOperationsCell.vuenew file mode 100644index 0000000000..02d81d1ad3--- /dev/null+++ b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/GroupOperationsCell.vue@@ -0,0 +1,40 @@+<template>+ <div class="flex justify-end space-x-2">+ <template v-if="allowEdit">+ <NButton quaternary size="tiny" @click="$emit('delete-group')">+ <template #icon>+ <Trash2Icon class="w-4 h-auto" />+ </template>+ </NButton>+ <NButton quaternary size="tiny" @click="$emit('update-group')">+ <template #icon>+ <PencilIcon class="w-4 h-auto" />+ </template>+ </NButton>+ </template>+ </div>+</template>++<script lang="ts" setup>+import { PencilIcon, Trash2Icon } from "lucide-vue-next";+import { NButton } from "naive-ui";+import { computed } from "vue";+import { useCurrentUserV1 } from "@/store";+import { PresetRoleType } from "@/types";+import type { UserGroup } from "@/types/proto/v1/user_group";++defineProps<{+ group: UserGroup;+}>();++defineEmits<{+ (event: "update-group"): void;+ (event: "delete-group"): void;+}>();++const currentUserV1 = useCurrentUserV1();++const allowEdit = computed(() => {+ return currentUserV1.value.roles.includes(PresetRoleType.WORKSPACE_ADMIN);+});+</script>diff --git a/frontend/src/components/User/Settings/UserDataTableByGroup/cells/UserNameCell.vue b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/UserNameCell.vuenew file mode 100644index 0000000000..d3c9d8fcac--- /dev/null+++ b/frontend/src/components/User/Settings/UserDataTableByGroup/cells/UserNameCell.vue@@ -0,0 +1,49 @@+<template>+ <div class="flex flex-row items-center shrink space-x-2">+ <UserAvatar :user="user" />++ <div class="flex flex-row items-center">+ <div class="flex flex-col">+ <div class="flex flex-row items-center space-x-2">+ <router-link :to="`/users/${user.email}`" class="normal-link">+ {{ user.title }}+ </router-link>+ <YouTag v-if="currentUserV1.name === user.name" />+ <SystemBotTag v-if="user.name === SYSTEM_BOT_USER_NAME" />+ <ServiceAccountTag+ v-if="user.userType === UserType.SERVICE_ACCOUNT"+ />+ <NTag+ size="small"+ round+ :type="role === UserGroupMember_Role.OWNER ? 'primary' : 'default'"+ >+ {{ role }}+ </NTag>+ </div>+ <span v-if="user.name !== SYSTEM_BOT_USER_NAME" class="textlabel">+ {{ user.email }}+ </span>+ </div>+ </div>+ </div>+</template>++<script lang="ts" setup>+import { useCurrentUserV1 } from "@/store";+import { SYSTEM_BOT_USER_NAME } from "@/types";+import type { User } from "@/types/proto/v1/auth_service";+import { UserType } from "@/types/proto/v1/auth_service";+import { UserGroupMember_Role } from "@/types/proto/v1/user_group";++defineProps<{+ user: User;+ role: UserGroupMember_Role;+}>();++defineEmits<{+ (event: "reset-service-key", user: User): void;+}>();++const currentUserV1 = useCurrentUserV1();+</script>diff --git a/frontend/src/components/User/Settings/UserDataTableByGroup/index.vue b/frontend/src/components/User/Settings/UserDataTableByGroup/index.vuenew file mode 100644index 0000000000..a820aa659c--- /dev/null+++ b/frontend/src/components/User/Settings/UserDataTableByGroup/index.vue@@ -0,0 +1,170 @@+<template>+ <NDataTable+ :columns="columns"+ :data="userListByGroup"+ :row-key="(row) => row.name"+ :bordered="true"+ :default-expanded-row-keys="expandedRowKeys"+ />+</template>++<script lang="ts" setup>+import type { DataTableColumn } from "naive-ui";+import { NDataTable, useDialog } from "naive-ui";+import { computed, h } from "vue";+import { useI18n } from "vue-i18n";+import { useUserGroupStore, pushNotification } from "@/store";+import { getUserEmailFromIdentifier } from "@/store/modules/v1/common";+import type { User } from "@/types/proto/v1/auth_service";+import {+ UserGroup,+ type UserGroupMember_Role,+} from "@/types/proto/v1/user_group";+import GroupOperationsCell from "./cells/GroupOperationsCell.vue";+import UserNameCell from "./cells/UserNameCell.vue";++interface GroupRowData {+ type: "group";+ name: string;+ group: UserGroup;+ children: UserRowData[];+}++interface UserRowData {+ type: "user";+ name: string;+ user: User;+ role: UserGroupMember_Role;+}++const props = defineProps<{+ userList: User[];+}>();++const emit = defineEmits<{+ (event: "update-group", group: UserGroup): void;+}>();++const { t } = useI18n();+const groupStore = useUserGroupStore();+const $dialog = useDialog();++const expandedRowKeys = computed(() =>+ groupStore.groupList.map((group) => group.name)+);++const columns = computed(() => {+ return [+ {+ key: "group-members",+ title: `${t("settings.members.groups.self")} / ${t("common.members")}`,+ className: "flex items-center",+ render: (row: GroupRowData | UserRowData) => {+ if (row.type === "group") {+ return h("div", {}, [+ h(+ "div",+ {+ class: "flex items-center",+ },+ [+ h(+ "span",+ {+ class: "font-medium",+ },+ row.group.title+ ),+ h(+ "span",+ {+ class: "ml-1 font-normal text-control-light",+ },+ `(${row.children.length})`+ ),+ ]+ ),+ h(+ "span",+ { class: "textinfolabel text-sm" },+ row.group.description+ ),+ ]);+ }++ return h(UserNameCell, {+ user: row.user,+ role: row.role,+ });+ },+ },+ {+ key: "operations",+ title: "",+ width: "4rem",+ render: (row: GroupRowData | UserRowData) => {+ if (row.type === "group") {+ return h(GroupOperationsCell, {+ group: row.group,+ "onUpdate-group": () => {+ emit("update-group", row.group);+ },+ "onDelete-group": () => {+ $dialog.warning({+ title: t("common.warning"),+ content: t("settings.members.groups.delete-warning", {+ name: row.group.title,+ }),+ style: "z-index: 100000",+ negativeText: t("common.cancel"),+ positiveText: t("common.continue-anyway"),+ onPositiveClick: () => {+ groupStore.deleteGroup(row.group.name).then(() => {+ pushNotification({+ module: "bytebase",+ style: "SUCCESS",+ title: t("common.deleted"),+ });+ });+ },+ });+ },+ });+ } else {+ return "";+ }+ },+ },+ ] as DataTableColumn<GroupRowData | UserRowData>[];+});++const userListByGroup = computed(() => {+ const rowDataList: GroupRowData[] = [];++ for (const group of groupStore.groupList) {+ const members: UserRowData[] = [];+ for (const member of group.members) {+ const user = props.userList.find(+ (user) => user.email === getUserEmailFromIdentifier(member.member)+ );+ if (!user) {+ continue;+ }+ members.push({+ type: "user",+ name: user.name,+ user,+ role: member.role,+ });+ }+ rowDataList.push({+ type: "group",+ group,+ name: group.name,+ children: members,+ });+ }++ return rowDataList;+});+</script>diff --git a/frontend/src/components/v2/Select/UserSelect.vue b/frontend/src/components/v2/Select/UserSelect.vueindex ef0010876e..85e7ef7307 100644--- a/frontend/src/components/v2/Select/UserSelect.vue+++ b/frontend/src/components/v2/Select/UserSelect.vue@@ -10,6 +10,7 @@:filter="filterByTitle":render-label="renderLabel":placeholder="$t('principal.select')"+ :size="size"class="bb-user-select"@update:show="(show: boolean) => {@@ -66,6 +67,7 @@ const props = withDefaults(filter?: (user: User, index: number) => boolean;mapOptions?: (users: User[]) => (UserSelectOption | SelectGroupOption)[];fallbackOption?: SelectProps["fallbackOption"];+ size?: "tiny" | "small" | "medium" | "large";}>(),{multiple: false,@@ -90,6 +92,7 @@ const props = withDefaults(filter: undefined,mapOptions: undefined,fallbackOption: false,+ size: "medium",});diff --git a/frontend/src/grpcweb/index.ts b/frontend/src/grpcweb/index.tsindex 0f2edd6907..45b5d1876c 100644--- a/frontend/src/grpcweb/index.ts+++ b/frontend/src/grpcweb/index.ts@@ -28,6 +28,7 @@ import { SettingServiceDefinition } from "@/types/proto/v1/setting_service";import { SheetServiceDefinition } from "@/types/proto/v1/sheet_service";import { SQLServiceDefinition } from "@/types/proto/v1/sql_service";import { SubscriptionServiceDefinition } from "@/types/proto/v1/subscription_service";+import { UserGroupServiceDefinition } from "@/types/proto/v1/user_group";import { VCSConnectorServiceDefinition } from "@/types/proto/v1/vcs_connector_service";import { VCSProviderServiceDefinition } from "@/types/proto/v1/vcs_provider_service";import { WorksheetServiceDefinition } from "@/types/proto/v1/worksheet_service";@@ -200,6 +201,11 @@ export const auditLogServiceClient = clientFactory.create(channel);+export const userGroupServiceClient = clientFactory.create(+ UserGroupServiceDefinition,+ channel+);+// e.g. How to use `authServiceClient`?//// await authServiceClient.login({diff --git a/frontend/src/locales/en-US.json b/frontend/src/locales/en-US.jsonindex 424320d7fa..cceef6ca11 100644--- a/frontend/src/locales/en-US.json+++ b/frontend/src/locales/en-US.json@@ -458,7 +458,7 @@"security-and-policy": "Security & Policy","integration": "Integration","general": "General",- "members": "Members",+ "members-and-groups": "Members & Groups","im-integration": "IM","sso": "SSO","gitops": "GitOps",@@ -497,13 +497,33 @@"table": {"account": "Account","role": "Role",+ "groups": "Groups","update-time": "Updated Time","granted-time": "Granted Time","roles": "Roles"},+ "groups": {+ "self": "Groups",+ "add-group": "Add Group",+ "update-group": "Update Group",+ "delete-warning": "The group \"{name}\" will be deleted. This action cannot be undone.",+ "form": {+ "email": "Email",+ "email-tips": "The email should be unique, and it cannot be changed after creation.",+ "title": "Title",+ "description": "Description",+ "members": "Members",+ "add-member": "Add member",+ "role": {+ "owner": "Owner",+ "member": "Members"+ }+ }+ },"action": {"deactivate": "Deactivate",- "deactivate-confirm-title": "Are you sure to deactivate",+ "deactivate-confirm-title": "Are you sure to deactivate?",+ "delete-confirm-title": "Are you sure to delete?","deactivate-confirm-description": "You can still reactivate later","reactivate": "Reactivate","reactivate-confirm-title": "Are you sure to reactivate"@@ -529,6 +549,7 @@},"view-by-principals": "View by principals","view-by-roles": "View by roles",+ "view-by-groups": "View by groups","add-member": "Add member","update-member": "Update member","workspace-role-at-least-one": "At least one workspace role is required"diff --git a/frontend/src/locales/es-ES.json b/frontend/src/locales/es-ES.jsonindex 79ac20db75..f68da8a7e5 100644--- a/frontend/src/locales/es-ES.json+++ b/frontend/src/locales/es-ES.json@@ -458,7 +458,7 @@"security-and-policy": "Seguridad y Política","integration": "Integración","general": "General",- "members": "Miembros",+ "members-and-groups": "Miembros y grupos","im-integration": "Integración de IM","sso": "SSO","gitops": "GitOps",@@ -497,13 +497,33 @@"table": {"account": "Cuenta","role": "Rol",+ "groups": "Grupos","update-time": "Hora de Actualización","granted-time": "Hora de Concesión","roles": "Roles"},+ "groups": {+ "self": "Grupos",+ "add-group": "Añadir grupo",+ "update-group": "Grupo de actualización",+ "delete-warning": "Se eliminará el grupo \"{name}\". Esta acción no se puede deshacer.",+ "form": {+ "email": "Correo electrónico",+ "email-tips": "El correo electrónico debe ser único y no se puede cambiar después de su creación.",+ "title": "Título",+ "description": "Descripción",+ "members": "Miembros",+ "add-member": "Añadir miembro",+ "role": {+ "owner": "Dueño",+ "member": "Miembros"+ }+ }+ },"action": {"deactivate": "Desactivar","deactivate-confirm-title": "¿Estás seguro de que deseas desactivar?",+ "delete-confirm-title": "¿Estás seguro de eliminar?","deactivate-confirm-description": "Aún puedes reactivar más tarde","reactivate": "Reactivar","reactivate-confirm-title": "¿Estás seguro de que deseas reactivar?"@@ -529,6 +549,7 @@},"view-by-principals": "Ver por responsables","view-by-roles": "Ver por roles",+ "view-by-groups": "Ver por grupos","add-member": "Agregar miembro","update-member": "Actualizar miembro","workspace-role-at-least-one": "El espacio de trabajo debe tener al menos un administrador"diff --git a/frontend/src/locales/ja-JP.json b/frontend/src/locales/ja-JP.jsonindex a034195752..b993ad845b 100644--- a/frontend/src/locales/ja-JP.json+++ b/frontend/src/locales/ja-JP.json@@ -458,7 +458,7 @@"security-and-policy": "セキュリティ戦略","integration": "統合された","general": "ユニバーサル",- "members": "メンバー",+ "members-and-groups": "メンバーとグループ","im-integration": "私は","sso": "SSO","gitops": "GitOps",@@ -497,13 +497,33 @@"table": {"account": "アカウント","role": "役割",+ "groups": "グループ","update-time": "更新時間","granted-time": "の承認","roles": "役割"},+ "groups": {+ "self": "グループ",+ "add-group": "グループを追加",+ "update-group": "更新グループ",+ "delete-warning": "グループ「{name}」は削除されます。この操作は元に戻せません。",+ "form": {+ "email": "Eメール",+ "email-tips": "電子メールは一意である必要があり、作成後に変更することはできません。",+ "title": "タイトル",+ "description": "説明",+ "members": "メンバー",+ "add-member": "メンバーを追加",+ "role": {+ "owner": "所有者",+ "member": "メンバー"+ }+ }+ },"action": {"deactivate": "無効にする","deactivate-confirm-title": "無効にしてもOK",+ "delete-confirm-title": "本当に削除しますか?","deactivate-confirm-description": "後で再度有効にすることができます","reactivate": "有効にする","reactivate-confirm-title": "[OK] を有効にします"@@ -529,6 +549,7 @@},"view-by-principals": "メンバー別に見る","view-by-roles": "役割ごとに表示",+ "view-by-groups": "グループ別に表示","add-member": "メンバーを追加","update-member": "メンバーを更新する","workspace-role-at-least-one": "少なくとも 1 つのワークスペースレベルの役割を選択してください"diff --git a/frontend/src/locales/zh-CN.json b/frontend/src/locales/zh-CN.jsonindex 3e01806de4..89868be104 100644--- a/frontend/src/locales/zh-CN.json+++ b/frontend/src/locales/zh-CN.json@@ -458,7 +458,7 @@"security-and-policy": "安全 & 策略","integration": "集成","general": "通用",- "members": "成员",+ "members-and-groups": "成员和群组","im-integration": "IM","sso": "SSO","gitops": "GitOps",@@ -497,13 +497,33 @@"table": {"account": "账户","role": "角色",+ "groups": "群组","update-time": "更新时间","granted-time": "批准时间","roles": "角色"},+ "groups": {+ "self": "群组",+ "add-group": "添加组",+ "update-group": "更新组",+ "delete-warning": "群组“{name}”将被删除。此操作无法撤消。",+ "form": {+ "email": "电子邮件",+ "email-tips": "电子邮件应该是唯一的,并且创建后不能更改。",+ "title": "标题",+ "description": "描述",+ "members": "成员",+ "add-member": "添加成员",+ "role": {+ "owner": "所有者",+ "member": "成员"+ }+ }+ },"action": {"deactivate": "禁用","deactivate-confirm-title": "确定禁用",+ "delete-confirm-title": "您确定要删除吗?","deactivate-confirm-description": "之后可以重新启用","reactivate": "启用","reactivate-confirm-title": "确定启用"@@ -529,6 +549,7 @@},"view-by-principals": "按成员查看","view-by-roles": "按角色查看",+ "view-by-groups": "按组查看","add-member": "添加成员","update-member": "更新成员","workspace-role-at-least-one": "至少选择一个工作空间级别的角色"diff --git a/frontend/src/router/dashboard/workspaceSetting.ts b/frontend/src/router/dashboard/workspaceSetting.tsindex 5911ff6d30..f6e16e9fc7 100644--- a/frontend/src/router/dashboard/workspaceSetting.ts+++ b/frontend/src/router/dashboard/workspaceSetting.ts@@ -55,7 +55,7 @@ const workspaceSettingRoutes: RouteRecordRaw[] = [path: "member",name: SETTING_ROUTE_WORKSPACE_MEMBER,meta: {- title: () => t("settings.sidebar.members"),+ title: () => t("settings.sidebar.members-and-groups"),requiredWorkspacePermissionList: () => ["bb.policies.get"],},component: () => import("@/views/SettingWorkspaceMember.vue"),diff --git a/frontend/src/store/modules/v1/common.ts b/frontend/src/store/modules/v1/common.tsindex b8fe06dece..b3321ee960 100644--- a/frontend/src/store/modules/v1/common.ts+++ b/frontend/src/store/modules/v1/common.ts@@ -22,6 +22,7 @@ export const branchNamePrefix = "branches/";export const ssoNamePrefix = "idps/";export const protectionRulesSuffix = "/protectionRules";export const issueCommentNamePrefix = "issueComments/";+export const userGroupNamePrefix = "groups/";export const getNameParentTokens = (name: string,@@ -190,3 +191,8 @@ export const getIssueCommentId = (name: string) => {}return tokens[2];};++export const getGroupEmail = (name: string) => {+ const tokens = getNameParentTokens(name, [userGroupNamePrefix]);+ return tokens[0];+};diff --git a/frontend/src/store/modules/v1/index.ts b/frontend/src/store/modules/v1/index.tsindex a8589d1638..1fc15f2806 100644--- a/frontend/src/store/modules/v1/index.ts+++ b/frontend/src/store/modules/v1/index.ts@@ -24,3 +24,4 @@ export * from "./anomaly";export * from "./changelist";export * from "./issueComment";export * from "./auditLog";+export * from "./userGroup";diff --git a/frontend/src/store/modules/v1/userGroup.ts b/frontend/src/store/modules/v1/userGroup.tsnew file mode 100644index 0000000000..6441e9aaf2--- /dev/null+++ b/frontend/src/store/modules/v1/userGroup.ts@@ -0,0 +1,80 @@+import { orderBy } from "lodash-es";+import { defineStore } from "pinia";+import { computed, reactive } from "vue";+import { userGroupServiceClient } from "@/grpcweb";+import type { UserGroup } from "@/types/proto/v1/user_group";+import { userGroupNamePrefix } from "./common";++export const useUserGroupStore = defineStore("user_group", () => {+ const groupMapByName = reactive(new Map<string, UserGroup>());+ const resetCache = () => {+ groupMapByName.clear();+ };++ // Getters+ const groupList = computed(() => {+ return orderBy(+ Array.from(groupMapByName.values()),+ (group) => group.createTime,+ "desc"+ );+ });++ // Actions+ const getGroupName = (email: string) => `${userGroupNamePrefix}${email}`;++ const getGroupByEmail = (email: string) => {+ return groupMapByName.get(getGroupName(email));+ };++ const fetchGroupList = async () => {+ const { groups } = await userGroupServiceClient.listUserGroups({});+ resetCache();+ for (const group of groups) {+ groupMapByName.set(group.name, group);+ }+ return groups;+ };++ const getOrFetchGroupByEmail = async (email: string) => {+ if (getGroupByEmail(email)) {+ return getGroupByEmail(email);+ }++ const group = await userGroupServiceClient.getUserGroup({+ name: getGroupName(email),+ });+ groupMapByName.set(group.name, group);+ return group;+ };++ const createGroup = async (group: UserGroup) => {+ const resp = await userGroupServiceClient.createUserGroup({ group });+ groupMapByName.set(resp.name, resp);+ return resp;+ };++ const deleteGroup = async (name: string) => {+ await userGroupServiceClient.deleteUserGroup({ name });+ groupMapByName.delete(name);+ };++ const updateGroup = async (group: UserGroup, updateMask: string[]) => {+ const updated = await userGroupServiceClient.updateUserGroup({+ group,+ updateMask,+ });+ groupMapByName.set(updated.name, updated);+ return updated;+ };++ return {+ groupList,+ fetchGroupList,+ getGroupByEmail,+ getOrFetchGroupByEmail,+ deleteGroup,+ updateGroup,+ createGroup,+ };+});diff --git a/frontend/src/types/proto/google/protobuf/descriptor.ts b/frontend/src/types/proto/google/protobuf/descriptor.tsindex 3a50d70585..3185d3cbac 100644--- a/frontend/src/types/proto/google/protobuf/descriptor.ts+++ b/frontend/src/types/proto/google/protobuf/descriptor.ts@@ -8,11 +8,6 @@ export const protobufPackage = "google.protobuf";export enum Edition {/** EDITION_UNKNOWN - A placeholder for an unknown edition value. */EDITION_UNKNOWN = "EDITION_UNKNOWN",- /**- * EDITION_LEGACY - A placeholder edition for specifying default behaviors *before* a feature- * was first introduced. This is effectively an "infinite past".- */- EDITION_LEGACY = "EDITION_LEGACY",/*** EDITION_PROTO2 - Legacy syntax "editions". These pre-date editions, but behave much like* distinct editions. These can't be used to specify the edition of proto@@ -27,7 +22,6 @@ export enum Edition {* comparison.*/EDITION_2023 = "EDITION_2023",- EDITION_2024 = "EDITION_2024",/*** EDITION_1_TEST_ONLY - Placeholder editions for testing feature resolution. These should not be* used or relyed on outside of tests.@@ -37,12 +31,6 @@ export enum Edition {EDITION_99997_TEST_ONLY = "EDITION_99997_TEST_ONLY",EDITION_99998_TEST_ONLY = "EDITION_99998_TEST_ONLY",EDITION_99999_TEST_ONLY = "EDITION_99999_TEST_ONLY",- /**- * EDITION_MAX - Placeholder for specifying unbounded edition support. This should only- * ever be used by plugins that can expect to never require any changes to- * support a new edition.- */- EDITION_MAX = "EDITION_MAX",UNRECOGNIZED = "UNRECOGNIZED",}@@ -51,9 +39,6 @@ export function editionFromJSON(object: any): Edition {case 0:case "EDITION_UNKNOWN":return Edition.EDITION_UNKNOWN;- case 900:- case "EDITION_LEGACY":- return Edition.EDITION_LEGACY;case 998:case "EDITION_PROTO2":return Edition.EDITION_PROTO2;@@ -63,9 +48,6 @@ export function editionFromJSON(object: any): Edition {case 1000:case "EDITION_2023":return Edition.EDITION_2023;- case 1001:- case "EDITION_2024":- return Edition.EDITION_2024;case 1:case "EDITION_1_TEST_ONLY":return Edition.EDITION_1_TEST_ONLY;@@ -81,9 +63,6 @@ export function editionFromJSON(object: any): Edition {case 99999:case "EDITION_99999_TEST_ONLY":return Edition.EDITION_99999_TEST_ONLY;- case 2147483647:- case "EDITION_MAX":- return Edition.EDITION_MAX;case -1:case "UNRECOGNIZED":default:@@ -95,16 +74,12 @@ export function editionToJSON(object: Edition): string {switch (object) {case Edition.EDITION_UNKNOWN:return "EDITION_UNKNOWN";- case Edition.EDITION_LEGACY:- return "EDITION_LEGACY";case Edition.EDITION_PROTO2:return "EDITION_PROTO2";case Edition.EDITION_PROTO3:return "EDITION_PROTO3";case Edition.EDITION_2023:return "EDITION_2023";- case Edition.EDITION_2024:- return "EDITION_2024";case Edition.EDITION_1_TEST_ONLY:return "EDITION_1_TEST_ONLY";case Edition.EDITION_2_TEST_ONLY:@@ -115,8 +90,6 @@ export function editionToJSON(object: Edition): string {return "EDITION_99998_TEST_ONLY";case Edition.EDITION_99999_TEST_ONLY:return "EDITION_99999_TEST_ONLY";- case Edition.EDITION_MAX:- return "EDITION_MAX";case Edition.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -127,16 +100,12 @@ export function editionToNumber(object: Edition): number {switch (object) {case Edition.EDITION_UNKNOWN:return 0;- case Edition.EDITION_LEGACY:- return 900;case Edition.EDITION_PROTO2:return 998;case Edition.EDITION_PROTO3:return 999;case Edition.EDITION_2023:return 1000;- case Edition.EDITION_2024:- return 1001;case Edition.EDITION_1_TEST_ONLY:return 1;case Edition.EDITION_2_TEST_ONLY:@@ -147,8 +116,6 @@ export function editionToNumber(object: Edition): number {return 99998;case Edition.EDITION_99999_TEST_ONLY:return 99999;- case Edition.EDITION_MAX:- return 2147483647;case Edition.UNRECOGNIZED:default:return -1;@@ -390,12 +357,12 @@ export interface FieldDescriptorProto {* If true, this is a proto3 "optional". When a proto3 field is optional, it* tracks presence regardless of field type.*- * When proto3_optional is true, this field must belong to a oneof to signal- * to old proto3 clients that presence is tracked for this field. This oneof- * is known as a "synthetic" oneof, and this field must be its sole member- * (each proto3 optional field gets its own synthetic oneof). Synthetic oneofs- * exist in the descriptor only, and do not generate any API. Synthetic oneofs- * must be ordered after all "real" oneofs.+ * When proto3_optional is true, this field must be belong to a oneof to+ * signal to old proto3 clients that presence is tracked for this field. This+ * oneof is known as a "synthetic" oneof, and this field must be its sole+ * member (each proto3 optional field gets its own synthetic oneof). Synthetic+ * oneofs exist in the descriptor only, and do not generate any API. Synthetic+ * oneofs must be ordered after all "real" oneofs.** For message fields, proto3_optional doesn't create any semantic change,* since non-repeated message fields always track presence. However it still@@ -772,16 +739,12 @@ export interface FileOptions {*/javaGenerateEqualsAndHash: boolean;/**- * A proto2 file can set this to true to opt in to UTF-8 checking for Java,- * which will throw an exception if invalid UTF-8 is parsed from the wire or- * assigned to a string field.- *- * TODO: clarify exactly what kinds of field types this option- * applies to, and update these docs accordingly.- *- * Proto3 files already perform these checks. Setting the option explicitly to- * false has no effect: it cannot be used to opt proto3 files out of UTF-8- * checks.+ * If set true, then the Java2 code generator will generate code that+ * throws an exception whenever an attempt is made to assign a non-UTF-8+ * byte sequence to a string field.+ * Message reflection will do the same.+ * However, an extension field still accepts non-UTF-8 byte sequences.+ * This option has no effect on when used with the lite runtime.*/javaStringCheckUtf8: boolean;optimizeFor: FileOptions_OptimizeMode;@@ -808,6 +771,7 @@ export interface FileOptions {ccGenericServices: boolean;javaGenericServices: boolean;pyGenericServices: boolean;+ phpGenericServices: boolean;/*** Is this file deprecated?* Depending on the target platform, this can emit Deprecated annotations@@ -961,6 +925,10 @@ export interface MessageOptions {*/deprecated: boolean;/**+ * NOTE: Do not set the option in .proto files. Always use the maps syntax+ * instead. The option should only be implicitly set by the proto compiler+ * parser.+ ** Whether the message is an automatically generated map entry type for the* maps field.*@@ -978,10 +946,6 @@ export interface MessageOptions {* use a native map in the target language to hold the keys and values.* The reflection APIs in such implementations still need to work as* if the field is a repeated message field.- *- * NOTE: Do not set the option in .proto files. Always use the maps syntax- * instead. The option should only be implicitly set by the proto compiler- * parser.*/mapEntry: boolean;/**@@ -1059,11 +1023,19 @@ export interface FieldOptions {* call from multiple threads concurrently, while non-const methods continue* to require exclusive access.*- * Note that lazy message fields are still eagerly verified to check- * ill-formed wireformat or missing required fields. Calling IsInitialized()- * on the outer message would fail if the inner message has missing required- * fields. Failed verification would result in parsing failure (except when- * uninitialized messages are acceptable).+ * Note that implementations may choose not to check required fields within+ * a lazy sub-message. That is, calling IsInitialized() on the outer message+ * may return true even if the inner message has missing required fields.+ * This is necessary because otherwise the inner message would have to be+ * parsed in order to perform the check, defeating the purpose of lazy+ * parsing. An implementation which chooses not to check required fields+ * must be consistent about it. That is, for any particular sub-message, the+ * implementation must either *always* check its required fields, or *never*+ * check its required fields, regardless of whether or not the message has+ * been parsed.+ *+ * As of May 2022, lazy verifies the contents of the byte stream during+ * parsing. An invalid byte stream will cause the overall parsing to fail.*/lazy: boolean;/**@@ -1090,9 +1062,8 @@ export interface FieldOptions {targets: FieldOptions_OptionTargetType[];editionDefaults: FieldOptions_EditionDefault[];/** Any features defined in the specific edition. */- features: FeatureSet | undefined;- featureSupport:- | FieldOptions_FeatureSupport+ features:+ | FeatureSet| undefined;/** The parser stores options it doesn't recognize here. See above. */uninterpretedOption: UninterpretedOption[];@@ -1395,32 +1366,6 @@ export interface FieldOptions_EditionDefault {value: string;}-/** Information about the support window of a feature. */-export interface FieldOptions_FeatureSupport {- /**- * The edition that this feature was first available in. In editions- * earlier than this one, the default assigned to EDITION_LEGACY will be- * used, and proto files will not be able to override it.- */- editionIntroduced: Edition;- /**- * The edition this feature becomes deprecated in. Using this after this- * edition may trigger warnings.- */- editionDeprecated: Edition;- /**- * The deprecation warning text if this feature is used after the edition it- * was marked deprecated in.- */- deprecationWarning: string;- /**- * The edition this feature is no longer available in. In editions after- * this one, the last default assigned will be used, and proto files will- * not be able to override it.- */- editionRemoved: Edition;-}-export interface OneofOptions {/** Any features defined in the specific edition. */features:@@ -1797,8 +1742,8 @@ export function featureSet_RepeatedFieldEncodingToNumber(object: FeatureSet_Repeexport enum FeatureSet_Utf8Validation {UTF8_VALIDATION_UNKNOWN = "UTF8_VALIDATION_UNKNOWN",- VERIFY = "VERIFY",NONE = "NONE",+ VERIFY = "VERIFY",UNRECOGNIZED = "UNRECOGNIZED",}@@ -1807,12 +1752,12 @@ export function featureSet_Utf8ValidationFromJSON(object: any): FeatureSet_Utf8Vcase 0:case "UTF8_VALIDATION_UNKNOWN":return FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN;+ case 1:+ case "NONE":+ return FeatureSet_Utf8Validation.NONE;case 2:case "VERIFY":return FeatureSet_Utf8Validation.VERIFY;- case 3:- case "NONE":- return FeatureSet_Utf8Validation.NONE;case -1:case "UNRECOGNIZED":default:@@ -1824,10 +1769,10 @@ export function featureSet_Utf8ValidationToJSON(object: FeatureSet_Utf8Validatioswitch (object) {case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:return "UTF8_VALIDATION_UNKNOWN";- case FeatureSet_Utf8Validation.VERIFY:- return "VERIFY";case FeatureSet_Utf8Validation.NONE:return "NONE";+ case FeatureSet_Utf8Validation.VERIFY:+ return "VERIFY";case FeatureSet_Utf8Validation.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -1838,10 +1783,10 @@ export function featureSet_Utf8ValidationToNumber(object: FeatureSet_Utf8Validatswitch (object) {case FeatureSet_Utf8Validation.UTF8_VALIDATION_UNKNOWN:return 0;+ case FeatureSet_Utf8Validation.NONE:+ return 1;case FeatureSet_Utf8Validation.VERIFY:return 2;- case FeatureSet_Utf8Validation.NONE:- return 3;case FeatureSet_Utf8Validation.UNRECOGNIZED:default:return -1;@@ -1982,12 +1927,7 @@ export interface FeatureSetDefaults {*/export interface FeatureSetDefaults_FeatureSetEditionDefault {edition: Edition;- /** Defaults of features that can be overridden in this edition. */- overridableFeatures:- | FeatureSet- | undefined;- /** Defaults of features that can't be overridden in this edition. */- fixedFeatures: FeatureSet | undefined;+ features: FeatureSet | undefined;}/**@@ -2049,7 +1989,7 @@ export interface SourceCodeInfo_Location {* location.** Each element is a field number or an index. They form a path from- * the root FileDescriptorProto to the place where the definition appears.+ * the root FileDescriptorProto to the place where the definition occurs.* For example, this path:* [ 4, 3, 2, 7, 1 ]* refers to:@@ -4047,6 +3987,7 @@ function createBaseFileOptions(): FileOptions {ccGenericServices: false,javaGenericServices: false,pyGenericServices: false,+ phpGenericServices: false,deprecated: false,ccEnableArenas: false,objcClassPrefix: "",@@ -4093,6 +4034,9 @@ export const FileOptions = {if (message.pyGenericServices === true) {writer.uint32(144).bool(message.pyGenericServices);}+ if (message.phpGenericServices === true) {+ writer.uint32(336).bool(message.phpGenericServices);+ }if (message.deprecated === true) {writer.uint32(184).bool(message.deprecated);}@@ -4206,6 +4150,13 @@ export const FileOptions = {message.pyGenericServices = reader.bool();continue;+ case 42:+ if (tag !== 336) {+ break;+ }++ message.phpGenericServices = reader.bool();+ continue;case 23:if (tag !== 184) {break;@@ -4308,6 +4259,7 @@ export const FileOptions = {ccGenericServices: isSet(object.ccGenericServices) ? globalThis.Boolean(object.ccGenericServices) : false,javaGenericServices: isSet(object.javaGenericServices) ? globalThis.Boolean(object.javaGenericServices) : false,pyGenericServices: isSet(object.pyGenericServices) ? globalThis.Boolean(object.pyGenericServices) : false,+ phpGenericServices: isSet(object.phpGenericServices) ? globalThis.Boolean(object.phpGenericServices) : false,deprecated: isSet(object.deprecated) ? globalThis.Boolean(object.deprecated) : false,ccEnableArenas: isSet(object.ccEnableArenas) ? globalThis.Boolean(object.ccEnableArenas) : false,objcClassPrefix: isSet(object.objcClassPrefix) ? globalThis.String(object.objcClassPrefix) : "",@@ -4356,6 +4308,9 @@ export const FileOptions = {if (message.pyGenericServices === true) {obj.pyGenericServices = message.pyGenericServices;}+ if (message.phpGenericServices === true) {+ obj.phpGenericServices = message.phpGenericServices;+ }if (message.deprecated === true) {obj.deprecated = message.deprecated;}@@ -4407,6 +4362,7 @@ export const FileOptions = {message.ccGenericServices = object.ccGenericServices ?? false;message.javaGenericServices = object.javaGenericServices ?? false;message.pyGenericServices = object.pyGenericServices ?? false;+ message.phpGenericServices = object.phpGenericServices ?? false;message.deprecated = object.deprecated ?? false;message.ccEnableArenas = object.ccEnableArenas ?? false;message.objcClassPrefix = object.objcClassPrefix ?? "";@@ -4605,7 +4561,6 @@ function createBaseFieldOptions(): FieldOptions {targets: [],editionDefaults: [],features: undefined,- featureSupport: undefined,uninterpretedOption: [],};}@@ -4650,9 +4605,6 @@ export const FieldOptions = {if (message.features !== undefined) {FeatureSet.encode(message.features, writer.uint32(170).fork()).ldelim();}- if (message.featureSupport !== undefined) {- FieldOptions_FeatureSupport.encode(message.featureSupport, writer.uint32(178).fork()).ldelim();- }for (const v of message.uninterpretedOption) {UninterpretedOption.encode(v!, writer.uint32(7994).fork()).ldelim();}@@ -4760,13 +4712,6 @@ export const FieldOptions = {message.features = FeatureSet.decode(reader, reader.uint32());continue;- case 22:- if (tag !== 178) {- break;- }-- message.featureSupport = FieldOptions_FeatureSupport.decode(reader, reader.uint32());- continue;case 999:if (tag !== 7994) {break;@@ -4803,9 +4748,6 @@ export const FieldOptions = {? object.editionDefaults.map((e: any) => FieldOptions_EditionDefault.fromJSON(e)): [],features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,- featureSupport: isSet(object.featureSupport)- ? FieldOptions_FeatureSupport.fromJSON(object.featureSupport)- : undefined,uninterpretedOption: globalThis.Array.isArray(object?.uninterpretedOption)? object.uninterpretedOption.map((e: any) => UninterpretedOption.fromJSON(e)): [],@@ -4850,9 +4792,6 @@ export const FieldOptions = {if (message.features !== undefined) {obj.features = FeatureSet.toJSON(message.features);}- if (message.featureSupport !== undefined) {- obj.featureSupport = FieldOptions_FeatureSupport.toJSON(message.featureSupport);- }if (message.uninterpretedOption?.length) {obj.uninterpretedOption = message.uninterpretedOption.map((e) => UninterpretedOption.toJSON(e));}@@ -4878,9 +4817,6 @@ export const FieldOptions = {message.features = (object.features !== undefined && object.features !== null)? FeatureSet.fromPartial(object.features): undefined;- message.featureSupport = (object.featureSupport !== undefined && object.featureSupport !== null)- ? FieldOptions_FeatureSupport.fromPartial(object.featureSupport)- : undefined;message.uninterpretedOption = object.uninterpretedOption?.map((e) => UninterpretedOption.fromPartial(e)) || [];return message;},@@ -4960,119 +4896,6 @@ export const FieldOptions_EditionDefault = {},};-function createBaseFieldOptions_FeatureSupport(): FieldOptions_FeatureSupport {- return {- editionIntroduced: Edition.EDITION_UNKNOWN,- editionDeprecated: Edition.EDITION_UNKNOWN,- deprecationWarning: "",- editionRemoved: Edition.EDITION_UNKNOWN,- };-}--export const FieldOptions_FeatureSupport = {- encode(message: FieldOptions_FeatureSupport, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {- if (message.editionIntroduced !== Edition.EDITION_UNKNOWN) {- writer.uint32(8).int32(editionToNumber(message.editionIntroduced));- }- if (message.editionDeprecated !== Edition.EDITION_UNKNOWN) {- writer.uint32(16).int32(editionToNumber(message.editionDeprecated));- }- if (message.deprecationWarning !== "") {- writer.uint32(26).string(message.deprecationWarning);- }- if (message.editionRemoved !== Edition.EDITION_UNKNOWN) {- writer.uint32(32).int32(editionToNumber(message.editionRemoved));- }- return writer;- },-- decode(input: _m0.Reader | Uint8Array, length?: number): FieldOptions_FeatureSupport {- const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);- let end = length === undefined ? reader.len : reader.pos + length;- const message = createBaseFieldOptions_FeatureSupport();- while (reader.pos < end) {- const tag = reader.uint32();- switch (tag >>> 3) {- case 1:- if (tag !== 8) {- break;- }-- message.editionIntroduced = editionFromJSON(reader.int32());- continue;- case 2:- if (tag !== 16) {- break;- }-- message.editionDeprecated = editionFromJSON(reader.int32());- continue;- case 3:- if (tag !== 26) {- break;- }-- message.deprecationWarning = reader.string();- continue;- case 4:- if (tag !== 32) {- break;- }-- message.editionRemoved = editionFromJSON(reader.int32());- continue;- }- if ((tag & 7) === 4 || tag === 0) {- break;- }- reader.skipType(tag & 7);- }- return message;- },-- fromJSON(object: any): FieldOptions_FeatureSupport {- return {- editionIntroduced: isSet(object.editionIntroduced)- ? editionFromJSON(object.editionIntroduced)- : Edition.EDITION_UNKNOWN,- editionDeprecated: isSet(object.editionDeprecated)- ? editionFromJSON(object.editionDeprecated)- : Edition.EDITION_UNKNOWN,- deprecationWarning: isSet(object.deprecationWarning) ? globalThis.String(object.deprecationWarning) : "",- editionRemoved: isSet(object.editionRemoved) ? editionFromJSON(object.editionRemoved) : Edition.EDITION_UNKNOWN,- };- },-- toJSON(message: FieldOptions_FeatureSupport): unknown {- const obj: any = {};- if (message.editionIntroduced !== Edition.EDITION_UNKNOWN) {- obj.editionIntroduced = editionToJSON(message.editionIntroduced);- }- if (message.editionDeprecated !== Edition.EDITION_UNKNOWN) {- obj.editionDeprecated = editionToJSON(message.editionDeprecated);- }- if (message.deprecationWarning !== "") {- obj.deprecationWarning = message.deprecationWarning;- }- if (message.editionRemoved !== Edition.EDITION_UNKNOWN) {- obj.editionRemoved = editionToJSON(message.editionRemoved);- }- return obj;- },-- create(base?: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {- return FieldOptions_FeatureSupport.fromPartial(base ?? {});- },- fromPartial(object: DeepPartial<FieldOptions_FeatureSupport>): FieldOptions_FeatureSupport {- const message = createBaseFieldOptions_FeatureSupport();- message.editionIntroduced = object.editionIntroduced ?? Edition.EDITION_UNKNOWN;- message.editionDeprecated = object.editionDeprecated ?? Edition.EDITION_UNKNOWN;- message.deprecationWarning = object.deprecationWarning ?? "";- message.editionRemoved = object.editionRemoved ?? Edition.EDITION_UNKNOWN;- return message;- },-};-function createBaseOneofOptions(): OneofOptions {return { features: undefined, uninterpretedOption: [] };}@@ -6081,7 +5904,7 @@ export const FeatureSetDefaults = {};function createBaseFeatureSetDefaults_FeatureSetEditionDefault(): FeatureSetDefaults_FeatureSetEditionDefault {- return { edition: Edition.EDITION_UNKNOWN, overridableFeatures: undefined, fixedFeatures: undefined };+ return { edition: Edition.EDITION_UNKNOWN, features: undefined };}export const FeatureSetDefaults_FeatureSetEditionDefault = {@@ -6089,11 +5912,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {if (message.edition !== Edition.EDITION_UNKNOWN) {writer.uint32(24).int32(editionToNumber(message.edition));}- if (message.overridableFeatures !== undefined) {- FeatureSet.encode(message.overridableFeatures, writer.uint32(34).fork()).ldelim();- }- if (message.fixedFeatures !== undefined) {- FeatureSet.encode(message.fixedFeatures, writer.uint32(42).fork()).ldelim();+ if (message.features !== undefined) {+ FeatureSet.encode(message.features, writer.uint32(18).fork()).ldelim();}return writer;},@@ -6112,19 +5932,12 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {message.edition = editionFromJSON(reader.int32());continue;- case 4:- if (tag !== 34) {- break;- }-- message.overridableFeatures = FeatureSet.decode(reader, reader.uint32());- continue;- case 5:- if (tag !== 42) {+ case 2:+ if (tag !== 18) {break;}- message.fixedFeatures = FeatureSet.decode(reader, reader.uint32());+ message.features = FeatureSet.decode(reader, reader.uint32());continue;}if ((tag & 7) === 4 || tag === 0) {@@ -6138,10 +5951,7 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {fromJSON(object: any): FeatureSetDefaults_FeatureSetEditionDefault {return {edition: isSet(object.edition) ? editionFromJSON(object.edition) : Edition.EDITION_UNKNOWN,- overridableFeatures: isSet(object.overridableFeatures)- ? FeatureSet.fromJSON(object.overridableFeatures)- : undefined,- fixedFeatures: isSet(object.fixedFeatures) ? FeatureSet.fromJSON(object.fixedFeatures) : undefined,+ features: isSet(object.features) ? FeatureSet.fromJSON(object.features) : undefined,};},@@ -6150,11 +5960,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {if (message.edition !== Edition.EDITION_UNKNOWN) {obj.edition = editionToJSON(message.edition);}- if (message.overridableFeatures !== undefined) {- obj.overridableFeatures = FeatureSet.toJSON(message.overridableFeatures);- }- if (message.fixedFeatures !== undefined) {- obj.fixedFeatures = FeatureSet.toJSON(message.fixedFeatures);+ if (message.features !== undefined) {+ obj.features = FeatureSet.toJSON(message.features);}return obj;},@@ -6167,11 +5974,8 @@ export const FeatureSetDefaults_FeatureSetEditionDefault = {): FeatureSetDefaults_FeatureSetEditionDefault {const message = createBaseFeatureSetDefaults_FeatureSetEditionDefault();message.edition = object.edition ?? Edition.EDITION_UNKNOWN;- message.overridableFeatures = (object.overridableFeatures !== undefined && object.overridableFeatures !== null)- ? FeatureSet.fromPartial(object.overridableFeatures)- : undefined;- message.fixedFeatures = (object.fixedFeatures !== undefined && object.fixedFeatures !== null)- ? FeatureSet.fromPartial(object.fixedFeatures)+ message.features = (object.features !== undefined && object.features !== null)+ ? FeatureSet.fromPartial(object.features): undefined;return message;},diff --git a/frontend/src/types/proto/v1/user_group.ts b/frontend/src/types/proto/v1/user_group.tsindex d2fc000614..b3d7172e96 100644--- a/frontend/src/types/proto/v1/user_group.ts+++ b/frontend/src/types/proto/v1/user_group.ts@@ -3,6 +3,7 @@ import Long from "long";import _m0 from "protobufjs/minimal";import { Empty } from "../google/protobuf/empty";import { FieldMask } from "../google/protobuf/field_mask";+import { Timestamp } from "../google/protobuf/timestamp";export const protobufPackage = "bytebase.v1";@@ -146,6 +147,8 @@ export interface UserGroup {*/creator: string;members: UserGroupMember[];+ /** The timestamp when the group was created. */+ createTime: Date | undefined;}function createBaseGetUserGroupRequest(): GetUserGroupRequest {@@ -620,7 +623,7 @@ export const UserGroupMember = {};function createBaseUserGroup(): UserGroup {- return { name: "", title: "", description: "", creator: "", members: [] };+ return { name: "", title: "", description: "", creator: "", members: [], createTime: undefined };}export const UserGroup = {@@ -640,6 +643,9 @@ export const UserGroup = {for (const v of message.members) {UserGroupMember.encode(v!, writer.uint32(42).fork()).ldelim();}+ if (message.createTime !== undefined) {+ Timestamp.encode(toTimestamp(message.createTime), writer.uint32(50).fork()).ldelim();+ }return writer;},@@ -685,6 +691,13 @@ export const UserGroup = {message.members.push(UserGroupMember.decode(reader, reader.uint32()));continue;+ case 6:+ if (tag !== 50) {+ break;+ }++ message.createTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));+ continue;}if ((tag & 7) === 4 || tag === 0) {break;@@ -703,6 +716,7 @@ export const UserGroup = {members: globalThis.Array.isArray(object?.members)? object.members.map((e: any) => UserGroupMember.fromJSON(e)): [],+ createTime: isSet(object.createTime) ? fromJsonTimestamp(object.createTime) : undefined,};},@@ -723,6 +737,9 @@ export const UserGroup = {if (message.members?.length) {obj.members = message.members.map((e) => UserGroupMember.toJSON(e));}+ if (message.createTime !== undefined) {+ obj.createTime = message.createTime.toISOString();+ }return obj;},@@ -736,6 +753,7 @@ export const UserGroup = {message.description = object.description ?? "";message.creator = object.creator ?? "";message.members = object.members?.map((e) => UserGroupMember.fromPartial(e)) || [];+ message.createTime = object.createTime ?? undefined;return message;},};@@ -911,6 +929,32 @@ export type DeepPartial<T> = T extends Builtin ? T: T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }: Partial<T>;+function toTimestamp(date: Date): Timestamp {+ const seconds = numberToLong(date.getTime() / 1_000);+ const nanos = (date.getTime() % 1_000) * 1_000_000;+ return { seconds, nanos };+}++function fromTimestamp(t: Timestamp): Date {+ let millis = (t.seconds.toNumber() || 0) * 1_000;+ millis += (t.nanos || 0) / 1_000_000;+ return new globalThis.Date(millis);+}++function fromJsonTimestamp(o: any): Date {+ if (o instanceof globalThis.Date) {+ return o;+ } else if (typeof o === "string") {+ return new globalThis.Date(o);+ } else {+ return fromTimestamp(Timestamp.fromJSON(o));+ }+}++function numberToLong(number: number) {+ return Long.fromNumber(number);+}+if (_m0.util.Long !== Long) {_m0.util.Long = Long as any;_m0.configure();diff --git a/frontend/src/views/SettingSidebar.vue b/frontend/src/views/SettingSidebar.vueindex a4e80608bd..d718e11d30 100644--- a/frontend/src/views/SettingSidebar.vue+++ b/frontend/src/views/SettingSidebar.vue@@ -14,6 +14,7 @@ import { useI18n } from "vue-i18n";import type { RouteRecordRaw } from "vue-router";import { useRoute, useRouter } from "vue-router";import type { SidebarItem } from "@/components/CommonSidebar.vue";+import { WORKSPACE_ROUTE_USER_PROFILE } from "@/router/dashboard/workspaceRoutes";import workspaceSettingRoutes, {SETTING_ROUTE_PROFILE,SETTING_ROUTE_PROFILE_TWO_FACTOR,@@ -49,6 +50,11 @@ const getItemClass = (item: SidebarItem) => {list.push("router-link-active", "bg-link-hover");}break;+ case WORKSPACE_ROUTE_USER_PROFILE:+ if (item.name === SETTING_ROUTE_WORKSPACE_MEMBER) {+ list.push("router-link-active", "bg-link-hover");+ }+ break;}return list;};@@ -95,7 +101,7 @@ const settingSidebarItemList = computed((): SidebarItem[] => {type: "route",},{- title: t("settings.sidebar.members"),+ title: t("settings.sidebar.members-and-groups"),name: SETTING_ROUTE_WORKSPACE_MEMBER,type: "route",},diff --git a/frontend/src/views/SettingWorkspaceMember.vue b/frontend/src/views/SettingWorkspaceMember.vueindex c17932d8aa..ae31825e42 100644--- a/frontend/src/views/SettingWorkspaceMember.vue+++ b/frontend/src/views/SettingWorkspaceMember.vue@@ -29,7 +29,14 @@</div></div>- <div>+ <div class="flex items-center space-x-3">+ <!-- TODO(ed): permission check -->+ <NButton class="capitalize" @click="handleCreateGroup">+ <template #icon>+ <PlusIcon class="h-5 w-5" />+ </template>+ {{ $t(`settings.members.groups.add-group`) }}+ </NButton><NButtonv-if="allowCreateUser"type="primary"@@ -49,6 +56,7 @@<UserDataTable:user-list="activeUserList"@update-user="handleUpdateUser"+ @select-group="handleUpdateGroup"/></NTabPane><NTabPane name="roles" :tab="$t('settings.members.view-by-roles')">@@ -57,6 +65,12 @@@update-user="handleUpdateUser"/></NTabPane>+ <NTabPane name="groups" :tab="$t('settings.members.view-by-groups')">+ <UserDataTableByGroup+ :user-list="activeUserList"+ @update-group="handleUpdateGroup"+ />+ </NTabPane><template #suffix><SearchBox v-model:value="state.activeUserFilterText" />@@ -96,6 +110,11 @@:user="state.editingUser"@close="state.showCreateUserDrawer = false"/>+ <CreateGroupDrawer+ v-if="state.showCreateGroupDrawer"+ :group="state.editingGroup"+ @close="state.showCreateGroupDrawer = false"+ /></template><script lang="ts" setup>@@ -105,6 +124,7 @@ import { NButton, NCheckbox, NTabs, NTabPane } from "naive-ui";import { computed, onMounted, reactive } from "vue";import { useI18n } from "vue-i18n";import UserDataTable from "@/components/User/Settings/UserDataTable/index.vue";+import UserDataTableByGroup from "@/components/User/Settings/UserDataTableByGroup/index.vue";import UserDataTableByRole from "@/components/User/Settings/UserDataTableByRole/index.vue";import { SearchBox } from "@/components/v2";import { SETTING_ROUTE_WORKSPACE_SUBSCRIPTION } from "@/router/dashboard/workspaceSetting";@@ -117,6 +137,7 @@ import {import type { User } from "@/types/proto/v1/auth_service";import { UserType } from "@/types/proto/v1/auth_service";import { State } from "@/types/proto/v1/common";+import type { UserGroup } from "@/types/proto/v1/user_group";import {ALL_USERS_USER_EMAIL,PresetRoleType,@@ -129,7 +150,9 @@ type LocalState = {inactiveUserFilterText: string;showInactiveUserList: boolean;showCreateUserDrawer: boolean;+ showCreateGroupDrawer: boolean;editingUser?: User;+ editingGroup?: UserGroup;};const state = reactive<LocalState>({@@ -137,6 +160,7 @@ const state = reactive<LocalState>({inactiveUserFilterText: "",showInactiveUserList: false,showCreateUserDrawer: false,+ showCreateGroupDrawer: false,});const { t } = useI18n();@@ -229,6 +253,16 @@ const userCountAttention = computed((): string => {return `${status} ${upgrade}`;});+const handleCreateGroup = () => {+ state.editingGroup = undefined;+ state.showCreateGroupDrawer = true;+};++const handleUpdateGroup = (group: UserGroup) => {+ state.editingGroup = group;+ state.showCreateGroupDrawer = true;+};+const handleCreateUser = () => {state.editingUser = undefined;state.showCreateUserDrawer = true;diff --git a/proto/gen/grpc-doc/openapi.yaml b/proto/gen/grpc-doc/openapi.yamlindex 7670ca7ebb..1587257ee5 100644--- a/proto/gen/grpc-doc/openapi.yaml+++ b/proto/gen/grpc-doc/openapi.yaml@@ -13977,6 +13977,11 @@ components:type: arrayitems:$ref: '#/components/schemas/UserGroupMember'+ createTime:+ readOnly: true+ type: string+ description: The timestamp when the group was created.+ format: date-timeUserGroupMember:type: objectproperties:diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.mdindex 60f0d748d8..39edfe848d 100644--- a/proto/gen/grpc-doc/v1/README.md+++ b/proto/gen/grpc-doc/v1/README.md@@ -10261,6 +10261,7 @@ The group's `name` field is used to identify the group to update. Format: gr| description | [string](#string) | | || creator | [string](#string) | | The name for the creator. Format: users/[email protected] || members | [UserGroupMember](#bytebase-v1-UserGroupMember) | repeated | |+| create_time | [google.protobuf.Timestamp](#google-protobuf-Timestamp) | | The timestamp when the group was created. |diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.htmlindex d12fcbbec4..98eb003411 100644--- a/proto/gen/grpc-doc/v1/index.html+++ b/proto/gen/grpc-doc/v1/index.html@@ -28284,6 +28284,13 @@ Format: users/[email protected] </p></td><td><p> </p></td></tr>+ <tr>+ <td>create_time</td>+ <td><a href="#google.protobuf.Timestamp">google.protobuf.Timestamp</a></td>+ <td></td>+ <td><p>The timestamp when the group was created. </p></td>+ </tr>+</tbody></table>diff --git a/proto/generated-go/v1/user_group.pb.go b/proto/generated-go/v1/user_group.pb.goindex 6d55ad21b7..c098501b6b 100644--- a/proto/generated-go/v1/user_group.pb.go+++ b/proto/generated-go/v1/user_group.pb.go@@ -12,6 +12,7 @@ import (protoimpl "google.golang.org/protobuf/runtime/protoimpl"emptypb "google.golang.org/protobuf/types/known/emptypb"fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"+ timestamppb "google.golang.org/protobuf/types/known/timestamppb"reflect "reflect"sync "sync")@@ -472,6 +473,8 @@ type UserGroup struct {// Format: users/[email protected]Creator string `protobuf:"bytes,4,opt,name=creator,proto3" json:"creator,omitempty"`Members []*UserGroupMember `protobuf:"bytes,5,rep,name=members,proto3" json:"members,omitempty"`+ // The timestamp when the group was created.+ CreateTime *timestamppb.Timestamp `protobuf:"bytes,6,opt,name=create_time,json=createTime,proto3" json:"create_time,omitempty"`}func (x *UserGroup) Reset() {@@ -541,6 +544,13 @@ func (x *UserGroup) GetMembers() []*UserGroupMember {return nil}+func (x *UserGroup) GetCreateTime() *timestamppb.Timestamp {+ if x != nil {+ return x.CreateTime+ }+ return nil+}+var File_v1_user_group_proto protoreflect.FileDescriptorvar file_v1_user_group_proto_rawDesc = []byte{@@ -555,101 +565,107 @@ var file_v1_user_group_proto_rawDesc = []byte{0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d, 0x70, 0x74,0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x20, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2f,0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x6d,- 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x13, 0x47, 0x65, 0x74,- 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,- 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04,- 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x15, 0x4c, 0x69,- 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75,- 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a, 0x65,- 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a, 0x65,- 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e, 0x22,- 0x70, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,- 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x67, 0x72, 0x6f,- 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,- 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65, 0x78,- 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20, 0x01,- 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65,- 0x6e, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47,+ 0x61, 0x73, 0x6b, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1f, 0x67, 0x6f, 0x6f, 0x67, 0x6c,+ 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x74, 0x69, 0x6d, 0x65, 0x73,+ 0x74, 0x61, 0x6d, 0x70, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2f, 0x0a, 0x13, 0x47, 0x65,+ 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,+ 0x74, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x42,+ 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22, 0x53, 0x0a, 0x15, 0x4c,+ 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71,+ 0x75, 0x65, 0x73, 0x74, 0x12, 0x1b, 0x0a, 0x09, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x73, 0x69, 0x7a,+ 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x08, 0x70, 0x61, 0x67, 0x65, 0x53, 0x69, 0x7a,+ 0x65, 0x12, 0x1d, 0x0a, 0x0a, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18,+ 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x09, 0x70, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b, 0x65, 0x6e,+ 0x22, 0x70, 0x0a, 0x16, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,+ 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x2e, 0x0a, 0x06, 0x67, 0x72,+ 0x6f, 0x75, 0x70, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f,+ 0x75, 0x70, 0x52, 0x06, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x26, 0x0a, 0x0f, 0x6e, 0x65,+ 0x78, 0x74, 0x5f, 0x70, 0x61, 0x67, 0x65, 0x5f, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x09, 0x52, 0x0d, 0x6e, 0x65, 0x78, 0x74, 0x50, 0x61, 0x67, 0x65, 0x54, 0x6f, 0x6b,+ 0x65, 0x6e, 0x22, 0x4c, 0x0a, 0x16, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,+ 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05,+ 0x67, 0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70,+ 0x22, 0x89, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47,0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x67,0x72, 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74,0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f,- 0x75, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22,- 0x89, 0x01, 0x0a, 0x16, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,- 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x32, 0x0a, 0x05, 0x67, 0x72,- 0x6f, 0x75, 0x70, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,- 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 0x22, 0x32, 0x0a, 0x16, 0x44,- 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65,- 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,- 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x22,- 0x95, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65, 0x6d,- 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04, 0x72,- 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x75, 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 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, 0x22, 0x32, 0x0a, 0x16,+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x6e, 0x61, 0x6d, 0x65,+ 0x22, 0x95, 0x01, 0x0a, 0x0f, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x4d, 0x65,+ 0x6d, 0x62, 0x65, 0x72, 0x12, 0x16, 0x0a, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x12, 0x35, 0x0a, 0x04,+ 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f,+ 0x75, 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72,+ 0x6f, 0x6c, 0x65, 0x22, 0x33, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52,+ 0x4f, 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,+ 0x00, 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06,+ 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0xf8, 0x01, 0x0a, 0x09, 0x55, 0x73, 0x65,+ 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 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, 0x1e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61,+ 0x74, 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52,+ 0x07, 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62,+ 0x65, 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65,0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,- 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x2e, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x04, 0x72, 0x6f,- 0x6c, 0x65, 0x22, 0x33, 0x0a, 0x04, 0x52, 0x6f, 0x6c, 0x65, 0x12, 0x14, 0x0a, 0x10, 0x52, 0x4f,- 0x4c, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,- 0x12, 0x09, 0x0a, 0x05, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x4d,- 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x02, 0x22, 0xb5, 0x01, 0x0a, 0x09, 0x55, 0x73, 0x65, 0x72,- 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x18, 0x0a, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x18, 0x01, 0x20,- 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 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, 0x1e, 0x0a, 0x07, 0x63, 0x72, 0x65, 0x61, 0x74,- 0x6f, 0x72, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x07,- 0x63, 0x72, 0x65, 0x61, 0x74, 0x6f, 0x72, 0x12, 0x36, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65,- 0x72, 0x73, 0x18, 0x05, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,- 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x32,- 0xe8, 0x04, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x53, 0x65, 0x72,- 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47,- 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x22,- 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x12, 0x13, 0x2f,- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f,- 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,- 0x6f, 0x75, 0x70, 0x73, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70,- 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x70, 0x4d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73,+ 0x12, 0x41, 0x0a, 0x0b, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x74, 0x69, 0x6d, 0x65, 0x18,+ 0x06, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x1a, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70,+ 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x74, 0x61, 0x6d,+ 0x70, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x03, 0x52, 0x0a, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x54,+ 0x69, 0x6d, 0x65, 0x32, 0xe8, 0x04, 0x0a, 0x10, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75,+ 0x70, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x6c, 0x0a, 0x0c, 0x47, 0x65, 0x74, 0x55,+ 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72,+ 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74,+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f,+ 0x75, 0x70, 0x22, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02,+ 0x15, 0x12, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73,+ 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x47,- 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x15, 0xda,- 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72,- 0x6f, 0x75, 0x70, 0x73, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73,- 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,- 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47,- 0x72, 0x6f, 0x75, 0x70, 0x22, 0x21, 0xda, 0x41, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x0a, 0x2f, 0x76, 0x31,- 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0f, 0x55, 0x70, 0x64, 0x61,+ 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x23, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55,+ 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,+ 0x65, 0x22, 0x15, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0c, 0x12, 0x0a, 0x2f, 0x76,+ 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x71, 0x0a, 0x0f, 0x43, 0x72, 0x65, 0x61,0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79,- 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74,0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,- 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3c, 0xda, 0x41, 0x11, 0x67, 0x72, 0x6f,- 0x75, 0x70, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32, 0x19, 0x2f, 0x76, 0x31,- 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f,- 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0f, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,- 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73,- 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 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, 0x22, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82,- 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65,- 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 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,+ 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x21, 0xda, 0x41, 0x05, 0x67, 0x72, 0x6f,+ 0x75, 0x70, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x22,+ 0x0a, 0x2f, 0x76, 0x31, 0x2f, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x12, 0x8c, 0x01, 0x0a, 0x0f,+ 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12,+ 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70,+ 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x52, 0x65, 0x71,+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x22, 0x3c, 0xda, 0x41,+ 0x11, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,+ 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x22, 0x3a, 0x05, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x32,+ 0x19, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x2e, 0x6e, 0x61, 0x6d, 0x65,+ 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x72, 0x0a, 0x0f, 0x44, 0x65,+ 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 0x12, 0x23, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65,+ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x47, 0x72, 0x6f, 0x75, 0x70, 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, 0x22, 0xda, 0x41, 0x04, 0x6e,+ 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x15, 0x2a, 0x13, 0x2f, 0x76, 0x31, 0x2f, 0x7b,+ 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x67, 0x72, 0x6f, 0x75, 0x70, 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 (@@ -677,7 +693,8 @@ var file_v1_user_group_proto_goTypes = []interface{}{(*UserGroupMember)(nil), // 7: bytebase.v1.UserGroupMember(*UserGroup)(nil), // 8: bytebase.v1.UserGroup(*fieldmaskpb.FieldMask)(nil), // 9: google.protobuf.FieldMask- (*emptypb.Empty)(nil), // 10: google.protobuf.Empty+ (*timestamppb.Timestamp)(nil), // 10: google.protobuf.Timestamp+ (*emptypb.Empty)(nil), // 11: google.protobuf.Empty}var file_v1_user_group_proto_depIdxs = []int32{8, // 0: bytebase.v1.ListUserGroupsResponse.groups:type_name -> bytebase.v1.UserGroup@@ -686,21 +703,22 @@ var file_v1_user_group_proto_depIdxs = []int32{9, // 3: bytebase.v1.UpdateUserGroupRequest.update_mask:type_name -> google.protobuf.FieldMask0, // 4: bytebase.v1.UserGroupMember.role:type_name -> bytebase.v1.UserGroupMember.Role7, // 5: bytebase.v1.UserGroup.members:type_name -> bytebase.v1.UserGroupMember- 1, // 6: bytebase.v1.UserGroupService.GetUserGroup:input_type -> bytebase.v1.GetUserGroupRequest- 2, // 7: bytebase.v1.UserGroupService.ListUserGroups:input_type -> bytebase.v1.ListUserGroupsRequest- 4, // 8: bytebase.v1.UserGroupService.CreateUserGroup:input_type -> bytebase.v1.CreateUserGroupRequest- 5, // 9: bytebase.v1.UserGroupService.UpdateUserGroup:input_type -> bytebase.v1.UpdateUserGroupRequest- 6, // 10: bytebase.v1.UserGroupService.DeleteUserGroup:input_type -> bytebase.v1.DeleteUserGroupRequest- 8, // 11: bytebase.v1.UserGroupService.GetUserGroup:output_type -> bytebase.v1.UserGroup- 3, // 12: bytebase.v1.UserGroupService.ListUserGroups:output_type -> bytebase.v1.ListUserGroupsResponse- 8, // 13: bytebase.v1.UserGroupService.CreateUserGroup:output_type -> bytebase.v1.UserGroup- 8, // 14: bytebase.v1.UserGroupService.UpdateUserGroup:output_type -> bytebase.v1.UserGroup- 10, // 15: bytebase.v1.UserGroupService.DeleteUserGroup:output_type -> google.protobuf.Empty- 11, // [11:16] is the sub-list for method output_type- 6, // [6:11] is the sub-list for method input_type- 6, // [6:6] is the sub-list for extension type_name- 6, // [6:6] is the sub-list for extension extendee- 0, // [0:6] is the sub-list for field type_name+ 10, // 6: bytebase.v1.UserGroup.create_time:type_name -> google.protobuf.Timestamp+ 1, // 7: bytebase.v1.UserGroupService.GetUserGroup:input_type -> bytebase.v1.GetUserGroupRequest+ 2, // 8: bytebase.v1.UserGroupService.ListUserGroups:input_type -> bytebase.v1.ListUserGroupsRequest+ 4, // 9: bytebase.v1.UserGroupService.CreateUserGroup:input_type -> bytebase.v1.CreateUserGroupRequest+ 5, // 10: bytebase.v1.UserGroupService.UpdateUserGroup:input_type -> bytebase.v1.UpdateUserGroupRequest+ 6, // 11: bytebase.v1.UserGroupService.DeleteUserGroup:input_type -> bytebase.v1.DeleteUserGroupRequest+ 8, // 12: bytebase.v1.UserGroupService.GetUserGroup:output_type -> bytebase.v1.UserGroup+ 3, // 13: bytebase.v1.UserGroupService.ListUserGroups:output_type -> bytebase.v1.ListUserGroupsResponse+ 8, // 14: bytebase.v1.UserGroupService.CreateUserGroup:output_type -> bytebase.v1.UserGroup+ 8, // 15: bytebase.v1.UserGroupService.UpdateUserGroup:output_type -> bytebase.v1.UserGroup+ 11, // 16: bytebase.v1.UserGroupService.DeleteUserGroup:output_type -> google.protobuf.Empty+ 12, // [12:17] is the sub-list for method output_type+ 7, // [7:12] is the sub-list for method input_type+ 7, // [7:7] is the sub-list for extension type_name+ 7, // [7:7] is the sub-list for extension extendee+ 0, // [0:7] is the sub-list for field type_name}func init() { file_v1_user_group_proto_init() }diff --git a/proto/v1/user_group.proto b/proto/v1/user_group.protoindex 7e1216d692..8d22698e8b 100644--- a/proto/v1/user_group.proto+++ b/proto/v1/user_group.proto@@ -7,6 +7,7 @@ import "google/api/client.proto";import "google/api/field_behavior.proto";import "google/protobuf/empty.proto";import "google/protobuf/field_mask.proto";+import "google/protobuf/timestamp.proto";option go_package = "generated-go/v1";@@ -124,4 +125,7 @@ message UserGroup {string creator = 4 [(google.api.field_behavior) = OUTPUT_ONLY];repeated UserGroupMember members = 5;++ // The timestamp when the group was created.+ google.protobuf.Timestamp create_time = 6 [(google.api.field_behavior) = OUTPUT_ONLY];}