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: introduce other user methods (#4119)
Danny Xu19a9f89eeb4e
diff --git a/frontend/src/types/proto/v1/auth_service.ts b/frontend/src/types/proto/v1/auth_service.tsindex 7845e197dd..887bb9bcd6 100644--- a/frontend/src/types/proto/v1/auth_service.ts+++ b/frontend/src/types/proto/v1/auth_service.ts@@ -1,15 +1,61 @@/* eslint-disable */import _m0 from "protobufjs/minimal";import { Empty } from "../google/protobuf/empty";+import { FieldMask } from "../google/protobuf/field_mask";import { State, stateFromJSON, stateToJSON } from "./common";export const protobufPackage = "bytebase.v1";+export enum UserType {+ USER_TYPE_UNSPECIFIED = 0,+ USER = 1,+ SYSTEM_BOT = 2,+ SERVICE_ACCOUNT = 3,+ UNRECOGNIZED = -1,+}++export function userTypeFromJSON(object: any): UserType {+ switch (object) {+ case 0:+ case "USER_TYPE_UNSPECIFIED":+ return UserType.USER_TYPE_UNSPECIFIED;+ case 1:+ case "USER":+ return UserType.USER;+ case 2:+ case "SYSTEM_BOT":+ return UserType.SYSTEM_BOT;+ case 3:+ case "SERVICE_ACCOUNT":+ return UserType.SERVICE_ACCOUNT;+ case -1:+ case "UNRECOGNIZED":+ default:+ return UserType.UNRECOGNIZED;+ }+}++export function userTypeToJSON(object: UserType): string {+ switch (object) {+ case UserType.USER_TYPE_UNSPECIFIED:+ return "USER_TYPE_UNSPECIFIED";+ case UserType.USER:+ return "USER";+ case UserType.SYSTEM_BOT:+ return "SYSTEM_BOT";+ case UserType.SERVICE_ACCOUNT:+ return "SERVICE_ACCOUNT";+ case UserType.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}+export enum UserRole {USER_ROLE_UNSPECIFIED = 0,- USER_ROLE_OWNER = 1,- USER_ROLE_DBA = 2,- USER_ROLE_DEVELOPER = 3,+ OWNER = 1,+ DBA = 2,+ DEVELOPER = 3,UNRECOGNIZED = -1,}@@ -19,14 +65,14 @@ export function userRoleFromJSON(object: any): UserRole {case "USER_ROLE_UNSPECIFIED":return UserRole.USER_ROLE_UNSPECIFIED;case 1:- case "USER_ROLE_OWNER":- return UserRole.USER_ROLE_OWNER;+ case "OWNER":+ return UserRole.OWNER;case 2:- case "USER_ROLE_DBA":- return UserRole.USER_ROLE_DBA;+ case "DBA":+ return UserRole.DBA;case 3:- case "USER_ROLE_DEVELOPER":- return UserRole.USER_ROLE_DEVELOPER;+ case "DEVELOPER":+ return UserRole.DEVELOPER;case -1:case "UNRECOGNIZED":default:@@ -38,23 +84,89 @@ export function userRoleToJSON(object: UserRole): string {switch (object) {case UserRole.USER_ROLE_UNSPECIFIED:return "USER_ROLE_UNSPECIFIED";- case UserRole.USER_ROLE_OWNER:- return "USER_ROLE_OWNER";- case UserRole.USER_ROLE_DBA:- return "USER_ROLE_DBA";- case UserRole.USER_ROLE_DEVELOPER:- return "USER_ROLE_DEVELOPER";+ case UserRole.OWNER:+ return "OWNER";+ case UserRole.DBA:+ return "DBA";+ case UserRole.DEVELOPER:+ return "DEVELOPER";case UserRole.UNRECOGNIZED:default:return "UNRECOGNIZED";}}+export interface GetUserRequest {+ /**+ * The name of the user to retrieve.+ * Format: users/{user}+ */+ name: string;+}++export interface ListUsersRequest {+ /**+ * The maximum number of users to return. The service may return fewer than+ * this value.+ * If unspecified, at most 50 users will be returned.+ * The maximum value is 1000; values above 1000 will be coerced to 1000.+ */+ pageSize: number;+ /**+ * A page token, received from a previous `ListUsers` call.+ * Provide this to retrieve the subsequent page.+ *+ * When paginating, all other parameters provided to `ListUsers` must match+ * the call that provided the page token.+ */+ pageToken: string;+ /** Show deleted users if specified. */+ showDeleted: boolean;+}++export interface ListUsersResponse {+ /** The users from the specified publisher. */+ users: User[];+ /**+ * A token, which can be sent as `page_token` to retrieve the next page.+ * If this field is omitted, there are no subsequent pages.+ */+ nextPageToken: string;+}+export interface CreateUserRequest {/** The user to create. */user?: User;}+export interface UpdateUserRequest {+ /**+ * The user to update.+ *+ * The user's `name` field is used to identify the user to update.+ * Format: users/{user}+ */+ user?: User;+ /** The list of fields to update. */+ updateMask?: string[];+}++export interface DeleteUserRequest {+ /**+ * The name of the user to delete.+ * Format: users/{user}+ */+ name: string;+}++export interface UndeleteUserRequest {+ /**+ * The name of the deleted user.+ * Format: users/{user}+ */+ name: string;+}+export interface LoginRequest {email: string;password: string;@@ -79,10 +191,187 @@ export interface User {email: string;title: string;password: string;+ userType: UserType;/** The user role will not be respected in the create user request, because the role is controlled by workspace owner. */userRole: UserRole;}+function createBaseGetUserRequest(): GetUserRequest {+ return { name: "" };+}++export const GetUserRequest = {+ encode(message: GetUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): GetUserRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseGetUserRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.name = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): GetUserRequest {+ return { name: isSet(object.name) ? String(object.name) : "" };+ },++ toJSON(message: GetUserRequest): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<GetUserRequest>, I>>(object: I): GetUserRequest {+ const message = createBaseGetUserRequest();+ message.name = object.name ?? "";+ return message;+ },+};++function createBaseListUsersRequest(): ListUsersRequest {+ return { pageSize: 0, pageToken: "", showDeleted: false };+}++export const ListUsersRequest = {+ encode(message: ListUsersRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.pageSize !== 0) {+ writer.uint32(8).int32(message.pageSize);+ }+ if (message.pageToken !== "") {+ writer.uint32(18).string(message.pageToken);+ }+ if (message.showDeleted === true) {+ writer.uint32(24).bool(message.showDeleted);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListUsersRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListUsersRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.pageSize = reader.int32();+ break;+ case 2:+ message.pageToken = reader.string();+ break;+ case 3:+ message.showDeleted = reader.bool();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): ListUsersRequest {+ return {+ pageSize: isSet(object.pageSize) ? Number(object.pageSize) : 0,+ pageToken: isSet(object.pageToken) ? String(object.pageToken) : "",+ showDeleted: isSet(object.showDeleted) ? Boolean(object.showDeleted) : false,+ };+ },++ toJSON(message: ListUsersRequest): unknown {+ const obj: any = {};+ message.pageSize !== undefined && (obj.pageSize = Math.round(message.pageSize));+ message.pageToken !== undefined && (obj.pageToken = message.pageToken);+ message.showDeleted !== undefined && (obj.showDeleted = message.showDeleted);+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<ListUsersRequest>, I>>(object: I): ListUsersRequest {+ const message = createBaseListUsersRequest();+ message.pageSize = object.pageSize ?? 0;+ message.pageToken = object.pageToken ?? "";+ message.showDeleted = object.showDeleted ?? false;+ return message;+ },+};++function createBaseListUsersResponse(): ListUsersResponse {+ return { users: [], nextPageToken: "" };+}++export const ListUsersResponse = {+ encode(message: ListUsersResponse, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.users) {+ User.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ if (message.nextPageToken !== "") {+ writer.uint32(18).string(message.nextPageToken);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): ListUsersResponse {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseListUsersResponse();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.users.push(User.decode(reader, reader.uint32()));+ break;+ case 2:+ message.nextPageToken = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): ListUsersResponse {+ return {+ users: Array.isArray(object?.users) ? object.users.map((e: any) => User.fromJSON(e)) : [],+ nextPageToken: isSet(object.nextPageToken) ? String(object.nextPageToken) : "",+ };+ },++ toJSON(message: ListUsersResponse): unknown {+ const obj: any = {};+ if (message.users) {+ obj.users = message.users.map((e) => e ? User.toJSON(e) : undefined);+ } else {+ obj.users = [];+ }+ message.nextPageToken !== undefined && (obj.nextPageToken = message.nextPageToken);+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<ListUsersResponse>, I>>(object: I): ListUsersResponse {+ const message = createBaseListUsersResponse();+ message.users = object.users?.map((e) => User.fromPartial(e)) || [];+ message.nextPageToken = object.nextPageToken ?? "";+ return message;+ },+};+function createBaseCreateUserRequest(): CreateUserRequest {return { user: undefined };}@@ -130,6 +419,158 @@ export const CreateUserRequest = {},};+function createBaseUpdateUserRequest(): UpdateUserRequest {+ return { user: undefined, updateMask: undefined };+}++export const UpdateUserRequest = {+ encode(message: UpdateUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.user !== undefined) {+ User.encode(message.user, writer.uint32(10).fork()).ldelim();+ }+ if (message.updateMask !== undefined) {+ FieldMask.encode(FieldMask.wrap(message.updateMask), writer.uint32(18).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UpdateUserRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUpdateUserRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.user = User.decode(reader, reader.uint32());+ break;+ case 2:+ message.updateMask = FieldMask.unwrap(FieldMask.decode(reader, reader.uint32()));+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): UpdateUserRequest {+ return {+ user: isSet(object.user) ? User.fromJSON(object.user) : undefined,+ updateMask: isSet(object.updateMask) ? FieldMask.unwrap(FieldMask.fromJSON(object.updateMask)) : undefined,+ };+ },++ toJSON(message: UpdateUserRequest): unknown {+ const obj: any = {};+ message.user !== undefined && (obj.user = message.user ? User.toJSON(message.user) : undefined);+ message.updateMask !== undefined && (obj.updateMask = FieldMask.toJSON(FieldMask.wrap(message.updateMask)));+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<UpdateUserRequest>, I>>(object: I): UpdateUserRequest {+ const message = createBaseUpdateUserRequest();+ message.user = (object.user !== undefined && object.user !== null) ? User.fromPartial(object.user) : undefined;+ message.updateMask = object.updateMask ?? undefined;+ return message;+ },+};++function createBaseDeleteUserRequest(): DeleteUserRequest {+ return { name: "" };+}++export const DeleteUserRequest = {+ encode(message: DeleteUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): DeleteUserRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseDeleteUserRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.name = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): DeleteUserRequest {+ return { name: isSet(object.name) ? String(object.name) : "" };+ },++ toJSON(message: DeleteUserRequest): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<DeleteUserRequest>, I>>(object: I): DeleteUserRequest {+ const message = createBaseDeleteUserRequest();+ message.name = object.name ?? "";+ return message;+ },+};++function createBaseUndeleteUserRequest(): UndeleteUserRequest {+ return { name: "" };+}++export const UndeleteUserRequest = {+ encode(message: UndeleteUserRequest, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.name !== "") {+ writer.uint32(10).string(message.name);+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): UndeleteUserRequest {+ const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseUndeleteUserRequest();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ message.name = reader.string();+ break;+ default:+ reader.skipType(tag & 7);+ break;+ }+ }+ return message;+ },++ fromJSON(object: any): UndeleteUserRequest {+ return { name: isSet(object.name) ? String(object.name) : "" };+ },++ toJSON(message: UndeleteUserRequest): unknown {+ const obj: any = {};+ message.name !== undefined && (obj.name = message.name);+ return obj;+ },++ fromPartial<I extends Exact<DeepPartial<UndeleteUserRequest>, I>>(object: I): UndeleteUserRequest {+ const message = createBaseUndeleteUserRequest();+ message.name = object.name ?? "";+ return message;+ },+};+function createBaseLoginRequest(): LoginRequest {return { email: "", password: "", web: false };}@@ -284,7 +725,7 @@ export const LogoutRequest = {};function createBaseUser(): User {- return { name: "", state: 0, email: "", title: "", password: "", userRole: 0 };+ return { name: "", state: 0, email: "", title: "", password: "", userType: 0, userRole: 0 };}export const User = {@@ -304,8 +745,11 @@ export const User = {if (message.password !== "") {writer.uint32(42).string(message.password);}+ if (message.userType !== 0) {+ writer.uint32(48).int32(message.userType);+ }if (message.userRole !== 0) {- writer.uint32(48).int32(message.userRole);+ writer.uint32(56).int32(message.userRole);}return writer;},@@ -333,6 +777,9 @@ export const User = {message.password = reader.string();break;case 6:+ message.userType = reader.int32() as any;+ break;+ case 7:message.userRole = reader.int32() as any;break;default:@@ -350,6 +797,7 @@ export const User = {email: isSet(object.email) ? String(object.email) : "",title: isSet(object.title) ? String(object.title) : "",password: isSet(object.password) ? String(object.password) : "",+ userType: isSet(object.userType) ? userTypeFromJSON(object.userType) : 0,userRole: isSet(object.userRole) ? userRoleFromJSON(object.userRole) : 0,};},@@ -361,6 +809,7 @@ export const User = {message.email !== undefined && (obj.email = message.email);message.title !== undefined && (obj.title = message.title);message.password !== undefined && (obj.password = message.password);+ message.userType !== undefined && (obj.userType = userTypeToJSON(message.userType));message.userRole !== undefined && (obj.userRole = userRoleToJSON(message.userRole));return obj;},@@ -372,13 +821,19 @@ export const User = {message.email = object.email ?? "";message.title = object.title ?? "";message.password = object.password ?? "";+ message.userType = object.userType ?? 0;message.userRole = object.userRole ?? 0;return message;},};export interface AuthService {+ GetUser(request: GetUserRequest): Promise<User>;+ ListUsers(request: ListUsersRequest): Promise<ListUsersResponse>;CreateUser(request: CreateUserRequest): Promise<User>;+ UpdateUser(request: UpdateUserRequest): Promise<User>;+ DeleteUser(request: DeleteUserRequest): Promise<Empty>;+ UndeleteUser(request: UndeleteUserRequest): Promise<User>;Login(request: LoginRequest): Promise<LoginResponse>;Logout(request: LogoutRequest): Promise<Empty>;}@@ -389,16 +844,51 @@ export class AuthServiceClientImpl implements AuthService {constructor(rpc: Rpc, opts?: { service?: string }) {this.service = opts?.service || "bytebase.v1.AuthService";this.rpc = rpc;+ this.GetUser = this.GetUser.bind(this);+ this.ListUsers = this.ListUsers.bind(this);this.CreateUser = this.CreateUser.bind(this);+ this.UpdateUser = this.UpdateUser.bind(this);+ this.DeleteUser = this.DeleteUser.bind(this);+ this.UndeleteUser = this.UndeleteUser.bind(this);this.Login = this.Login.bind(this);this.Logout = this.Logout.bind(this);}+ GetUser(request: GetUserRequest): Promise<User> {+ const data = GetUserRequest.encode(request).finish();+ const promise = this.rpc.request(this.service, "GetUser", data);+ return promise.then((data) => User.decode(new _m0.Reader(data)));+ }++ ListUsers(request: ListUsersRequest): Promise<ListUsersResponse> {+ const data = ListUsersRequest.encode(request).finish();+ const promise = this.rpc.request(this.service, "ListUsers", data);+ return promise.then((data) => ListUsersResponse.decode(new _m0.Reader(data)));+ }+CreateUser(request: CreateUserRequest): Promise<User> {const data = CreateUserRequest.encode(request).finish();const promise = this.rpc.request(this.service, "CreateUser", data);return promise.then((data) => User.decode(new _m0.Reader(data)));}+ UpdateUser(request: UpdateUserRequest): Promise<User> {+ const data = UpdateUserRequest.encode(request).finish();+ const promise = this.rpc.request(this.service, "UpdateUser", data);+ return promise.then((data) => User.decode(new _m0.Reader(data)));+ }++ DeleteUser(request: DeleteUserRequest): Promise<Empty> {+ const data = DeleteUserRequest.encode(request).finish();+ const promise = this.rpc.request(this.service, "DeleteUser", data);+ return promise.then((data) => Empty.decode(new _m0.Reader(data)));+ }++ UndeleteUser(request: UndeleteUserRequest): Promise<User> {+ const data = UndeleteUserRequest.encode(request).finish();+ const promise = this.rpc.request(this.service, "UndeleteUser", data);+ return promise.then((data) => User.decode(new _m0.Reader(data)));+ }+Login(request: LoginRequest): Promise<LoginResponse> {const data = LoginRequest.encode(request).finish();const promise = this.rpc.request(this.service, "Login", data);diff --git a/frontend/src/types/proto/v1/common.ts b/frontend/src/types/proto/v1/common.tsindex 02086761f7..e52a0c3696 100644--- a/frontend/src/types/proto/v1/common.ts+++ b/frontend/src/types/proto/v1/common.ts@@ -4,8 +4,8 @@ export const protobufPackage = "bytebase.v1";export enum State {STATE_UNSPECIFIED = 0,- STATE_ACTIVE = 1,- STATE_DELETED = 2,+ ACTIVE = 1,+ DELETED = 2,UNRECOGNIZED = -1,}@@ -15,11 +15,11 @@ export function stateFromJSON(object: any): State {case "STATE_UNSPECIFIED":return State.STATE_UNSPECIFIED;case 1:- case "STATE_ACTIVE":- return State.STATE_ACTIVE;+ case "ACTIVE":+ return State.ACTIVE;case 2:- case "STATE_DELETED":- return State.STATE_DELETED;+ case "DELETED":+ return State.DELETED;case -1:case "UNRECOGNIZED":default:@@ -31,10 +31,10 @@ export function stateToJSON(object: State): string {switch (object) {case State.STATE_UNSPECIFIED:return "STATE_UNSPECIFIED";- case State.STATE_ACTIVE:- return "STATE_ACTIVE";- case State.STATE_DELETED:- return "STATE_DELETED";+ case State.ACTIVE:+ return "ACTIVE";+ case State.DELETED:+ return "DELETED";case State.UNRECOGNIZED:default:return "UNRECOGNIZED";diff --git a/frontend/src/types/proto/v1/instance_service.ts b/frontend/src/types/proto/v1/instance_service.tsindex e8490ed876..cba98c12ab 100644--- a/frontend/src/types/proto/v1/instance_service.ts+++ b/frontend/src/types/proto/v1/instance_service.ts@@ -8,13 +8,13 @@ export const protobufPackage = "bytebase.v1";export enum Engine {ENGINE_UNSPECIFIED = 0,- ENGINE_CLICKHOUSE = 1,- ENGINE_MYSQL = 2,- ENGINE_POSTGRES = 3,- ENGINE_SNOWFLAKE = 4,- ENGINE_SQLITE = 5,- ENGINE_TIDB = 6,- ENGINE_MONGODB = 7,+ CLICKHOUSE = 1,+ MYSQL = 2,+ POSTGRES = 3,+ SNOWFLAKE = 4,+ SQLITE = 5,+ TIDB = 6,+ MONGODB = 7,UNRECOGNIZED = -1,}@@ -24,26 +24,26 @@ export function engineFromJSON(object: any): Engine {case "ENGINE_UNSPECIFIED":return Engine.ENGINE_UNSPECIFIED;case 1:- case "ENGINE_CLICKHOUSE":- return Engine.ENGINE_CLICKHOUSE;+ case "CLICKHOUSE":+ return Engine.CLICKHOUSE;case 2:- case "ENGINE_MYSQL":- return Engine.ENGINE_MYSQL;+ case "MYSQL":+ return Engine.MYSQL;case 3:- case "ENGINE_POSTGRES":- return Engine.ENGINE_POSTGRES;+ case "POSTGRES":+ return Engine.POSTGRES;case 4:- case "ENGINE_SNOWFLAKE":- return Engine.ENGINE_SNOWFLAKE;+ case "SNOWFLAKE":+ return Engine.SNOWFLAKE;case 5:- case "ENGINE_SQLITE":- return Engine.ENGINE_SQLITE;+ case "SQLITE":+ return Engine.SQLITE;case 6:- case "ENGINE_TIDB":- return Engine.ENGINE_TIDB;+ case "TIDB":+ return Engine.TIDB;case 7:- case "ENGINE_MONGODB":- return Engine.ENGINE_MONGODB;+ case "MONGODB":+ return Engine.MONGODB;case -1:case "UNRECOGNIZED":default:@@ -55,20 +55,20 @@ export function engineToJSON(object: Engine): string {switch (object) {case Engine.ENGINE_UNSPECIFIED:return "ENGINE_UNSPECIFIED";- case Engine.ENGINE_CLICKHOUSE:- return "ENGINE_CLICKHOUSE";- case Engine.ENGINE_MYSQL:- return "ENGINE_MYSQL";- case Engine.ENGINE_POSTGRES:- return "ENGINE_POSTGRES";- case Engine.ENGINE_SNOWFLAKE:- return "ENGINE_SNOWFLAKE";- case Engine.ENGINE_SQLITE:- return "ENGINE_SQLITE";- case Engine.ENGINE_TIDB:- return "ENGINE_TIDB";- case Engine.ENGINE_MONGODB:- return "ENGINE_MONGODB";+ case Engine.CLICKHOUSE:+ return "CLICKHOUSE";+ case Engine.MYSQL:+ return "MYSQL";+ case Engine.POSTGRES:+ return "POSTGRES";+ case Engine.SNOWFLAKE:+ return "SNOWFLAKE";+ case Engine.SQLITE:+ return "SQLITE";+ case Engine.TIDB:+ return "TIDB";+ case Engine.MONGODB:+ return "MONGODB";case Engine.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -77,8 +77,8 @@ export function engineToJSON(object: Engine): string {export enum DataSourceType {DATA_SOURCE_UNSPECIFIED = 0,- DATA_SOURCE_ADMIN = 1,- DATA_SOURCE_RO = 2,+ ADMIN = 1,+ READ_ONLY = 2,UNRECOGNIZED = -1,}@@ -88,11 +88,11 @@ export function dataSourceTypeFromJSON(object: any): DataSourceType {case "DATA_SOURCE_UNSPECIFIED":return DataSourceType.DATA_SOURCE_UNSPECIFIED;case 1:- case "DATA_SOURCE_ADMIN":- return DataSourceType.DATA_SOURCE_ADMIN;+ case "ADMIN":+ return DataSourceType.ADMIN;case 2:- case "DATA_SOURCE_RO":- return DataSourceType.DATA_SOURCE_RO;+ case "READ_ONLY":+ return DataSourceType.READ_ONLY;case -1:case "UNRECOGNIZED":default:@@ -104,10 +104,10 @@ export function dataSourceTypeToJSON(object: DataSourceType): string {switch (object) {case DataSourceType.DATA_SOURCE_UNSPECIFIED:return "DATA_SOURCE_UNSPECIFIED";- case DataSourceType.DATA_SOURCE_ADMIN:- return "DATA_SOURCE_ADMIN";- case DataSourceType.DATA_SOURCE_RO:- return "DATA_SOURCE_RO";+ case DataSourceType.ADMIN:+ return "ADMIN";+ case DataSourceType.READ_ONLY:+ return "READ_ONLY";case DataSourceType.UNRECOGNIZED:default:return "UNRECOGNIZED";diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.tsindex 5ac3657989..e6f0959bc5 100644--- a/frontend/src/types/proto/v1/project_service.ts+++ b/frontend/src/types/proto/v1/project_service.ts@@ -8,8 +8,8 @@ export const protobufPackage = "bytebase.v1";export enum Workflow {WORKFLOW_UNSPECIFIED = 0,- WORKFLOW_UI = 1,- WORKFLOW_VCS = 2,+ UI = 1,+ VCS = 2,UNRECOGNIZED = -1,}@@ -19,11 +19,11 @@ export function workflowFromJSON(object: any): Workflow {case "WORKFLOW_UNSPECIFIED":return Workflow.WORKFLOW_UNSPECIFIED;case 1:- case "WORKFLOW_UI":- return Workflow.WORKFLOW_UI;+ case "UI":+ return Workflow.UI;case 2:- case "WORKFLOW_VCS":- return Workflow.WORKFLOW_VCS;+ case "VCS":+ return Workflow.VCS;case -1:case "UNRECOGNIZED":default:@@ -35,10 +35,10 @@ export function workflowToJSON(object: Workflow): string {switch (object) {case Workflow.WORKFLOW_UNSPECIFIED:return "WORKFLOW_UNSPECIFIED";- case Workflow.WORKFLOW_UI:- return "WORKFLOW_UI";- case Workflow.WORKFLOW_VCS:- return "WORKFLOW_VCS";+ case Workflow.UI:+ return "UI";+ case Workflow.VCS:+ return "VCS";case Workflow.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -125,9 +125,9 @@ export function tenantModeToJSON(object: TenantMode): string {export enum RoleProvider {ROLE_PROVIDER_UNSPECIFIED = 0,- ROLE_PROVIDER_BYTEBASE = 1,- ROLE_PROVIDER_GITLAB_SELF_HOST = 2,- ROLE_PROVIDER_GITHUB_COM = 3,+ BYTEBASE = 1,+ GITLAB_SELF_HOST = 2,+ GITHUB_COM = 3,UNRECOGNIZED = -1,}@@ -137,14 +137,14 @@ export function roleProviderFromJSON(object: any): RoleProvider {case "ROLE_PROVIDER_UNSPECIFIED":return RoleProvider.ROLE_PROVIDER_UNSPECIFIED;case 1:- case "ROLE_PROVIDER_BYTEBASE":- return RoleProvider.ROLE_PROVIDER_BYTEBASE;+ case "BYTEBASE":+ return RoleProvider.BYTEBASE;case 2:- case "ROLE_PROVIDER_GITLAB_SELF_HOST":- return RoleProvider.ROLE_PROVIDER_GITLAB_SELF_HOST;+ case "GITLAB_SELF_HOST":+ return RoleProvider.GITLAB_SELF_HOST;case 3:- case "ROLE_PROVIDER_GITHUB_COM":- return RoleProvider.ROLE_PROVIDER_GITHUB_COM;+ case "GITHUB_COM":+ return RoleProvider.GITHUB_COM;case -1:case "UNRECOGNIZED":default:@@ -156,12 +156,12 @@ export function roleProviderToJSON(object: RoleProvider): string {switch (object) {case RoleProvider.ROLE_PROVIDER_UNSPECIFIED:return "ROLE_PROVIDER_UNSPECIFIED";- case RoleProvider.ROLE_PROVIDER_BYTEBASE:- return "ROLE_PROVIDER_BYTEBASE";- case RoleProvider.ROLE_PROVIDER_GITLAB_SELF_HOST:- return "ROLE_PROVIDER_GITLAB_SELF_HOST";- case RoleProvider.ROLE_PROVIDER_GITHUB_COM:- return "ROLE_PROVIDER_GITHUB_COM";+ case RoleProvider.BYTEBASE:+ return "BYTEBASE";+ case RoleProvider.GITLAB_SELF_HOST:+ return "GITLAB_SELF_HOST";+ case RoleProvider.GITHUB_COM:+ return "GITHUB_COM";case RoleProvider.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -170,8 +170,8 @@ export function roleProviderToJSON(object: RoleProvider): string {export enum SchemaVersion {SCHEMA_VERSION_UNSPECIFIED = 0,- SCHEMA_VERSION_TIMESTAMP = 1,- SCHEMA_VERSION_SEMANTIC = 2,+ TIMESTAMP = 1,+ SEMANTIC = 2,UNRECOGNIZED = -1,}@@ -181,11 +181,11 @@ export function schemaVersionFromJSON(object: any): SchemaVersion {case "SCHEMA_VERSION_UNSPECIFIED":return SchemaVersion.SCHEMA_VERSION_UNSPECIFIED;case 1:- case "SCHEMA_VERSION_TIMESTAMP":- return SchemaVersion.SCHEMA_VERSION_TIMESTAMP;+ case "TIMESTAMP":+ return SchemaVersion.TIMESTAMP;case 2:- case "SCHEMA_VERSION_SEMANTIC":- return SchemaVersion.SCHEMA_VERSION_SEMANTIC;+ case "SEMANTIC":+ return SchemaVersion.SEMANTIC;case -1:case "UNRECOGNIZED":default:@@ -197,10 +197,10 @@ export function schemaVersionToJSON(object: SchemaVersion): string {switch (object) {case SchemaVersion.SCHEMA_VERSION_UNSPECIFIED:return "SCHEMA_VERSION_UNSPECIFIED";- case SchemaVersion.SCHEMA_VERSION_TIMESTAMP:- return "SCHEMA_VERSION_TIMESTAMP";- case SchemaVersion.SCHEMA_VERSION_SEMANTIC:- return "SCHEMA_VERSION_SEMANTIC";+ case SchemaVersion.TIMESTAMP:+ return "TIMESTAMP";+ case SchemaVersion.SEMANTIC:+ return "SEMANTIC";case SchemaVersion.UNRECOGNIZED:default:return "UNRECOGNIZED";@@ -209,8 +209,8 @@ export function schemaVersionToJSON(object: SchemaVersion): string {export enum SchemaChange {SCHEMA_CHANGE_UNSPECIFIED = 0,- SCHEMA_CHANGE_DDL = 1,- SCHEMA_CHANGE_SDL = 2,+ DDL = 1,+ SDL = 2,UNRECOGNIZED = -1,}@@ -220,11 +220,11 @@ export function schemaChangeFromJSON(object: any): SchemaChange {case "SCHEMA_CHANGE_UNSPECIFIED":return SchemaChange.SCHEMA_CHANGE_UNSPECIFIED;case 1:- case "SCHEMA_CHANGE_DDL":- return SchemaChange.SCHEMA_CHANGE_DDL;+ case "DDL":+ return SchemaChange.DDL;case 2:- case "SCHEMA_CHANGE_SDL":- return SchemaChange.SCHEMA_CHANGE_SDL;+ case "SDL":+ return SchemaChange.SDL;case -1:case "UNRECOGNIZED":default:@@ -236,10 +236,10 @@ export function schemaChangeToJSON(object: SchemaChange): string {switch (object) {case SchemaChange.SCHEMA_CHANGE_UNSPECIFIED:return "SCHEMA_CHANGE_UNSPECIFIED";- case SchemaChange.SCHEMA_CHANGE_DDL:- return "SCHEMA_CHANGE_DDL";- case SchemaChange.SCHEMA_CHANGE_SDL:- return "SCHEMA_CHANGE_SDL";+ case SchemaChange.DDL:+ return "DDL";+ case SchemaChange.SDL:+ return "SDL";case SchemaChange.UNRECOGNIZED:default:return "UNRECOGNIZED";diff --git a/proto/generated-go/v1/auth_service.pb.go b/proto/generated-go/v1/auth_service.pb.goindex f61be8226d..4744105d07 100644--- a/proto/generated-go/v1/auth_service.pb.go+++ b/proto/generated-go/v1/auth_service.pb.go@@ -11,6 +11,7 @@ import (protoreflect "google.golang.org/protobuf/reflect/protoreflect"protoimpl "google.golang.org/protobuf/runtime/protoimpl"emptypb "google.golang.org/protobuf/types/known/emptypb"+ fieldmaskpb "google.golang.org/protobuf/types/known/fieldmaskpb"reflect "reflect"sync "sync")@@ -22,28 +23,80 @@ const (_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20))+type UserType int32++const (+ UserType_USER_TYPE_UNSPECIFIED UserType = 0+ UserType_USER UserType = 1+ UserType_SYSTEM_BOT UserType = 2+ UserType_SERVICE_ACCOUNT UserType = 3+)++// Enum value maps for UserType.+var (+ UserType_name = map[int32]string{+ 0: "USER_TYPE_UNSPECIFIED",+ 1: "USER",+ 2: "SYSTEM_BOT",+ 3: "SERVICE_ACCOUNT",+ }+ UserType_value = map[string]int32{+ "USER_TYPE_UNSPECIFIED": 0,+ "USER": 1,+ "SYSTEM_BOT": 2,+ "SERVICE_ACCOUNT": 3,+ }+)++func (x UserType) Enum() *UserType {+ p := new(UserType)+ *p = x+ return p+}++func (x UserType) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (UserType) Descriptor() protoreflect.EnumDescriptor {+ return file_v1_auth_service_proto_enumTypes[0].Descriptor()+}++func (UserType) Type() protoreflect.EnumType {+ return &file_v1_auth_service_proto_enumTypes[0]+}++func (x UserType) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use UserType.Descriptor instead.+func (UserType) EnumDescriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{0}+}+type UserRole int32const (UserRole_USER_ROLE_UNSPECIFIED UserRole = 0- UserRole_USER_ROLE_OWNER UserRole = 1- UserRole_USER_ROLE_DBA UserRole = 2- UserRole_USER_ROLE_DEVELOPER UserRole = 3+ UserRole_OWNER UserRole = 1+ UserRole_DBA UserRole = 2+ UserRole_DEVELOPER UserRole = 3)// Enum value maps for UserRole.var (UserRole_name = map[int32]string{0: "USER_ROLE_UNSPECIFIED",- 1: "USER_ROLE_OWNER",- 2: "USER_ROLE_DBA",- 3: "USER_ROLE_DEVELOPER",+ 1: "OWNER",+ 2: "DBA",+ 3: "DEVELOPER",}UserRole_value = map[string]int32{"USER_ROLE_UNSPECIFIED": 0,- "USER_ROLE_OWNER": 1,- "USER_ROLE_DBA": 2,- "USER_ROLE_DEVELOPER": 3,+ "OWNER": 1,+ "DBA": 2,+ "DEVELOPER": 3,})@@ -58,11 +111,11 @@ func (x UserRole) String() string {}func (UserRole) Descriptor() protoreflect.EnumDescriptor {- return file_v1_auth_service_proto_enumTypes[0].Descriptor()+ return file_v1_auth_service_proto_enumTypes[1].Descriptor()}func (UserRole) Type() protoreflect.EnumType {- return &file_v1_auth_service_proto_enumTypes[0]+ return &file_v1_auth_service_proto_enumTypes[1]}func (x UserRole) Number() protoreflect.EnumNumber {@@ -71,9 +124,189 @@ func (x UserRole) Number() protoreflect.EnumNumber {// Deprecated: Use UserRole.Descriptor instead.func (UserRole) EnumDescriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{1}+}++type GetUserRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the user to retrieve.+ // Format: users/{user}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+}++func (x *GetUserRequest) Reset() {+ *x = GetUserRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[0]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *GetUserRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*GetUserRequest) ProtoMessage() {}++func (x *GetUserRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[0]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use GetUserRequest.ProtoReflect.Descriptor instead.+func (*GetUserRequest) Descriptor() ([]byte, []int) {return file_v1_auth_service_proto_rawDescGZIP(), []int{0}}+func (x *GetUserRequest) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++type ListUsersRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The maximum number of users to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 users will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ PageSize int32 `protobuf:"varint,1,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`+ // A page token, received from a previous `ListUsers` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `ListUsers` must match+ // the call that provided the page token.+ PageToken string `protobuf:"bytes,2,opt,name=page_token,json=pageToken,proto3" json:"page_token,omitempty"`+ // Show deleted users if specified.+ ShowDeleted bool `protobuf:"varint,3,opt,name=show_deleted,json=showDeleted,proto3" json:"show_deleted,omitempty"`+}++func (x *ListUsersRequest) Reset() {+ *x = ListUsersRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[1]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListUsersRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListUsersRequest) ProtoMessage() {}++func (x *ListUsersRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[1]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListUsersRequest.ProtoReflect.Descriptor instead.+func (*ListUsersRequest) Descriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{1}+}++func (x *ListUsersRequest) GetPageSize() int32 {+ if x != nil {+ return x.PageSize+ }+ return 0+}++func (x *ListUsersRequest) GetPageToken() string {+ if x != nil {+ return x.PageToken+ }+ return ""+}++func (x *ListUsersRequest) GetShowDeleted() bool {+ if x != nil {+ return x.ShowDeleted+ }+ return false+}++type ListUsersResponse struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The users from the specified publisher.+ Users []*User `protobuf:"bytes,1,rep,name=users,proto3" json:"users,omitempty"`+ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ NextPageToken string `protobuf:"bytes,2,opt,name=next_page_token,json=nextPageToken,proto3" json:"next_page_token,omitempty"`+}++func (x *ListUsersResponse) Reset() {+ *x = ListUsersResponse{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[2]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *ListUsersResponse) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*ListUsersResponse) ProtoMessage() {}++func (x *ListUsersResponse) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[2]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use ListUsersResponse.ProtoReflect.Descriptor instead.+func (*ListUsersResponse) Descriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{2}+}++func (x *ListUsersResponse) GetUsers() []*User {+ if x != nil {+ return x.Users+ }+ return nil+}++func (x *ListUsersResponse) GetNextPageToken() string {+ if x != nil {+ return x.NextPageToken+ }+ return ""+}+type CreateUserRequest struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -86,7 +319,7 @@ type CreateUserRequest struct {func (x *CreateUserRequest) Reset() {*x = CreateUserRequest{}if protoimpl.UnsafeEnabled {- mi := &file_v1_auth_service_proto_msgTypes[0]+ mi := &file_v1_auth_service_proto_msgTypes[3]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -99,7 +332,7 @@ func (x *CreateUserRequest) String() string {func (*CreateUserRequest) ProtoMessage() {}func (x *CreateUserRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_auth_service_proto_msgTypes[0]+ mi := &file_v1_auth_service_proto_msgTypes[3]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -112,7 +345,7 @@ func (x *CreateUserRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use CreateUserRequest.ProtoReflect.Descriptor instead.func (*CreateUserRequest) Descriptor() ([]byte, []int) {- return file_v1_auth_service_proto_rawDescGZIP(), []int{0}+ return file_v1_auth_service_proto_rawDescGZIP(), []int{3}}func (x *CreateUserRequest) GetUser() *User {@@ -122,6 +355,164 @@ func (x *CreateUserRequest) GetUser() *User {return nil}+type UpdateUserRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The user to update.+ //+ // The user's `name` field is used to identify the user to update.+ // Format: users/{user}+ User *User `protobuf:"bytes,1,opt,name=user,proto3" json:"user,omitempty"`+ // The list of fields to update.+ UpdateMask *fieldmaskpb.FieldMask `protobuf:"bytes,2,opt,name=update_mask,json=updateMask,proto3" json:"update_mask,omitempty"`+}++func (x *UpdateUserRequest) Reset() {+ *x = UpdateUserRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[4]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UpdateUserRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UpdateUserRequest) ProtoMessage() {}++func (x *UpdateUserRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[4]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UpdateUserRequest.ProtoReflect.Descriptor instead.+func (*UpdateUserRequest) Descriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{4}+}++func (x *UpdateUserRequest) GetUser() *User {+ if x != nil {+ return x.User+ }+ return nil+}++func (x *UpdateUserRequest) GetUpdateMask() *fieldmaskpb.FieldMask {+ if x != nil {+ return x.UpdateMask+ }+ return nil+}++type DeleteUserRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the user to delete.+ // Format: users/{user}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+}++func (x *DeleteUserRequest) Reset() {+ *x = DeleteUserRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[5]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *DeleteUserRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*DeleteUserRequest) ProtoMessage() {}++func (x *DeleteUserRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[5]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use DeleteUserRequest.ProtoReflect.Descriptor instead.+func (*DeleteUserRequest) Descriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{5}+}++func (x *DeleteUserRequest) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}++type UndeleteUserRequest struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // The name of the deleted user.+ // Format: users/{user}+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+}++func (x *UndeleteUserRequest) Reset() {+ *x = UndeleteUserRequest{}+ if protoimpl.UnsafeEnabled {+ mi := &file_v1_auth_service_proto_msgTypes[6]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *UndeleteUserRequest) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*UndeleteUserRequest) ProtoMessage() {}++func (x *UndeleteUserRequest) ProtoReflect() protoreflect.Message {+ mi := &file_v1_auth_service_proto_msgTypes[6]+ if protoimpl.UnsafeEnabled && x != nil {+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ if ms.LoadMessageInfo() == nil {+ ms.StoreMessageInfo(mi)+ }+ return ms+ }+ return mi.MessageOf(x)+}++// Deprecated: Use UndeleteUserRequest.ProtoReflect.Descriptor instead.+func (*UndeleteUserRequest) Descriptor() ([]byte, []int) {+ return file_v1_auth_service_proto_rawDescGZIP(), []int{6}+}++func (x *UndeleteUserRequest) GetName() string {+ if x != nil {+ return x.Name+ }+ return ""+}+type LoginRequest struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -136,7 +527,7 @@ type LoginRequest struct {func (x *LoginRequest) Reset() {*x = LoginRequest{}if protoimpl.UnsafeEnabled {- mi := &file_v1_auth_service_proto_msgTypes[1]+ mi := &file_v1_auth_service_proto_msgTypes[7]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -149,7 +540,7 @@ func (x *LoginRequest) String() string {func (*LoginRequest) ProtoMessage() {}func (x *LoginRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_auth_service_proto_msgTypes[1]+ mi := &file_v1_auth_service_proto_msgTypes[7]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -162,7 +553,7 @@ func (x *LoginRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use LoginRequest.ProtoReflect.Descriptor instead.func (*LoginRequest) Descriptor() ([]byte, []int) {- return file_v1_auth_service_proto_rawDescGZIP(), []int{1}+ return file_v1_auth_service_proto_rawDescGZIP(), []int{7}}func (x *LoginRequest) GetEmail() string {@@ -197,7 +588,7 @@ type LoginResponse struct {func (x *LoginResponse) Reset() {*x = LoginResponse{}if protoimpl.UnsafeEnabled {- mi := &file_v1_auth_service_proto_msgTypes[2]+ mi := &file_v1_auth_service_proto_msgTypes[8]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -210,7 +601,7 @@ func (x *LoginResponse) String() string {func (*LoginResponse) ProtoMessage() {}func (x *LoginResponse) ProtoReflect() protoreflect.Message {- mi := &file_v1_auth_service_proto_msgTypes[2]+ mi := &file_v1_auth_service_proto_msgTypes[8]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -223,7 +614,7 @@ func (x *LoginResponse) ProtoReflect() protoreflect.Message {// Deprecated: Use LoginResponse.ProtoReflect.Descriptor instead.func (*LoginResponse) Descriptor() ([]byte, []int) {- return file_v1_auth_service_proto_rawDescGZIP(), []int{2}+ return file_v1_auth_service_proto_rawDescGZIP(), []int{8}}func (x *LoginResponse) GetToken() string {@@ -242,7 +633,7 @@ type LogoutRequest struct {func (x *LogoutRequest) Reset() {*x = LogoutRequest{}if protoimpl.UnsafeEnabled {- mi := &file_v1_auth_service_proto_msgTypes[3]+ mi := &file_v1_auth_service_proto_msgTypes[9]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -255,7 +646,7 @@ func (x *LogoutRequest) String() string {func (*LogoutRequest) ProtoMessage() {}func (x *LogoutRequest) ProtoReflect() protoreflect.Message {- mi := &file_v1_auth_service_proto_msgTypes[3]+ mi := &file_v1_auth_service_proto_msgTypes[9]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -268,7 +659,7 @@ func (x *LogoutRequest) ProtoReflect() protoreflect.Message {// Deprecated: Use LogoutRequest.ProtoReflect.Descriptor instead.func (*LogoutRequest) Descriptor() ([]byte, []int) {- return file_v1_auth_service_proto_rawDescGZIP(), []int{3}+ return file_v1_auth_service_proto_rawDescGZIP(), []int{9}}type User struct {@@ -278,19 +669,20 @@ type User struct {// The name of the user.// Format: users/{user}. {user} is a system-generated unique ID.- Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`- State State `protobuf:"varint,2,opt,name=state,proto3,enum=bytebase.v1.State" json:"state,omitempty"`- Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`- Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`- Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`+ Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`+ State State `protobuf:"varint,2,opt,name=state,proto3,enum=bytebase.v1.State" json:"state,omitempty"`+ Email string `protobuf:"bytes,3,opt,name=email,proto3" json:"email,omitempty"`+ Title string `protobuf:"bytes,4,opt,name=title,proto3" json:"title,omitempty"`+ Password string `protobuf:"bytes,5,opt,name=password,proto3" json:"password,omitempty"`+ UserType UserType `protobuf:"varint,6,opt,name=user_type,json=userType,proto3,enum=bytebase.v1.UserType" json:"user_type,omitempty"`// The user role will not be respected in the create user request, because the role is controlled by workspace owner.- UserRole UserRole `protobuf:"varint,6,opt,name=user_role,json=userRole,proto3,enum=bytebase.v1.UserRole" json:"user_role,omitempty"`+ UserRole UserRole `protobuf:"varint,7,opt,name=user_role,json=userRole,proto3,enum=bytebase.v1.UserRole" json:"user_role,omitempty"`}func (x *User) Reset() {*x = User{}if protoimpl.UnsafeEnabled {- mi := &file_v1_auth_service_proto_msgTypes[4]+ mi := &file_v1_auth_service_proto_msgTypes[10]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -303,7 +695,7 @@ func (x *User) String() string {func (*User) ProtoMessage() {}func (x *User) ProtoReflect() protoreflect.Message {- mi := &file_v1_auth_service_proto_msgTypes[4]+ mi := &file_v1_auth_service_proto_msgTypes[10]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -316,7 +708,7 @@ func (x *User) ProtoReflect() protoreflect.Message {// Deprecated: Use User.ProtoReflect.Descriptor instead.func (*User) Descriptor() ([]byte, []int) {- return file_v1_auth_service_proto_rawDescGZIP(), []int{4}+ return file_v1_auth_service_proto_rawDescGZIP(), []int{10}}func (x *User) GetName() string {@@ -354,6 +746,13 @@ func (x *User) GetPassword() string {return ""}+func (x *User) GetUserType() UserType {+ if x != nil {+ return x.UserType+ }+ return UserType_USER_TYPE_UNSPECIFIED+}+func (x *User) GetUserRole() UserRole {if x != nil {return x.UserRole@@ -373,60 +772,133 @@ var file_v1_auth_service_proto_rawDesc = []byte{0x67, 0x6c, 0x65, 0x2f, 0x61, 0x70, 0x69, 0x2f, 0x66, 0x69, 0x65, 0x6c, 0x64, 0x5f, 0x62, 0x65,0x68, 0x61, 0x76, 0x69, 0x6f, 0x72, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x1b, 0x67, 0x6f,0x6f, 0x67, 0x6c, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2f, 0x65, 0x6d,- 0x70, 0x74, 0x79, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f,- 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x40, 0x0a, 0x11, 0x43, 0x72,- 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12,- 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,- 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x52, 0x0a, 0x0c,- 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05,- 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61,- 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x10,- 0x0a, 0x03, 0x77, 0x65, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x03, 0x77, 0x65, 0x62,- 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73,- 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0f, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75,- 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0xcc, 0x01, 0x0a, 0x04, 0x55, 0x73, 0x65,- 0x72, 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, 0x28, 0x0a, 0x05, 0x73,- 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74,- 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53, 0x74, 0x61, 0x74, 0x65, 0x52, 0x05,- 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03,- 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74,- 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c,- 0x65, 0x12, 0x20, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20,- 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,- 0x6f, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65,- 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75,- 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x2a, 0x66, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52,+ 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, 0x1a, 0x0f, 0x76, 0x31, 0x2f,+ 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x2a, 0x0a, 0x0e,+ 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 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, 0x71, 0x0a, 0x10, 0x4c, 0x69, 0x73, 0x74,+ 0x55, 0x73, 0x65, 0x72, 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, 0x12, 0x21, 0x0a, 0x0c, 0x73, 0x68, 0x6f, 0x77,+ 0x5f, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x18, 0x03, 0x20, 0x01, 0x28, 0x08, 0x52, 0x0b,+ 0x73, 0x68, 0x6f, 0x77, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x64, 0x22, 0x64, 0x0a, 0x11, 0x4c,+ 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,+ 0x12, 0x27, 0x0a, 0x05, 0x75, 0x73, 0x65, 0x72, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32,+ 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73,+ 0x65, 0x72, 0x52, 0x05, 0x75, 0x73, 0x65, 0x72, 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, 0x40, 0x0a, 0x11, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52, 0x04, 0x75,+ 0x73, 0x65, 0x72, 0x22, 0x7d, 0x0a, 0x11, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65,+ 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x12, 0x2b, 0x0a, 0x04, 0x75, 0x73, 0x65, 0x72,+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x02, 0x52,+ 0x04, 0x75, 0x73, 0x65, 0x72, 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, 0x2d, 0x0a, 0x11, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72,+ 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, 0x2f, 0x0a, 0x13, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65,+ 0x72, 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, 0x52, 0x0a, 0x0c, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x12, 0x14, 0x0a, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x01, 0x20, 0x01, 0x28,+ 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69, 0x6c, 0x12, 0x1a, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73,+ 0x77, 0x6f, 0x72, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x08, 0x70, 0x61, 0x73, 0x73,+ 0x77, 0x6f, 0x72, 0x64, 0x12, 0x10, 0x0a, 0x03, 0x77, 0x65, 0x62, 0x18, 0x03, 0x20, 0x01, 0x28,+ 0x08, 0x52, 0x03, 0x77, 0x65, 0x62, 0x22, 0x25, 0x0a, 0x0d, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52,+ 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e,+ 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x74, 0x6f, 0x6b, 0x65, 0x6e, 0x22, 0x0f, 0x0a,+ 0x0d, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x22, 0x80,+ 0x02, 0x0a, 0x04, 0x55, 0x73, 0x65, 0x72, 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, 0x28, 0x0a, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e,+ 0x32, 0x12, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x53,+ 0x74, 0x61, 0x74, 0x65, 0x52, 0x05, 0x73, 0x74, 0x61, 0x74, 0x65, 0x12, 0x14, 0x0a, 0x05, 0x65,+ 0x6d, 0x61, 0x69, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x09, 0x52, 0x05, 0x65, 0x6d, 0x61, 0x69,+ 0x6c, 0x12, 0x14, 0x0a, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x18, 0x04, 0x20, 0x01, 0x28, 0x09,+ 0x52, 0x05, 0x74, 0x69, 0x74, 0x6c, 0x65, 0x12, 0x20, 0x0a, 0x08, 0x70, 0x61, 0x73, 0x73, 0x77,+ 0x6f, 0x72, 0x64, 0x18, 0x05, 0x20, 0x01, 0x28, 0x09, 0x42, 0x04, 0xe2, 0x41, 0x01, 0x04, 0x52,+ 0x08, 0x70, 0x61, 0x73, 0x73, 0x77, 0x6f, 0x72, 0x64, 0x12, 0x32, 0x0a, 0x09, 0x75, 0x73, 0x65,+ 0x72, 0x5f, 0x74, 0x79, 0x70, 0x65, 0x18, 0x06, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x15, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x54,+ 0x79, 0x70, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x32, 0x0a,+ 0x09, 0x75, 0x73, 0x65, 0x72, 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x18, 0x07, 0x20, 0x01, 0x28, 0x0e,+ 0x32, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,+ 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c, 0x65, 0x52, 0x08, 0x75, 0x73, 0x65, 0x72, 0x52, 0x6f, 0x6c,+ 0x65, 0x2a, 0x54, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x54, 0x79, 0x70, 0x65, 0x12, 0x19, 0x0a,+ 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x54, 0x59, 0x50, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,+ 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x08, 0x0a, 0x04, 0x55, 0x53, 0x45, 0x52,+ 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x53, 0x59, 0x53, 0x54, 0x45, 0x4d, 0x5f, 0x42, 0x4f, 0x54,+ 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x53, 0x45, 0x52, 0x56, 0x49, 0x43, 0x45, 0x5f, 0x41, 0x43,+ 0x43, 0x4f, 0x55, 0x4e, 0x54, 0x10, 0x03, 0x2a, 0x48, 0x0a, 0x08, 0x55, 0x73, 0x65, 0x72, 0x52,0x6f, 0x6c, 0x65, 0x12, 0x19, 0x0a, 0x15, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45,- 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x13,- 0x0a, 0x0f, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x4f, 0x57, 0x4e, 0x45,- 0x52, 0x10, 0x01, 0x12, 0x11, 0x0a, 0x0d, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52, 0x4f, 0x4c, 0x45,- 0x5f, 0x44, 0x42, 0x41, 0x10, 0x02, 0x12, 0x17, 0x0a, 0x13, 0x55, 0x53, 0x45, 0x52, 0x5f, 0x52,- 0x4f, 0x4c, 0x45, 0x5f, 0x44, 0x45, 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10, 0x03, 0x32,- 0xa3, 0x02, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12,- 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61,- 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e,- 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72,- 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65, 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a,- 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f, 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73,- 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71,- 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65,- 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31,- 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x06, 0x4c,- 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,+ 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, 0x07, 0x0a, 0x03, 0x44, 0x42, 0x41,+ 0x10, 0x02, 0x12, 0x0d, 0x0a, 0x09, 0x44, 0x45, 0x56, 0x45, 0x4c, 0x4f, 0x50, 0x45, 0x52, 0x10,+ 0x03, 0x32, 0xba, 0x06, 0x0a, 0x0b, 0x41, 0x75, 0x74, 0x68, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63,+ 0x65, 0x12, 0x5c, 0x0a, 0x07, 0x47, 0x65, 0x74, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1b, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x55, 0x73,+ 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x21, 0xda, 0x41,+ 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x12, 0x12, 0x2f, 0x76, 0x31,+ 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12,+ 0x66, 0x0a, 0x09, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73, 0x65, 0x72, 0x73, 0x12, 0x1d, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55,+ 0x73, 0x65, 0x72, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1e, 0x2e, 0x62, 0x79,+ 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x55, 0x73,+ 0x65, 0x72, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x1a, 0xda, 0x41, 0x06,+ 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0b, 0x12, 0x09, 0x2f, 0x76,+ 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x5f, 0x0a, 0x0a, 0x43, 0x72, 0x65, 0x61, 0x74,+ 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65,+ 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x1e, 0xda, 0x41, 0x04, 0x75, 0x73, 0x65,+ 0x72, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x11, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x22, 0x09, 0x2f,+ 0x76, 0x31, 0x2f, 0x75, 0x73, 0x65, 0x72, 0x73, 0x12, 0x79, 0x0a, 0x0a, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65, 0x72, 0x22, 0x38, 0xda, 0x41, 0x10, 0x75, 0x73,+ 0x65, 0x72, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3,+ 0xe4, 0x93, 0x02, 0x1f, 0x3a, 0x04, 0x75, 0x73, 0x65, 0x72, 0x32, 0x17, 0x2f, 0x76, 0x31, 0x2f,+ 0x7b, 0x75, 0x73, 0x65, 0x72, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73,+ 0x2f, 0x2a, 0x7d, 0x12, 0x67, 0x0a, 0x0a, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65,+ 0x72, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 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, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02,- 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c,- 0x6f, 0x67, 0x6f, 0x75, 0x74, 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,+ 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74, 0x79, 0x22, 0x21, 0xda, 0x41, 0x04, 0x6e, 0x61,+ 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x2a, 0x12, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e,+ 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6b, 0x0a, 0x0c,+ 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x12, 0x20, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c,+ 0x65, 0x74, 0x65, 0x55, 0x73, 0x65, 0x72, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x11,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x73, 0x65,+ 0x72, 0x22, 0x26, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x20, 0x3a, 0x01, 0x2a, 0x22, 0x1b, 0x2f, 0x76,+ 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x75, 0x73, 0x65, 0x72, 0x73, 0x2f, 0x2a, 0x7d,+ 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x12, 0x59, 0x0a, 0x05, 0x4c, 0x6f, 0x67,+ 0x69, 0x6e, 0x12, 0x19, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x4c, 0x6f, 0x67, 0x69, 0x6e, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x1a, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67, 0x69,+ 0x6e, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x19, 0x82, 0xd3, 0xe4, 0x93, 0x02,+ 0x13, 0x3a, 0x01, 0x2a, 0x22, 0x0e, 0x2f, 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c,+ 0x6f, 0x67, 0x69, 0x6e, 0x12, 0x58, 0x0a, 0x06, 0x4c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 0x12, 0x1a,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x6f, 0x67,+ 0x6f, 0x75, 0x74, 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, 0x1a, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x14, 0x3a, 0x01, 0x2a, 0x22, 0x0f, 0x2f,+ 0x76, 0x31, 0x2f, 0x61, 0x75, 0x74, 0x68, 0x2f, 0x6c, 0x6f, 0x67, 0x6f, 0x75, 0x74, 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 (@@ -441,33 +913,55 @@ func file_v1_auth_service_proto_rawDescGZIP() []byte {return file_v1_auth_service_proto_rawDescData}-var file_v1_auth_service_proto_enumTypes = make([]protoimpl.EnumInfo, 1)-var file_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 5)+var file_v1_auth_service_proto_enumTypes = make([]protoimpl.EnumInfo, 2)+var file_v1_auth_service_proto_msgTypes = make([]protoimpl.MessageInfo, 11)var file_v1_auth_service_proto_goTypes = []interface{}{- (UserRole)(0), // 0: bytebase.v1.UserRole- (*CreateUserRequest)(nil), // 1: bytebase.v1.CreateUserRequest- (*LoginRequest)(nil), // 2: bytebase.v1.LoginRequest- (*LoginResponse)(nil), // 3: bytebase.v1.LoginResponse- (*LogoutRequest)(nil), // 4: bytebase.v1.LogoutRequest- (*User)(nil), // 5: bytebase.v1.User- (State)(0), // 6: bytebase.v1.State- (*emptypb.Empty)(nil), // 7: google.protobuf.Empty+ (UserType)(0), // 0: bytebase.v1.UserType+ (UserRole)(0), // 1: bytebase.v1.UserRole+ (*GetUserRequest)(nil), // 2: bytebase.v1.GetUserRequest+ (*ListUsersRequest)(nil), // 3: bytebase.v1.ListUsersRequest+ (*ListUsersResponse)(nil), // 4: bytebase.v1.ListUsersResponse+ (*CreateUserRequest)(nil), // 5: bytebase.v1.CreateUserRequest+ (*UpdateUserRequest)(nil), // 6: bytebase.v1.UpdateUserRequest+ (*DeleteUserRequest)(nil), // 7: bytebase.v1.DeleteUserRequest+ (*UndeleteUserRequest)(nil), // 8: bytebase.v1.UndeleteUserRequest+ (*LoginRequest)(nil), // 9: bytebase.v1.LoginRequest+ (*LoginResponse)(nil), // 10: bytebase.v1.LoginResponse+ (*LogoutRequest)(nil), // 11: bytebase.v1.LogoutRequest+ (*User)(nil), // 12: bytebase.v1.User+ (*fieldmaskpb.FieldMask)(nil), // 13: google.protobuf.FieldMask+ (State)(0), // 14: bytebase.v1.State+ (*emptypb.Empty)(nil), // 15: google.protobuf.Empty}var file_v1_auth_service_proto_depIdxs = []int32{- 5, // 0: bytebase.v1.CreateUserRequest.user:type_name -> bytebase.v1.User- 6, // 1: bytebase.v1.User.state:type_name -> bytebase.v1.State- 0, // 2: bytebase.v1.User.user_role:type_name -> bytebase.v1.UserRole- 1, // 3: bytebase.v1.AuthService.CreateUser:input_type -> bytebase.v1.CreateUserRequest- 2, // 4: bytebase.v1.AuthService.Login:input_type -> bytebase.v1.LoginRequest- 4, // 5: bytebase.v1.AuthService.Logout:input_type -> bytebase.v1.LogoutRequest- 5, // 6: bytebase.v1.AuthService.CreateUser:output_type -> bytebase.v1.User- 3, // 7: bytebase.v1.AuthService.Login:output_type -> bytebase.v1.LoginResponse- 7, // 8: bytebase.v1.AuthService.Logout:output_type -> google.protobuf.Empty- 6, // [6:9] is the sub-list for method output_type- 3, // [3:6] is the sub-list for method input_type- 3, // [3:3] is the sub-list for extension type_name- 3, // [3:3] is the sub-list for extension extendee- 0, // [0:3] is the sub-list for field type_name+ 12, // 0: bytebase.v1.ListUsersResponse.users:type_name -> bytebase.v1.User+ 12, // 1: bytebase.v1.CreateUserRequest.user:type_name -> bytebase.v1.User+ 12, // 2: bytebase.v1.UpdateUserRequest.user:type_name -> bytebase.v1.User+ 13, // 3: bytebase.v1.UpdateUserRequest.update_mask:type_name -> google.protobuf.FieldMask+ 14, // 4: bytebase.v1.User.state:type_name -> bytebase.v1.State+ 0, // 5: bytebase.v1.User.user_type:type_name -> bytebase.v1.UserType+ 1, // 6: bytebase.v1.User.user_role:type_name -> bytebase.v1.UserRole+ 2, // 7: bytebase.v1.AuthService.GetUser:input_type -> bytebase.v1.GetUserRequest+ 3, // 8: bytebase.v1.AuthService.ListUsers:input_type -> bytebase.v1.ListUsersRequest+ 5, // 9: bytebase.v1.AuthService.CreateUser:input_type -> bytebase.v1.CreateUserRequest+ 6, // 10: bytebase.v1.AuthService.UpdateUser:input_type -> bytebase.v1.UpdateUserRequest+ 7, // 11: bytebase.v1.AuthService.DeleteUser:input_type -> bytebase.v1.DeleteUserRequest+ 8, // 12: bytebase.v1.AuthService.UndeleteUser:input_type -> bytebase.v1.UndeleteUserRequest+ 9, // 13: bytebase.v1.AuthService.Login:input_type -> bytebase.v1.LoginRequest+ 11, // 14: bytebase.v1.AuthService.Logout:input_type -> bytebase.v1.LogoutRequest+ 12, // 15: bytebase.v1.AuthService.GetUser:output_type -> bytebase.v1.User+ 4, // 16: bytebase.v1.AuthService.ListUsers:output_type -> bytebase.v1.ListUsersResponse+ 12, // 17: bytebase.v1.AuthService.CreateUser:output_type -> bytebase.v1.User+ 12, // 18: bytebase.v1.AuthService.UpdateUser:output_type -> bytebase.v1.User+ 15, // 19: bytebase.v1.AuthService.DeleteUser:output_type -> google.protobuf.Empty+ 12, // 20: bytebase.v1.AuthService.UndeleteUser:output_type -> bytebase.v1.User+ 10, // 21: bytebase.v1.AuthService.Login:output_type -> bytebase.v1.LoginResponse+ 15, // 22: bytebase.v1.AuthService.Logout:output_type -> google.protobuf.Empty+ 15, // [15:23] is the sub-list for method output_type+ 7, // [7:15] 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_auth_service_proto_init() }@@ -478,7 +972,7 @@ func file_v1_auth_service_proto_init() {file_v1_common_proto_init()if !protoimpl.UnsafeEnabled {file_v1_auth_service_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*CreateUserRequest); i {+ switch v := v.(*GetUserRequest); i {case 0:return &v.statecase 1:@@ -490,7 +984,7 @@ func file_v1_auth_service_proto_init() {}}file_v1_auth_service_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*LoginRequest); i {+ switch v := v.(*ListUsersRequest); i {case 0:return &v.statecase 1:@@ -502,7 +996,7 @@ func file_v1_auth_service_proto_init() {}}file_v1_auth_service_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*LoginResponse); i {+ switch v := v.(*ListUsersResponse); i {case 0:return &v.statecase 1:@@ -514,7 +1008,7 @@ func file_v1_auth_service_proto_init() {}}file_v1_auth_service_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*LogoutRequest); i {+ switch v := v.(*CreateUserRequest); i {case 0:return &v.statecase 1:@@ -526,6 +1020,78 @@ func file_v1_auth_service_proto_init() {}}file_v1_auth_service_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UpdateUserRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*DeleteUserRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*UndeleteUserRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*LoginRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[8].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*LoginResponse); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[9].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*LogoutRequest); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_v1_auth_service_proto_msgTypes[10].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*User); i {case 0:return &v.state@@ -543,8 +1109,8 @@ func file_v1_auth_service_proto_init() {File: protoimpl.DescBuilder{GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_v1_auth_service_proto_rawDesc,- NumEnums: 1,- NumMessages: 5,+ NumEnums: 2,+ NumMessages: 11,NumExtensions: 0,NumServices: 1,},diff --git a/proto/generated-go/v1/auth_service.pb.gw.go b/proto/generated-go/v1/auth_service.pb.gw.goindex be27c826c6..ebc0080301 100644--- a/proto/generated-go/v1/auth_service.pb.gw.go+++ b/proto/generated-go/v1/auth_service.pb.gw.go@@ -31,6 +31,94 @@ var _ = runtime.Stringvar _ = utilities.NewDoubleArrayvar _ = metadata.Join+func request_AuthService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq GetUserRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := client.GetUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_AuthService_GetUser_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq GetUserRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := server.GetUser(ctx, &protoReq)+ return msg, metadata, err++}++var (+ filter_AuthService_ListUsers_0 = &utilities.DoubleArray{Encoding: map[string]int{}, Base: []int(nil), Check: []int(nil)}+)++func request_AuthService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListUsersRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_ListUsers_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.ListUsers(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_AuthService_ListUsers_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq ListUsersRequest+ var metadata runtime.ServerMetadata++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_ListUsers_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.ListUsers(ctx, &protoReq)+ return msg, metadata, err++}+func request_AuthService_CreateUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {var protoReq CreateUserRequestvar metadata runtime.ServerMetadata@@ -65,6 +153,226 @@ func local_request_AuthService_CreateUser_0(ctx context.Context, marshaler runti}+var (+ filter_AuthService_UpdateUser_0 = &utilities.DoubleArray{Encoding: map[string]int{"user": 0, "name": 1}, Base: []int{1, 4, 5, 2, 0, 0, 0, 0}, Check: []int{0, 1, 1, 2, 4, 2, 2, 3}}+)++func request_AuthService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateUserRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.User); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["user.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "user.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_UpdateUser_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := client.UpdateUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_AuthService_UpdateUser_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UpdateUserRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq.User); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if protoReq.UpdateMask == nil || len(protoReq.UpdateMask.GetPaths()) == 0 {+ if fieldMask, err := runtime.FieldMaskFromRequestBody(newReader(), protoReq.User); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ } else {+ protoReq.UpdateMask = fieldMask+ }+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["user.name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "user.name")+ }++ err = runtime.PopulateFieldFromPath(&protoReq, "user.name", val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "user.name", err)+ }++ if err := req.ParseForm(); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }+ if err := runtime.PopulateQueryParameters(&protoReq, req.Form, filter_AuthService_UpdateUser_0); err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ msg, err := server.UpdateUser(ctx, &protoReq)+ return msg, metadata, err++}++func request_AuthService_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq DeleteUserRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := client.DeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_AuthService_DeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq DeleteUserRequest+ var metadata runtime.ServerMetadata++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := server.DeleteUser(ctx, &protoReq)+ return msg, metadata, err++}++func request_AuthService_UndeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UndeleteUserRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := client.UndeleteUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))+ return msg, metadata, err++}++func local_request_AuthService_UndeleteUser_0(ctx context.Context, marshaler runtime.Marshaler, server AuthServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {+ var protoReq UndeleteUserRequest+ var metadata runtime.ServerMetadata++ newReader, berr := utilities.IOReaderFactory(req.Body)+ if berr != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)+ }+ if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)+ }++ var (+ val string+ ok bool+ err error+ _ = err+ )++ val, ok = pathParams["name"]+ if !ok {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "name")+ }++ protoReq.Name, err = runtime.String(val)+ if err != nil {+ return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "name", err)+ }++ msg, err := server.UndeleteUser(ctx, &protoReq)+ return msg, metadata, err++}+func request_AuthService_Login_0(ctx context.Context, marshaler runtime.Marshaler, client AuthServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {var protoReq LoginRequestvar metadata runtime.ServerMetadata@@ -139,6 +447,56 @@ func local_request_AuthService_Logout_0(ctx context.Context, marshaler runtime.M// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterAuthServiceHandlerFromEndpoint instead.func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server AuthServiceServer) error {+ mux.Handle("GET", pattern_AuthService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuthService/GetUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_AuthService_GetUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("GET", pattern_AuthService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuthService/ListUsers", runtime.WithHTTPPathPattern("/v1/users"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_AuthService_ListUsers_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_AuthService_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -164,6 +522,81 @@ func RegisterAuthServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux})+ mux.Handle("PATCH", pattern_AuthService_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuthService/UpdateUser", runtime.WithHTTPPathPattern("/v1/{user.name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_AuthService_UpdateUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("DELETE", pattern_AuthService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuthService/DeleteUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_AuthService_DeleteUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_AuthService_UndeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ var stream runtime.ServerTransportStream+ ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/bytebase.v1.AuthService/UndeleteUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}:undelete"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := local_request_AuthService_UndeleteUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)+ md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_UndeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_AuthService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -255,6 +688,50 @@ func RegisterAuthServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn// "AuthServiceClient" to call the correct interceptors.func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client AuthServiceClient) error {+ mux.Handle("GET", pattern_AuthService_GetUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuthService/GetUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_AuthService_GetUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_GetUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("GET", pattern_AuthService_ListUsers_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuthService/ListUsers", runtime.WithHTTPPathPattern("/v1/users"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_AuthService_ListUsers_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_ListUsers_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_AuthService_CreateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -277,6 +754,72 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux})+ mux.Handle("PATCH", pattern_AuthService_UpdateUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuthService/UpdateUser", runtime.WithHTTPPathPattern("/v1/{user.name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_AuthService_UpdateUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_UpdateUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("DELETE", pattern_AuthService_DeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuthService/DeleteUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_AuthService_DeleteUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_DeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })++ mux.Handle("POST", pattern_AuthService_UndeleteUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {+ ctx, cancel := context.WithCancel(req.Context())+ defer cancel()+ inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)+ var err error+ var annotatedContext context.Context+ annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/bytebase.v1.AuthService/UndeleteUser", runtime.WithHTTPPathPattern("/v1/{name=users/*}:undelete"))+ if err != nil {+ runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)+ return+ }+ resp, md, err := request_AuthService_UndeleteUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)+ annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)+ if err != nil {+ runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)+ return+ }++ forward_AuthService_UndeleteUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)++ })+mux.Handle("POST", pattern_AuthService_Login_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {ctx, cancel := context.WithCancel(req.Context())defer cancel()@@ -325,16 +868,36 @@ func RegisterAuthServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux}var (+ pattern_AuthService_GetUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "users", "name"}, ""))++ pattern_AuthService_ListUsers_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, ""))+pattern_AuthService_CreateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"v1", "users"}, ""))+ pattern_AuthService_UpdateUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "users", "user.name"}, ""))++ pattern_AuthService_DeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "users", "name"}, ""))++ pattern_AuthService_UndeleteUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 1, 0, 4, 2, 5, 2}, []string{"v1", "users", "name"}, "undelete"))+pattern_AuthService_Login_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "login"}, ""))pattern_AuthService_Logout_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1, 2, 2}, []string{"v1", "auth", "logout"}, "")))var (+ forward_AuthService_GetUser_0 = runtime.ForwardResponseMessage++ forward_AuthService_ListUsers_0 = runtime.ForwardResponseMessage+forward_AuthService_CreateUser_0 = runtime.ForwardResponseMessage+ forward_AuthService_UpdateUser_0 = runtime.ForwardResponseMessage++ forward_AuthService_DeleteUser_0 = runtime.ForwardResponseMessage++ forward_AuthService_UndeleteUser_0 = runtime.ForwardResponseMessage+forward_AuthService_Login_0 = runtime.ForwardResponseMessageforward_AuthService_Logout_0 = runtime.ForwardResponseMessagediff --git a/proto/generated-go/v1/auth_service_grpc.pb.go b/proto/generated-go/v1/auth_service_grpc.pb.goindex 0cbb2a5c47..3adfcf9f66 100644--- a/proto/generated-go/v1/auth_service_grpc.pb.go+++ b/proto/generated-go/v1/auth_service_grpc.pb.go@@ -23,7 +23,12 @@ const _ = grpc.SupportPackageIsVersion7//// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.type AuthServiceClient interface {+ GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error)+ ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error)CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error)+ UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error)+ DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)+ UndeleteUser(ctx context.Context, in *UndeleteUserRequest, opts ...grpc.CallOption) (*User, error)Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error)Logout(ctx context.Context, in *LogoutRequest, opts ...grpc.CallOption) (*emptypb.Empty, error)}@@ -36,6 +41,24 @@ func NewAuthServiceClient(cc grpc.ClientConnInterface) AuthServiceClient {return &authServiceClient{cc}}+func (c *authServiceClient) GetUser(ctx context.Context, in *GetUserRequest, opts ...grpc.CallOption) (*User, error) {+ out := new(User)+ err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/GetUser", in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *authServiceClient) ListUsers(ctx context.Context, in *ListUsersRequest, opts ...grpc.CallOption) (*ListUsersResponse, error) {+ out := new(ListUsersResponse)+ err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/ListUsers", in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *authServiceClient) CreateUser(ctx context.Context, in *CreateUserRequest, opts ...grpc.CallOption) (*User, error) {out := new(User)err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/CreateUser", in, out, opts...)@@ -45,6 +68,33 @@ func (c *authServiceClient) CreateUser(ctx context.Context, in *CreateUserRequesreturn out, nil}+func (c *authServiceClient) UpdateUser(ctx context.Context, in *UpdateUserRequest, opts ...grpc.CallOption) (*User, error) {+ out := new(User)+ err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/UpdateUser", in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *authServiceClient) DeleteUser(ctx context.Context, in *DeleteUserRequest, opts ...grpc.CallOption) (*emptypb.Empty, error) {+ out := new(emptypb.Empty)+ err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/DeleteUser", in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}++func (c *authServiceClient) UndeleteUser(ctx context.Context, in *UndeleteUserRequest, opts ...grpc.CallOption) (*User, error) {+ out := new(User)+ err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/UndeleteUser", in, out, opts...)+ if err != nil {+ return nil, err+ }+ return out, nil+}+func (c *authServiceClient) Login(ctx context.Context, in *LoginRequest, opts ...grpc.CallOption) (*LoginResponse, error) {out := new(LoginResponse)err := c.cc.Invoke(ctx, "/bytebase.v1.AuthService/Login", in, out, opts...)@@ -67,7 +117,12 @@ func (c *authServiceClient) Logout(ctx context.Context, in *LogoutRequest, opts// All implementations must embed UnimplementedAuthServiceServer// for forward compatibilitytype AuthServiceServer interface {+ GetUser(context.Context, *GetUserRequest) (*User, error)+ ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error)CreateUser(context.Context, *CreateUserRequest) (*User, error)+ UpdateUser(context.Context, *UpdateUserRequest) (*User, error)+ DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error)+ UndeleteUser(context.Context, *UndeleteUserRequest) (*User, error)Login(context.Context, *LoginRequest) (*LoginResponse, error)Logout(context.Context, *LogoutRequest) (*emptypb.Empty, error)mustEmbedUnimplementedAuthServiceServer()@@ -77,9 +132,24 @@ type AuthServiceServer interface {type UnimplementedAuthServiceServer struct {}+func (UnimplementedAuthServiceServer) GetUser(context.Context, *GetUserRequest) (*User, error) {+ return nil, status.Errorf(codes.Unimplemented, "method GetUser not implemented")+}+func (UnimplementedAuthServiceServer) ListUsers(context.Context, *ListUsersRequest) (*ListUsersResponse, error) {+ return nil, status.Errorf(codes.Unimplemented, "method ListUsers not implemented")+}func (UnimplementedAuthServiceServer) CreateUser(context.Context, *CreateUserRequest) (*User, error) {return nil, status.Errorf(codes.Unimplemented, "method CreateUser not implemented")}+func (UnimplementedAuthServiceServer) UpdateUser(context.Context, *UpdateUserRequest) (*User, error) {+ return nil, status.Errorf(codes.Unimplemented, "method UpdateUser not implemented")+}+func (UnimplementedAuthServiceServer) DeleteUser(context.Context, *DeleteUserRequest) (*emptypb.Empty, error) {+ return nil, status.Errorf(codes.Unimplemented, "method DeleteUser not implemented")+}+func (UnimplementedAuthServiceServer) UndeleteUser(context.Context, *UndeleteUserRequest) (*User, error) {+ return nil, status.Errorf(codes.Unimplemented, "method UndeleteUser not implemented")+}func (UnimplementedAuthServiceServer) Login(context.Context, *LoginRequest) (*LoginResponse, error) {return nil, status.Errorf(codes.Unimplemented, "method Login not implemented")}@@ -99,6 +169,42 @@ func RegisterAuthServiceServer(s grpc.ServiceRegistrar, srv AuthServiceServer) {s.RegisterService(&AuthService_ServiceDesc, srv)}+func _AuthService_GetUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(GetUserRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(AuthServiceServer).GetUser(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: "/bytebase.v1.AuthService/GetUser",+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(AuthServiceServer).GetUser(ctx, req.(*GetUserRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _AuthService_ListUsers_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(ListUsersRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(AuthServiceServer).ListUsers(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: "/bytebase.v1.AuthService/ListUsers",+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(AuthServiceServer).ListUsers(ctx, req.(*ListUsersRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _AuthService_CreateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(CreateUserRequest)if err := dec(in); err != nil {@@ -117,6 +223,60 @@ func _AuthService_CreateUser_Handler(srv interface{}, ctx context.Context, dec freturn interceptor(ctx, in, info, handler)}+func _AuthService_UpdateUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UpdateUserRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(AuthServiceServer).UpdateUser(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: "/bytebase.v1.AuthService/UpdateUser",+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(AuthServiceServer).UpdateUser(ctx, req.(*UpdateUserRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _AuthService_DeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(DeleteUserRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(AuthServiceServer).DeleteUser(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: "/bytebase.v1.AuthService/DeleteUser",+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(AuthServiceServer).DeleteUser(ctx, req.(*DeleteUserRequest))+ }+ return interceptor(ctx, in, info, handler)+}++func _AuthService_UndeleteUser_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {+ in := new(UndeleteUserRequest)+ if err := dec(in); err != nil {+ return nil, err+ }+ if interceptor == nil {+ return srv.(AuthServiceServer).UndeleteUser(ctx, in)+ }+ info := &grpc.UnaryServerInfo{+ Server: srv,+ FullMethod: "/bytebase.v1.AuthService/UndeleteUser",+ }+ handler := func(ctx context.Context, req interface{}) (interface{}, error) {+ return srv.(AuthServiceServer).UndeleteUser(ctx, req.(*UndeleteUserRequest))+ }+ return interceptor(ctx, in, info, handler)+}+func _AuthService_Login_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {in := new(LoginRequest)if err := dec(in); err != nil {@@ -160,10 +320,30 @@ var AuthService_ServiceDesc = grpc.ServiceDesc{ServiceName: "bytebase.v1.AuthService",HandlerType: (*AuthServiceServer)(nil),Methods: []grpc.MethodDesc{+ {+ MethodName: "GetUser",+ Handler: _AuthService_GetUser_Handler,+ },+ {+ MethodName: "ListUsers",+ Handler: _AuthService_ListUsers_Handler,+ },{MethodName: "CreateUser",Handler: _AuthService_CreateUser_Handler,},+ {+ MethodName: "UpdateUser",+ Handler: _AuthService_UpdateUser_Handler,+ },+ {+ MethodName: "DeleteUser",+ Handler: _AuthService_DeleteUser_Handler,+ },+ {+ MethodName: "UndeleteUser",+ Handler: _AuthService_UndeleteUser_Handler,+ },{MethodName: "Login",Handler: _AuthService_Login_Handler,diff --git a/proto/generated-go/v1/common.pb.go b/proto/generated-go/v1/common.pb.goindex 55fc162f4b..10094bf271 100644--- a/proto/generated-go/v1/common.pb.go+++ b/proto/generated-go/v1/common.pb.go@@ -24,21 +24,21 @@ type State int32const (State_STATE_UNSPECIFIED State = 0- State_STATE_ACTIVE State = 1- State_STATE_DELETED State = 2+ State_ACTIVE State = 1+ State_DELETED State = 2)// Enum value maps for State.var (State_name = map[int32]string{0: "STATE_UNSPECIFIED",- 1: "STATE_ACTIVE",- 2: "STATE_DELETED",+ 1: "ACTIVE",+ 2: "DELETED",}State_value = map[string]int32{"STATE_UNSPECIFIED": 0,- "STATE_ACTIVE": 1,- "STATE_DELETED": 2,+ "ACTIVE": 1,+ "DELETED": 2,})@@ -73,13 +73,13 @@ var File_v1_common_proto protoreflect.FileDescriptorvar file_v1_common_proto_rawDesc = []byte{0x0a, 0x0f, 0x76, 0x31, 0x2f, 0x63, 0x6f, 0x6d, 0x6d, 0x6f, 0x6e, 0x2e, 0x70, 0x72, 0x6f, 0x74,- 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2a, 0x43,+ 0x6f, 0x12, 0x0b, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2a, 0x37,0x0a, 0x05, 0x53, 0x74, 0x61, 0x74, 0x65, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x54, 0x41, 0x54, 0x45,- 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x10,- 0x0a, 0x0c, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01,- 0x12, 0x11, 0x0a, 0x0d, 0x53, 0x54, 0x41, 0x54, 0x45, 0x5f, 0x44, 0x45, 0x4c, 0x45, 0x54, 0x45,- 0x44, 0x10, 0x02, 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,+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a,+ 0x0a, 0x06, 0x41, 0x43, 0x54, 0x49, 0x56, 0x45, 0x10, 0x01, 0x12, 0x0b, 0x0a, 0x07, 0x44, 0x45,+ 0x4c, 0x45, 0x54, 0x45, 0x44, 0x10, 0x02, 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 (diff --git a/proto/generated-go/v1/instance_service.pb.go b/proto/generated-go/v1/instance_service.pb.goindex 34afd14416..01b890e060 100644--- a/proto/generated-go/v1/instance_service.pb.go+++ b/proto/generated-go/v1/instance_service.pb.go@@ -27,36 +27,36 @@ type Engine int32const (Engine_ENGINE_UNSPECIFIED Engine = 0- Engine_ENGINE_CLICKHOUSE Engine = 1- Engine_ENGINE_MYSQL Engine = 2- Engine_ENGINE_POSTGRES Engine = 3- Engine_ENGINE_SNOWFLAKE Engine = 4- Engine_ENGINE_SQLITE Engine = 5- Engine_ENGINE_TIDB Engine = 6- Engine_ENGINE_MONGODB Engine = 7+ Engine_CLICKHOUSE Engine = 1+ Engine_MYSQL Engine = 2+ Engine_POSTGRES Engine = 3+ Engine_SNOWFLAKE Engine = 4+ Engine_SQLITE Engine = 5+ Engine_TIDB Engine = 6+ Engine_MONGODB Engine = 7)// Enum value maps for Engine.var (Engine_name = map[int32]string{0: "ENGINE_UNSPECIFIED",- 1: "ENGINE_CLICKHOUSE",- 2: "ENGINE_MYSQL",- 3: "ENGINE_POSTGRES",- 4: "ENGINE_SNOWFLAKE",- 5: "ENGINE_SQLITE",- 6: "ENGINE_TIDB",- 7: "ENGINE_MONGODB",+ 1: "CLICKHOUSE",+ 2: "MYSQL",+ 3: "POSTGRES",+ 4: "SNOWFLAKE",+ 5: "SQLITE",+ 6: "TIDB",+ 7: "MONGODB",}Engine_value = map[string]int32{"ENGINE_UNSPECIFIED": 0,- "ENGINE_CLICKHOUSE": 1,- "ENGINE_MYSQL": 2,- "ENGINE_POSTGRES": 3,- "ENGINE_SNOWFLAKE": 4,- "ENGINE_SQLITE": 5,- "ENGINE_TIDB": 6,- "ENGINE_MONGODB": 7,+ "CLICKHOUSE": 1,+ "MYSQL": 2,+ "POSTGRES": 3,+ "SNOWFLAKE": 4,+ "SQLITE": 5,+ "TIDB": 6,+ "MONGODB": 7,})@@ -91,21 +91,21 @@ type DataSourceType int32const (DataSourceType_DATA_SOURCE_UNSPECIFIED DataSourceType = 0- DataSourceType_DATA_SOURCE_ADMIN DataSourceType = 1- DataSourceType_DATA_SOURCE_RO DataSourceType = 2+ DataSourceType_ADMIN DataSourceType = 1+ DataSourceType_READ_ONLY DataSourceType = 2)// Enum value maps for DataSourceType.var (DataSourceType_name = map[int32]string{0: "DATA_SOURCE_UNSPECIFIED",- 1: "DATA_SOURCE_ADMIN",- 2: "DATA_SOURCE_RO",+ 1: "ADMIN",+ 2: "READ_ONLY",}DataSourceType_value = map[string]int32{"DATA_SOURCE_UNSPECIFIED": 0,- "DATA_SOURCE_ADMIN": 1,- "DATA_SOURCE_RO": 2,+ "ADMIN": 1,+ "READ_ONLY": 2,})@@ -858,81 +858,76 @@ var file_v1_instance_service_proto_rawDesc = []byte{0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x68, 0x6f, 0x73, 0x74, 0x12, 0x12, 0x0a, 0x04, 0x70, 0x6f,0x72, 0x74, 0x18, 0x09, 0x20, 0x01, 0x28, 0x09, 0x52, 0x04, 0x70, 0x6f, 0x72, 0x74, 0x12, 0x1a,0x0a, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x18, 0x0a, 0x20, 0x01, 0x28, 0x09,- 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2a, 0xac, 0x01, 0x0a, 0x06, 0x45,- 0x6e, 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f,- 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a,- 0x11, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x43, 0x4c, 0x49, 0x43, 0x4b, 0x48, 0x4f, 0x55,- 0x53, 0x45, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x4d,- 0x59, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x13, 0x0a, 0x0f, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45,- 0x5f, 0x50, 0x4f, 0x53, 0x54, 0x47, 0x52, 0x45, 0x53, 0x10, 0x03, 0x12, 0x14, 0x0a, 0x10, 0x45,- 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x4e, 0x4f, 0x57, 0x46, 0x4c, 0x41, 0x4b, 0x45, 0x10,- 0x04, 0x12, 0x11, 0x0a, 0x0d, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x53, 0x51, 0x4c, 0x49,- 0x54, 0x45, 0x10, 0x05, 0x12, 0x0f, 0x0a, 0x0b, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x54,- 0x49, 0x44, 0x42, 0x10, 0x06, 0x12, 0x12, 0x0a, 0x0e, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f,- 0x4d, 0x4f, 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x10, 0x07, 0x2a, 0x58, 0x0a, 0x0e, 0x44, 0x61, 0x74,- 0x61, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x44,- 0x41, 0x54, 0x41, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45,- 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x44, 0x41, 0x54, 0x41,- 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10, 0x01, 0x12,- 0x12, 0x0a, 0x0e, 0x44, 0x41, 0x54, 0x41, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x52,- 0x4f, 0x10, 0x02, 0x32, 0xf1, 0x06, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,- 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e,- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,- 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,- 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x34,- 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f,- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e,- 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73,- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x52, 0x08, 0x64, 0x61, 0x74, 0x61, 0x62, 0x61, 0x73, 0x65, 0x2a, 0x7b, 0x0a, 0x06, 0x45, 0x6e,+ 0x67, 0x69, 0x6e, 0x65, 0x12, 0x16, 0x0a, 0x12, 0x45, 0x4e, 0x47, 0x49, 0x4e, 0x45, 0x5f, 0x55,+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0e, 0x0a, 0x0a,+ 0x43, 0x4c, 0x49, 0x43, 0x4b, 0x48, 0x4f, 0x55, 0x53, 0x45, 0x10, 0x01, 0x12, 0x09, 0x0a, 0x05,+ 0x4d, 0x59, 0x53, 0x51, 0x4c, 0x10, 0x02, 0x12, 0x0c, 0x0a, 0x08, 0x50, 0x4f, 0x53, 0x54, 0x47,+ 0x52, 0x45, 0x53, 0x10, 0x03, 0x12, 0x0d, 0x0a, 0x09, 0x53, 0x4e, 0x4f, 0x57, 0x46, 0x4c, 0x41,+ 0x4b, 0x45, 0x10, 0x04, 0x12, 0x0a, 0x0a, 0x06, 0x53, 0x51, 0x4c, 0x49, 0x54, 0x45, 0x10, 0x05,+ 0x12, 0x08, 0x0a, 0x04, 0x54, 0x49, 0x44, 0x42, 0x10, 0x06, 0x12, 0x0b, 0x0a, 0x07, 0x4d, 0x4f,+ 0x4e, 0x47, 0x4f, 0x44, 0x42, 0x10, 0x07, 0x2a, 0x47, 0x0a, 0x0e, 0x44, 0x61, 0x74, 0x61, 0x53,+ 0x6f, 0x75, 0x72, 0x63, 0x65, 0x54, 0x79, 0x70, 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x44, 0x41, 0x54,+ 0x41, 0x5f, 0x53, 0x4f, 0x55, 0x52, 0x43, 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49,+ 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05, 0x41, 0x44, 0x4d, 0x49, 0x4e, 0x10,+ 0x01, 0x12, 0x0d, 0x0a, 0x09, 0x52, 0x45, 0x41, 0x44, 0x5f, 0x4f, 0x4e, 0x4c, 0x59, 0x10, 0x02,+ 0x32, 0xf1, 0x06, 0x0a, 0x0f, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x53, 0x65, 0x72,+ 0x76, 0x69, 0x63, 0x65, 0x12, 0x7b, 0x0a, 0x0b, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61,+ 0x6e, 0x63, 0x65, 0x12, 0x1f, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x47, 0x65, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71,+ 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x34, 0xda, 0x41, 0x04,+ 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31, 0x2f,+ 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e,+ 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a,+ 0x7d, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e,+ 0x63, 0x65, 0x73, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,+ 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52,+ 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,- 0x65, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x49, 0x6e, 0x73, 0x74,- 0x61, 0x6e, 0x63, 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda,- 0x41, 0x06, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25,- 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69,- 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x6e, 0x73, 0x74,- 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65,- 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73,- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62,- 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61,- 0x6e, 0x63, 0x65, 0x22, 0x49, 0xda, 0x41, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69,- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x08, 0x69,- 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61,- 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74,- 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0xa4,- 0x01, 0x0a, 0x0e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,- 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,- 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65,- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x57, 0xda, 0x41,- 0x14, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65,- 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x08, 0x69, 0x6e, 0x73,- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x32, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x73, 0x74,- 0x61, 0x6e, 0x63, 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f,- 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,- 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65,- 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73,- 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67,- 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45,- 0x6d, 0x70, 0x74, 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,- 0x93, 0x02, 0x27, 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65,- 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e,- 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x10, 0x55,- 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12,- 0x24, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e,- 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65,- 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,- 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x39, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61,- 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f,- 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75,- 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72,- 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74,- 0x6f, 0x33,+ 0x65, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x36, 0xda, 0x41, 0x06, 0x70,+ 0x61, 0x72, 0x65, 0x6e, 0x74, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27, 0x12, 0x25, 0x2f, 0x76, 0x31,+ 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e,+ 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,+ 0x65, 0x73, 0x12, 0x96, 0x01, 0x0a, 0x0e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73,+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e,+ 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65,+ 0x22, 0x49, 0xda, 0x41, 0x0f, 0x70, 0x61, 0x72, 0x65, 0x6e, 0x74, 0x2c, 0x69, 0x6e, 0x73, 0x74,+ 0x61, 0x6e, 0x63, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x31, 0x3a, 0x08, 0x69, 0x6e, 0x73, 0x74,+ 0x61, 0x6e, 0x63, 0x65, 0x22, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x61, 0x72, 0x65, 0x6e,+ 0x74, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a,+ 0x7d, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x12, 0xa4, 0x01, 0x0a, 0x0e,+ 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x22,+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64,+ 0x61, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x57, 0xda, 0x41, 0x14, 0x69, 0x6e,+ 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61,+ 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x3a, 0x3a, 0x08, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e,+ 0x63, 0x65, 0x32, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63,+ 0x65, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65,+ 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f,+ 0x2a, 0x7d, 0x12, 0x82, 0x01, 0x0a, 0x0e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73,+ 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x22, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65,+ 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e,+ 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x16, 0x2e, 0x67, 0x6f, 0x6f, 0x67,+ 0x6c, 0x65, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x62, 0x75, 0x66, 0x2e, 0x45, 0x6d, 0x70, 0x74,+ 0x79, 0x22, 0x34, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x27,+ 0x2a, 0x25, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x65, 0x6e, 0x76, 0x69,+ 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69, 0x6e, 0x73, 0x74, 0x61,+ 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x8a, 0x01, 0x0a, 0x10, 0x55, 0x6e, 0x64, 0x65,+ 0x6c, 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x12, 0x24, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c,+ 0x65, 0x74, 0x65, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x15, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x49, 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x22, 0x39, 0x82, 0xd3, 0xe4, 0x93, 0x02,+ 0x33, 0x3a, 0x01, 0x2a, 0x22, 0x2e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d,+ 0x65, 0x6e, 0x76, 0x69, 0x72, 0x6f, 0x6e, 0x6d, 0x65, 0x6e, 0x74, 0x73, 0x2f, 0x2a, 0x2f, 0x69,+ 0x6e, 0x73, 0x74, 0x61, 0x6e, 0x63, 0x65, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65,+ 0x6c, 0x65, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65,+ 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}var (diff --git a/proto/generated-go/v1/project_service.pb.go b/proto/generated-go/v1/project_service.pb.goindex 3de3b8447f..93b86e5eab 100644--- a/proto/generated-go/v1/project_service.pb.go+++ b/proto/generated-go/v1/project_service.pb.go@@ -27,21 +27,21 @@ type Workflow int32const (Workflow_WORKFLOW_UNSPECIFIED Workflow = 0- Workflow_WORKFLOW_UI Workflow = 1- Workflow_WORKFLOW_VCS Workflow = 2+ Workflow_UI Workflow = 1+ Workflow_VCS Workflow = 2)// Enum value maps for Workflow.var (Workflow_name = map[int32]string{0: "WORKFLOW_UNSPECIFIED",- 1: "WORKFLOW_UI",- 2: "WORKFLOW_VCS",+ 1: "UI",+ 2: "VCS",}Workflow_value = map[string]int32{"WORKFLOW_UNSPECIFIED": 0,- "WORKFLOW_UI": 1,- "WORKFLOW_VCS": 2,+ "UI": 1,+ "VCS": 2,})@@ -173,25 +173,25 @@ func (TenantMode) EnumDescriptor() ([]byte, []int) {type RoleProvider int32const (- RoleProvider_ROLE_PROVIDER_UNSPECIFIED RoleProvider = 0- RoleProvider_ROLE_PROVIDER_BYTEBASE RoleProvider = 1- RoleProvider_ROLE_PROVIDER_GITLAB_SELF_HOST RoleProvider = 2- RoleProvider_ROLE_PROVIDER_GITHUB_COM RoleProvider = 3+ RoleProvider_ROLE_PROVIDER_UNSPECIFIED RoleProvider = 0+ RoleProvider_BYTEBASE RoleProvider = 1+ RoleProvider_GITLAB_SELF_HOST RoleProvider = 2+ RoleProvider_GITHUB_COM RoleProvider = 3)// Enum value maps for RoleProvider.var (RoleProvider_name = map[int32]string{0: "ROLE_PROVIDER_UNSPECIFIED",- 1: "ROLE_PROVIDER_BYTEBASE",- 2: "ROLE_PROVIDER_GITLAB_SELF_HOST",- 3: "ROLE_PROVIDER_GITHUB_COM",+ 1: "BYTEBASE",+ 2: "GITLAB_SELF_HOST",+ 3: "GITHUB_COM",}RoleProvider_value = map[string]int32{- "ROLE_PROVIDER_UNSPECIFIED": 0,- "ROLE_PROVIDER_BYTEBASE": 1,- "ROLE_PROVIDER_GITLAB_SELF_HOST": 2,- "ROLE_PROVIDER_GITHUB_COM": 3,+ "ROLE_PROVIDER_UNSPECIFIED": 0,+ "BYTEBASE": 1,+ "GITLAB_SELF_HOST": 2,+ "GITHUB_COM": 3,})@@ -226,21 +226,21 @@ type SchemaVersion int32const (SchemaVersion_SCHEMA_VERSION_UNSPECIFIED SchemaVersion = 0- SchemaVersion_SCHEMA_VERSION_TIMESTAMP SchemaVersion = 1- SchemaVersion_SCHEMA_VERSION_SEMANTIC SchemaVersion = 2+ SchemaVersion_TIMESTAMP SchemaVersion = 1+ SchemaVersion_SEMANTIC SchemaVersion = 2)// Enum value maps for SchemaVersion.var (SchemaVersion_name = map[int32]string{0: "SCHEMA_VERSION_UNSPECIFIED",- 1: "SCHEMA_VERSION_TIMESTAMP",- 2: "SCHEMA_VERSION_SEMANTIC",+ 1: "TIMESTAMP",+ 2: "SEMANTIC",}SchemaVersion_value = map[string]int32{"SCHEMA_VERSION_UNSPECIFIED": 0,- "SCHEMA_VERSION_TIMESTAMP": 1,- "SCHEMA_VERSION_SEMANTIC": 2,+ "TIMESTAMP": 1,+ "SEMANTIC": 2,})@@ -275,21 +275,21 @@ type SchemaChange int32const (SchemaChange_SCHEMA_CHANGE_UNSPECIFIED SchemaChange = 0- SchemaChange_SCHEMA_CHANGE_DDL SchemaChange = 1- SchemaChange_SCHEMA_CHANGE_SDL SchemaChange = 2+ SchemaChange_DDL SchemaChange = 1+ SchemaChange_SDL SchemaChange = 2)// Enum value maps for SchemaChange.var (SchemaChange_name = map[int32]string{0: "SCHEMA_CHANGE_UNSPECIFIED",- 1: "SCHEMA_CHANGE_DDL",- 2: "SCHEMA_CHANGE_SDL",+ 1: "DDL",+ 2: "SDL",}SchemaChange_value = map[string]int32{"SCHEMA_CHANGE_UNSPECIFIED": 0,- "SCHEMA_CHANGE_DDL": 1,- "SCHEMA_CHANGE_SDL": 2,+ "DDL": 1,+ "SDL": 2,})@@ -999,99 +999,91 @@ var file_v1_project_service_proto_rawDesc = []byte{0x74, 0x6d, 0x5f, 0x63, 0x68, 0x65, 0x63, 0x6b, 0x18, 0x0c, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x16,0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x67, 0x74,0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x52, 0x09, 0x6c, 0x67, 0x74, 0x6d, 0x43, 0x68, 0x65, 0x63,- 0x6b, 0x2a, 0x47, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x0a,+ 0x6b, 0x2a, 0x35, 0x0a, 0x08, 0x57, 0x6f, 0x72, 0x6b, 0x66, 0x6c, 0x6f, 0x77, 0x12, 0x18, 0x0a,0x14, 0x57, 0x4f, 0x52, 0x4b, 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43,- 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0f, 0x0a, 0x0b, 0x57, 0x4f, 0x52, 0x4b, 0x46,- 0x4c, 0x4f, 0x57, 0x5f, 0x55, 0x49, 0x10, 0x01, 0x12, 0x10, 0x0a, 0x0c, 0x57, 0x4f, 0x52, 0x4b,- 0x46, 0x4c, 0x4f, 0x57, 0x5f, 0x56, 0x43, 0x53, 0x10, 0x02, 0x2a, 0x57, 0x0a, 0x0a, 0x56, 0x69,- 0x73, 0x69, 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49,- 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49,- 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49,- 0x54, 0x59, 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56,- 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54,- 0x45, 0x10, 0x02, 0x2a, 0x5c, 0x0a, 0x0a, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4d, 0x6f, 0x64,- 0x65, 0x12, 0x1b, 0x0a, 0x17, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45,- 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18,- 0x0a, 0x14, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x49,- 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x4e, 0x41,- 0x4e, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10,- 0x02, 0x2a, 0x8b, 0x01, 0x0a, 0x0c, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64,- 0x65, 0x72, 0x12, 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49,- 0x44, 0x45, 0x52, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,- 0x00, 0x12, 0x1a, 0x0a, 0x16, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44,- 0x45, 0x52, 0x5f, 0x42, 0x59, 0x54, 0x45, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x22, 0x0a,- 0x1e, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52, 0x5f, 0x47,- 0x49, 0x54, 0x4c, 0x41, 0x42, 0x5f, 0x53, 0x45, 0x4c, 0x46, 0x5f, 0x48, 0x4f, 0x53, 0x54, 0x10,- 0x02, 0x12, 0x1c, 0x0a, 0x18, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44,- 0x45, 0x52, 0x5f, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x5f, 0x43, 0x4f, 0x4d, 0x10, 0x03, 0x2a,- 0x6a, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73, 0x69, 0x6f, 0x6e,- 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49,- 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00,- 0x12, 0x1c, 0x0a, 0x18, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49,- 0x4f, 0x4e, 0x5f, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50, 0x10, 0x01, 0x12, 0x1b,- 0x0a, 0x17, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x56, 0x45, 0x52, 0x53, 0x49, 0x4f, 0x4e,- 0x5f, 0x53, 0x45, 0x4d, 0x41, 0x4e, 0x54, 0x49, 0x43, 0x10, 0x02, 0x2a, 0x5b, 0x0a, 0x0c, 0x53,- 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x12, 0x1d, 0x0a, 0x19, 0x53,- 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x55, 0x4e, 0x53,- 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x43,- 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47, 0x45, 0x5f, 0x44, 0x44, 0x4c, 0x10,- 0x01, 0x12, 0x15, 0x0a, 0x11, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x43, 0x48, 0x41, 0x4e,- 0x47, 0x45, 0x5f, 0x53, 0x44, 0x4c, 0x10, 0x02, 0x2a, 0x7d, 0x0a, 0x09, 0x4c, 0x67, 0x74, 0x6d,- 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a, 0x0a, 0x16, 0x4c, 0x47, 0x54, 0x4d, 0x5f, 0x43, 0x48,- 0x45, 0x43, 0x4b, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10,- 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4c, 0x47, 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f,- 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x47,- 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54,- 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10, 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4c, 0x47, 0x54, 0x4d,- 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d,- 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x03, 0x32, 0xd0, 0x05, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a,- 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76, 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x0a, 0x47, 0x65,- 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,- 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,- 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x24,- 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f,- 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6c, 0x0a, 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a,- 0x65, 0x63, 0x74, 0x73, 0x12, 0x20, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e, 0x73, 0x65, 0x22, 0x17, 0xda, 0x41, 0x00, 0x82, 0xd3,- 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63,- 0x74, 0x73, 0x12, 0x6a, 0x0a, 0x0d, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a,- 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,- 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52,- 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,- 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x20, 0xda, 0x41,- 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x8e,- 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55,- 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75,- 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76,- 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x44, 0xda, 0x41, 0x13, 0x70, 0x72,- 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x75, 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73,- 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28, 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x32, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x6e,- 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12,- 0x70, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,- 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44,- 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 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, 0x24, 0xda, 0x41, 0x04,- 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x2a, 0x15, 0x2f, 0x76, 0x31, 0x2f,- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,- 0x7d, 0x12, 0x77, 0x0a, 0x0f, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f,- 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,- 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65,- 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65,- 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22,- 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23, 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f,- 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a,- 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65,- 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70,- 0x72, 0x6f, 0x74, 0x6f, 0x33,+ 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x06, 0x0a, 0x02, 0x55, 0x49, 0x10, 0x01, 0x12,+ 0x07, 0x0a, 0x03, 0x56, 0x43, 0x53, 0x10, 0x02, 0x2a, 0x57, 0x0a, 0x0a, 0x56, 0x69, 0x73, 0x69,+ 0x62, 0x69, 0x6c, 0x69, 0x74, 0x79, 0x12, 0x1a, 0x0a, 0x16, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49,+ 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44,+ 0x10, 0x00, 0x12, 0x15, 0x0a, 0x11, 0x56, 0x49, 0x53, 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59,+ 0x5f, 0x50, 0x55, 0x42, 0x4c, 0x49, 0x43, 0x10, 0x01, 0x12, 0x16, 0x0a, 0x12, 0x56, 0x49, 0x53,+ 0x49, 0x42, 0x49, 0x4c, 0x49, 0x54, 0x59, 0x5f, 0x50, 0x52, 0x49, 0x56, 0x41, 0x54, 0x45, 0x10,+ 0x02, 0x2a, 0x5c, 0x0a, 0x0a, 0x54, 0x65, 0x6e, 0x61, 0x6e, 0x74, 0x4d, 0x6f, 0x64, 0x65, 0x12,+ 0x1b, 0x0a, 0x17, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x55,+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x18, 0x0a, 0x14,+ 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x54, 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x44, 0x49, 0x53, 0x41,+ 0x42, 0x4c, 0x45, 0x44, 0x10, 0x01, 0x12, 0x17, 0x0a, 0x13, 0x54, 0x45, 0x4e, 0x41, 0x4e, 0x54,+ 0x5f, 0x4d, 0x4f, 0x44, 0x45, 0x5f, 0x45, 0x4e, 0x41, 0x42, 0x4c, 0x45, 0x44, 0x10, 0x02, 0x2a,+ 0x61, 0x0a, 0x0c, 0x52, 0x6f, 0x6c, 0x65, 0x50, 0x72, 0x6f, 0x76, 0x69, 0x64, 0x65, 0x72, 0x12,+ 0x1d, 0x0a, 0x19, 0x52, 0x4f, 0x4c, 0x45, 0x5f, 0x50, 0x52, 0x4f, 0x56, 0x49, 0x44, 0x45, 0x52,+ 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0c,+ 0x0a, 0x08, 0x42, 0x59, 0x54, 0x45, 0x42, 0x41, 0x53, 0x45, 0x10, 0x01, 0x12, 0x14, 0x0a, 0x10,+ 0x47, 0x49, 0x54, 0x4c, 0x41, 0x42, 0x5f, 0x53, 0x45, 0x4c, 0x46, 0x5f, 0x48, 0x4f, 0x53, 0x54,+ 0x10, 0x02, 0x12, 0x0e, 0x0a, 0x0a, 0x47, 0x49, 0x54, 0x48, 0x55, 0x42, 0x5f, 0x43, 0x4f, 0x4d,+ 0x10, 0x03, 0x2a, 0x4c, 0x0a, 0x0d, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x56, 0x65, 0x72, 0x73,+ 0x69, 0x6f, 0x6e, 0x12, 0x1e, 0x0a, 0x1a, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x56, 0x45,+ 0x52, 0x53, 0x49, 0x4f, 0x4e, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45,+ 0x44, 0x10, 0x00, 0x12, 0x0d, 0x0a, 0x09, 0x54, 0x49, 0x4d, 0x45, 0x53, 0x54, 0x41, 0x4d, 0x50,+ 0x10, 0x01, 0x12, 0x0c, 0x0a, 0x08, 0x53, 0x45, 0x4d, 0x41, 0x4e, 0x54, 0x49, 0x43, 0x10, 0x02,+ 0x2a, 0x3f, 0x0a, 0x0c, 0x53, 0x63, 0x68, 0x65, 0x6d, 0x61, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,+ 0x12, 0x1d, 0x0a, 0x19, 0x53, 0x43, 0x48, 0x45, 0x4d, 0x41, 0x5f, 0x43, 0x48, 0x41, 0x4e, 0x47,+ 0x45, 0x5f, 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12,+ 0x07, 0x0a, 0x03, 0x44, 0x44, 0x4c, 0x10, 0x01, 0x12, 0x07, 0x0a, 0x03, 0x53, 0x44, 0x4c, 0x10,+ 0x02, 0x2a, 0x7d, 0x0a, 0x09, 0x4c, 0x67, 0x74, 0x6d, 0x43, 0x68, 0x65, 0x63, 0x6b, 0x12, 0x1a,+ 0x0a, 0x16, 0x4c, 0x47, 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x55, 0x4e, 0x53,+ 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x17, 0x0a, 0x13, 0x4c, 0x47,+ 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f, 0x44, 0x49, 0x53, 0x41, 0x42, 0x4c, 0x45,+ 0x44, 0x10, 0x01, 0x12, 0x1c, 0x0a, 0x18, 0x4c, 0x47, 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43,+ 0x4b, 0x5f, 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4f, 0x57, 0x4e, 0x45, 0x52, 0x10,+ 0x02, 0x12, 0x1d, 0x0a, 0x19, 0x4c, 0x47, 0x54, 0x4d, 0x5f, 0x43, 0x48, 0x45, 0x43, 0x4b, 0x5f,+ 0x50, 0x52, 0x4f, 0x4a, 0x45, 0x43, 0x54, 0x5f, 0x4d, 0x45, 0x4d, 0x42, 0x45, 0x52, 0x10, 0x03,+ 0x32, 0xd0, 0x05, 0x0a, 0x0e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x53, 0x65, 0x72, 0x76,+ 0x69, 0x63, 0x65, 0x12, 0x68, 0x0a, 0x0a, 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63,+ 0x74, 0x12, 0x1e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x47, 0x65, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73,+ 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e,+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x24, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65,+ 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17, 0x12, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d,+ 0x65, 0x3d, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x6c, 0x0a,+ 0x0c, 0x4c, 0x69, 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x20, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69, 0x73, 0x74,+ 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x4c, 0x69,+ 0x73, 0x74, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x52, 0x65, 0x73, 0x70, 0x6f, 0x6e,+ 0x73, 0x65, 0x22, 0x17, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x0e, 0x12, 0x0c, 0x2f,+ 0x76, 0x31, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x6a, 0x0a, 0x0d, 0x43,+ 0x72, 0x65, 0x61, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x43, 0x72, 0x65, 0x61, 0x74,+ 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a,+ 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72,+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x20, 0xda, 0x41, 0x00, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x17,+ 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x0c, 0x2f, 0x76, 0x31, 0x2f, 0x70,+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x12, 0x8e, 0x01, 0x0a, 0x0d, 0x55, 0x70, 0x64, 0x61,+ 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x70, 0x64, 0x61, 0x74, 0x65, 0x50, 0x72,+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65, 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62,+ 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65,+ 0x63, 0x74, 0x22, 0x44, 0xda, 0x41, 0x13, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2c, 0x75,+ 0x70, 0x64, 0x61, 0x74, 0x65, 0x5f, 0x6d, 0x61, 0x73, 0x6b, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x28,+ 0x3a, 0x07, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x32, 0x1d, 0x2f, 0x76, 0x31, 0x2f, 0x7b,+ 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70, 0x72, 0x6f,+ 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x70, 0x0a, 0x0d, 0x44, 0x65, 0x6c, 0x65,+ 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x21, 0x2e, 0x62, 0x79, 0x74, 0x65,+ 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x44, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72,+ 0x6f, 0x6a, 0x65, 0x63, 0x74, 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, 0x24, 0xda, 0x41, 0x04, 0x6e, 0x61, 0x6d, 0x65, 0x82, 0xd3, 0xe4,+ 0x93, 0x02, 0x17, 0x2a, 0x15, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x12, 0x77, 0x0a, 0x0f, 0x55, 0x6e,+ 0x64, 0x65, 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x12, 0x23, 0x2e,+ 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31, 0x2e, 0x55, 0x6e, 0x64, 0x65,+ 0x6c, 0x65, 0x74, 0x65, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x52, 0x65, 0x71, 0x75, 0x65,+ 0x73, 0x74, 0x1a, 0x14, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x76, 0x31,+ 0x2e, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x22, 0x29, 0x82, 0xd3, 0xe4, 0x93, 0x02, 0x23,+ 0x3a, 0x01, 0x2a, 0x22, 0x1e, 0x2f, 0x76, 0x31, 0x2f, 0x7b, 0x6e, 0x61, 0x6d, 0x65, 0x3d, 0x70,+ 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x73, 0x2f, 0x2a, 0x7d, 0x3a, 0x75, 0x6e, 0x64, 0x65, 0x6c,+ 0x65, 0x74, 0x65, 0x42, 0x11, 0x5a, 0x0f, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64,+ 0x2d, 0x67, 0x6f, 0x2f, 0x76, 0x31, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,}var (diff --git a/proto/v1/auth_service.proto b/proto/v1/auth_service.protoindex b7d98a67fa..0372063c0f 100644--- a/proto/v1/auth_service.proto+++ b/proto/v1/auth_service.proto@@ -6,12 +6,27 @@ import "google/api/annotations.proto";import "google/api/client.proto";import "google/api/field_behavior.proto";import "google/protobuf/empty.proto";+import "google/protobuf/field_mask.proto";import "v1/common.proto";option go_package = "generated-go/v1";service AuthService {+ rpc GetUser(GetUserRequest) returns (User) {+ option (google.api.http) = {+ get: "/v1/{name=users/*}"+ };+ option (google.api.method_signature) = "name";+ }++ rpc ListUsers(ListUsersRequest) returns (ListUsersResponse) {+ option (google.api.http) = {+ get: "/v1/users"+ };+ option (google.api.method_signature) = "parent";+ }+rpc CreateUser(CreateUserRequest) returns (User) {option (google.api.http) = {post: "/v1/users"@@ -19,12 +34,36 @@ service AuthService {};option (google.api.method_signature) = "user";}++ rpc UpdateUser(UpdateUserRequest) returns (User) {+ option (google.api.http) = {+ patch: "/v1/{user.name=users/*}"+ body: "user"+ };+ option (google.api.method_signature) = "user,update_mask";+ }++ rpc DeleteUser(DeleteUserRequest) returns (google.protobuf.Empty) {+ option (google.api.http) = {+ delete: "/v1/{name=users/*}"+ };+ option (google.api.method_signature) = "name";+ }++ rpc UndeleteUser(UndeleteUserRequest) returns (User) {+ option (google.api.http) = {+ post: "/v1/{name=users/*}:undelete"+ body: "*"+ };+ }+rpc Login(LoginRequest) returns (LoginResponse) {option (google.api.http) = {post: "/v1/auth/login"body: "*"};}+rpc Logout(LogoutRequest) returns (google.protobuf.Empty) {option (google.api.http) = {post: "/v1/auth/logout"@@ -33,11 +72,69 @@ service AuthService {}}++message GetUserRequest {+ // The name of the user to retrieve.+ // Format: users/{user}+ string name = 1 [(google.api.field_behavior) = REQUIRED];+}++message ListUsersRequest {+ // The maximum number of users to return. The service may return fewer than+ // this value.+ // If unspecified, at most 50 users will be returned.+ // The maximum value is 1000; values above 1000 will be coerced to 1000.+ int32 page_size = 1;++ // A page token, received from a previous `ListUsers` call.+ // Provide this to retrieve the subsequent page.+ //+ // When paginating, all other parameters provided to `ListUsers` must match+ // the call that provided the page token.+ string page_token = 2;++ // Show deleted users if specified.+ bool show_deleted = 3;+}++message ListUsersResponse {+ // The users from the specified publisher.+ repeated User users = 1;++ // A token, which can be sent as `page_token` to retrieve the next page.+ // If this field is omitted, there are no subsequent pages.+ string next_page_token = 2;+}+message CreateUserRequest {// The user to create.User user = 1 [(google.api.field_behavior) = REQUIRED];}++message UpdateUserRequest {+ // The user to update.+ //+ // The user's `name` field is used to identify the user to update.+ // Format: users/{user}+ User user = 1 [(google.api.field_behavior) = REQUIRED];++ // The list of fields to update.+ google.protobuf.FieldMask update_mask = 2;+}++message DeleteUserRequest {+ // The name of the user to delete.+ // Format: users/{user}+ string name = 1 [(google.api.field_behavior) = REQUIRED];+}++message UndeleteUserRequest {+ // The name of the deleted user.+ // Format: users/{user}+ string name = 1 [(google.api.field_behavior) = REQUIRED];+}+message LoginRequest {string email = 1;@@ -67,14 +164,22 @@ message User {string password = 5 [(google.api.field_behavior) = INPUT_ONLY];+ UserType user_type = 6;+// The user role will not be respected in the create user request, because the role is controlled by workspace owner.- UserRole user_role = 6;+ UserRole user_role = 7;}+enum UserType {+ USER_TYPE_UNSPECIFIED = 0;+ USER = 1;+ SYSTEM_BOT = 2;+ SERVICE_ACCOUNT = 3;+}enum UserRole {USER_ROLE_UNSPECIFIED = 0;- USER_ROLE_OWNER = 1;- USER_ROLE_DBA = 2;- USER_ROLE_DEVELOPER = 3;+ OWNER = 1;+ DBA = 2;+ DEVELOPER = 3;}diff --git a/proto/v1/common.proto b/proto/v1/common.protoindex 5e1cc1869b..e52c53e94f 100644--- a/proto/v1/common.proto+++ b/proto/v1/common.proto@@ -6,6 +6,6 @@ option go_package = "generated-go/v1";enum State {STATE_UNSPECIFIED = 0;- STATE_ACTIVE = 1;- STATE_DELETED = 2;+ ACTIVE = 1;+ DELETED = 2;}\ No newline at end of filediff --git a/proto/v1/instance_service.proto b/proto/v1/instance_service.protoindex bd4d3faac9..6f05bd7c88 100644--- a/proto/v1/instance_service.proto+++ b/proto/v1/instance_service.proto@@ -149,13 +149,13 @@ message Instance {enum Engine {ENGINE_UNSPECIFIED = 0;- ENGINE_CLICKHOUSE = 1;- ENGINE_MYSQL = 2;- ENGINE_POSTGRES = 3;- ENGINE_SNOWFLAKE = 4;- ENGINE_SQLITE = 5;- ENGINE_TIDB = 6;- ENGINE_MONGODB = 7;+ CLICKHOUSE = 1;+ MYSQL = 2;+ POSTGRES = 3;+ SNOWFLAKE = 4;+ SQLITE = 5;+ TIDB = 6;+ MONGODB = 7;}message DataSource {@@ -173,6 +173,6 @@ message DataSource {enum DataSourceType {DATA_SOURCE_UNSPECIFIED = 0;- DATA_SOURCE_ADMIN = 1;- DATA_SOURCE_RO = 2;+ ADMIN = 1;+ READ_ONLY = 2;}\ No newline at end of filediff --git a/proto/v1/project_service.proto b/proto/v1/project_service.protoindex 4af8c71a10..5535bab2ea 100644--- a/proto/v1/project_service.proto+++ b/proto/v1/project_service.proto@@ -146,8 +146,8 @@ message Project {enum Workflow {WORKFLOW_UNSPECIFIED = 0;- WORKFLOW_UI = 1;- WORKFLOW_VCS = 2;+ UI = 1;+ VCS = 2;}enum Visibility {@@ -164,21 +164,21 @@ enum TenantMode {enum RoleProvider {ROLE_PROVIDER_UNSPECIFIED = 0;- ROLE_PROVIDER_BYTEBASE = 1;- ROLE_PROVIDER_GITLAB_SELF_HOST = 2;- ROLE_PROVIDER_GITHUB_COM = 3;+ BYTEBASE = 1;+ GITLAB_SELF_HOST = 2;+ GITHUB_COM = 3;}enum SchemaVersion {SCHEMA_VERSION_UNSPECIFIED = 0;- SCHEMA_VERSION_TIMESTAMP = 1;- SCHEMA_VERSION_SEMANTIC = 2;+ TIMESTAMP = 1;+ SEMANTIC = 2;}enum SchemaChange {SCHEMA_CHANGE_UNSPECIFIED = 0;- SCHEMA_CHANGE_DDL = 1;- SCHEMA_CHANGE_SDL = 2;+ DDL = 1;+ SDL = 2;}diff --git a/server/api/auth/acl.go b/server/api/auth/acl.goindex c9495d7184..8412c0af3f 100644--- a/server/api/auth/acl.go+++ b/server/api/auth/acl.go@@ -30,15 +30,20 @@ func (in *APIAuthInterceptor) ACLInterceptor(ctx context.Context, req interface{}func (in *APIAuthInterceptor) getWorkspaceRole(ctx context.Context, methodName string) (api.Role, error) {- if isAuthenticationAllowed(methodName) {- return api.Owner, nil- }// If RBAC feature is not enabled, all users are treated as OWNER.if !in.licenseService.IsFeatureEnabled(api.FeatureRBAC) {return api.Owner, nil}- principalID := ctx.Value(common.PrincipalIDContextKey).(int)+ principalPtr := ctx.Value(common.PrincipalIDContextKey)+ if principalPtr == nil {+ if isAuthenticationAllowed(methodName) {+ return api.Developer, nil+ }+ return api.UnknownRole, status.Errorf(codes.PermissionDenied, "principal key doesn't exist in the request context")+ }++ principalID := principalPtr.(int)member, err := in.store.GetMemberByPrincipalID(ctx, principalID)if err != nil {return api.UnknownRole, status.Errorf(codes.PermissionDenied, "failed to get member for principal %v in processing authorize request.", principalID)diff --git a/server/api/auth/auth.go b/server/api/auth/auth.goindex ca3430dd4c..2853f18c67 100644--- a/server/api/auth/auth.go+++ b/server/api/auth/auth.go@@ -79,12 +79,6 @@ func New(store *store.Store, secret string, licenseService enterpriseAPI.License// AuthenticationInterceptor is the unary interceptor for gRPC API.func (in *APIAuthInterceptor) AuthenticationInterceptor(ctx context.Context, req interface{}, serverInfo *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (interface{}, error) {- // TODO(d): skips actuator, GET /subscription request, OpenAPI SQL endpoint.- methodName := getShortMethodName(serverInfo.FullMethod)- if isAuthenticationAllowed(methodName) {- return handler(ctx, req)- }-md, ok := metadata.FromIncomingContext(ctx)if !ok {return nil, status.Error(codes.Unauthenticated, "failed to parse metadata from incoming context")@@ -94,6 +88,15 @@ func (in *APIAuthInterceptor) AuthenticationInterceptor(ctx context.Context, reqreturn nil, status.Error(codes.Unauthenticated, err.Error())}+ // TODO(d): skips actuator, GET /subscription request, OpenAPI SQL endpoint.+ methodName := getShortMethodName(serverInfo.FullMethod)+ if accessTokenStr == "" && isAuthenticationAllowed(methodName) {+ return handler(ctx, req)+ }++ if accessTokenStr == "" {+ return nil, status.Errorf(codes.Unauthenticated, "access token not found")+ }claims := &claimsMessage{}generateToken := falseaccessToken, err := jwt.ParseWithClaims(accessTokenStr, claims, func(t *jwt.Token) (interface{}, error) {@@ -223,7 +226,7 @@ func getTokenFromMetadata(md metadata.MD) (string, string, error) {if accessToken != "" && refreshToken != "" {return accessToken, refreshToken, nil}- return "", "", errs.Errorf("access token not found from metadata")+ return "", "", nil}func audienceContains(audience jwt.ClaimStrings, token string) bool {diff --git a/server/api/v1/auth_service.go b/server/api/v1/auth_service.goindex a33c19a65e..b4548c4286 100644--- a/server/api/v1/auth_service.go+++ b/server/api/v1/auth_service.go@@ -4,6 +4,8 @@ import ("context""encoding/json""fmt"+ "strconv"+ "strings""golang.org/x/crypto/bcrypt""google.golang.org/grpc"@@ -12,7 +14,10 @@ import ("google.golang.org/grpc/status""google.golang.org/protobuf/types/known/emptypb"+ "github.com/pkg/errors"+"github.com/bytebase/bytebase/api"+ "github.com/bytebase/bytebase/common"metricAPI "github.com/bytebase/bytebase/metric""github.com/bytebase/bytebase/plugin/metric"v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"@@ -43,6 +48,35 @@ func NewAuthService(store *store.Store, secret string, metricReporter *metricrep}}+// GetUser gets a user.+func (s *AuthService) GetUser(ctx context.Context, request *v1pb.GetUserRequest) (*v1pb.User, error) {+ userID, err := getUserID(request.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ user, err := s.store.GetUserByID(ctx, userID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get user, error %v", err)+ }+ if user == nil {+ return nil, status.Errorf(codes.NotFound, "user %d not found", userID)+ }+ return convertToUser(user), nil+}++// ListUsers lists all users.+func (s *AuthService) ListUsers(ctx context.Context, request *v1pb.ListUsersRequest) (*v1pb.ListUsersResponse, error) {+ users, err := s.store.ListUsers(ctx, &store.FindUserMessage{ShowDeleted: request.ShowDeleted})+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to list user, error %v", err)+ }+ response := &v1pb.ListUsersResponse{}+ for _, user := range users {+ response.Users = append(response.Users, convertToUser(user))+ }+ return response, nil+}+// CreateUser creates a user.func (s *AuthService) CreateUser(ctx context.Context, request *v1pb.CreateUserRequest) (*v1pb.User, error) {if request.User == nil {@@ -107,25 +141,184 @@ func (s *AuthService) CreateUser(ctx context.Context, request *v1pb.CreateUserRereturn convertToUser(user), nil}+// UpdateUser updates a user.+func (s *AuthService) UpdateUser(ctx context.Context, request *v1pb.UpdateUserRequest) (*v1pb.User, error) {+ principalID := ctx.Value(common.PrincipalIDContextKey).(int)+ if request.User == nil {+ return nil, status.Errorf(codes.InvalidArgument, "user must be set")+ }+ if request.UpdateMask == nil {+ return nil, status.Errorf(codes.InvalidArgument, "update_mask must be set")+ }++ userID, err := getUserID(request.User.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ user, err := s.store.GetUserByID(ctx, userID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get user, error %v", err)+ }+ if user == nil {+ return nil, status.Errorf(codes.NotFound, "user %d not found", userID)+ }+ if user.MemberDeleted {+ return nil, status.Errorf(codes.InvalidArgument, "user %q has been deleted", userID)+ }++ role := ctx.Value(common.RoleContextKey).(api.Role)+ if principalID != userID && role != api.Owner {+ return nil, status.Errorf(codes.PermissionDenied, "only workspace owner or user itself can update the user %d", userID)+ }++ patch := &store.UpdateUserMessage{}+ for _, path := range request.UpdateMask.Paths {+ switch path {+ case "user.email":+ patch.Email = &request.User.Email+ case "user.title":+ patch.Name = &request.User.Title+ case "user.password":+ passwordHash, err := bcrypt.GenerateFromPassword([]byte(request.User.Password), bcrypt.DefaultCost)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to generate password hash, error %v", err)+ }+ passwordHashStr := string(passwordHash)+ patch.PasswordHash = &passwordHashStr+ case "user.role":+ if role != api.Owner {+ return nil, status.Errorf(codes.PermissionDenied, "only workspace owner can update user role")+ }+ userRole := convertUserRole(request.User.UserRole)+ if userRole == api.UnknownRole {+ return nil, status.Errorf(codes.InvalidArgument, "invalid user role %s", request.User.UserRole)+ }+ patch.Role = &userRole+ }+ }++ user, err = s.store.UpdateUser(ctx, userID, patch, principalID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to update user, error %v", err)+ }+ return convertToUser(user), nil+}++// DeleteUser deletes a user.+func (s *AuthService) DeleteUser(ctx context.Context, request *v1pb.DeleteUserRequest) (*emptypb.Empty, error) {+ principalID := ctx.Value(common.PrincipalIDContextKey).(int)+ userID, err := getUserID(request.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ user, err := s.store.GetUserByID(ctx, userID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get user, error %v", err)+ }+ if user == nil {+ return nil, status.Errorf(codes.NotFound, "user %d not found", userID)+ }+ if user.MemberDeleted {+ return nil, status.Errorf(codes.InvalidArgument, "user %q has been deleted", userID)+ }++ role := ctx.Value(common.RoleContextKey).(api.Role)+ if role != api.Owner {+ return nil, status.Errorf(codes.PermissionDenied, "only workspace owner can delete the user %d", userID)+ }++ if _, err := s.store.UpdateUser(ctx, userID, &store.UpdateUserMessage{Delete: &deletePatch}, principalID); err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }+ return &emptypb.Empty{}, nil+}++// UndeleteUser undeletes a user.+func (s *AuthService) UndeleteUser(ctx context.Context, request *v1pb.UndeleteUserRequest) (*v1pb.User, error) {+ principalID := ctx.Value(common.PrincipalIDContextKey).(int)+ userID, err := getUserID(request.Name)+ if err != nil {+ return nil, status.Errorf(codes.InvalidArgument, err.Error())+ }+ user, err := s.store.GetUserByID(ctx, userID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, "failed to get user, error %v", err)+ }+ if user == nil {+ return nil, status.Errorf(codes.NotFound, "user %d not found", userID)+ }+ if !user.MemberDeleted {+ return nil, status.Errorf(codes.InvalidArgument, "user %q is already active", userID)+ }++ role := ctx.Value(common.RoleContextKey).(api.Role)+ if role != api.Owner {+ return nil, status.Errorf(codes.PermissionDenied, "only workspace owner can undelete the user %d", userID)+ }++ user, err = s.store.UpdateUser(ctx, userID, &store.UpdateUserMessage{Delete: &undeletePatch}, principalID)+ if err != nil {+ return nil, status.Errorf(codes.Internal, err.Error())+ }+ return convertToUser(user), nil+}++func getUserID(name string) (int, error) {+ if !strings.HasPrefix(name, userNamePrefix) {+ return 0, errors.Errorf("invalid user name %q", name)+ }+ userStr := strings.TrimPrefix(name, userNamePrefix)+ if userStr == "" {+ return 0, errors.Errorf("user cannot be empty")+ }+ userID, err := strconv.Atoi(userStr)+ if err != nil {+ return 0, errors.Errorf("invalid user ID %q", userStr)+ }+ return userID, nil+}+func convertToUser(user *store.UserMessage) *v1pb.User {role := v1pb.UserRole_USER_ROLE_UNSPECIFIEDswitch user.Role {case api.Owner:- role = v1pb.UserRole_USER_ROLE_OWNER+ role = v1pb.UserRole_OWNERcase api.DBA:- role = v1pb.UserRole_USER_ROLE_DBA+ role = v1pb.UserRole_DBAcase api.Developer:- role = v1pb.UserRole_USER_ROLE_DEVELOPER+ role = v1pb.UserRole_DEVELOPER+ }+ userType := v1pb.UserType_USER_TYPE_UNSPECIFIED+ switch user.Type {+ case api.EndUser:+ userType = v1pb.UserType_USER+ case api.SystemBot:+ userType = v1pb.UserType_SYSTEM_BOT+ case api.ServiceAccount:+ userType = v1pb.UserType_SERVICE_ACCOUNT}return &v1pb.User{Name: fmt.Sprintf("%s%d", userNamePrefix, user.ID),State: convertDeletedToState(user.MemberDeleted),Email: user.Email,Title: user.Name,+ UserType: userType,UserRole: role,}}+func convertUserRole(userRole v1pb.UserRole) api.Role {+ switch userRole {+ case v1pb.UserRole_OWNER:+ return api.Owner+ case v1pb.UserRole_DBA:+ return api.DBA+ case v1pb.UserRole_DEVELOPER:+ return api.Developer+ }+ return api.UnknownRole+}+// Login is the auth login method.func (s *AuthService) Login(ctx context.Context, request *v1pb.LoginRequest) (*v1pb.LoginResponse, error) {user, err := s.store.GetUserByEmail(ctx, request.Email)diff --git a/server/api/v1/common.go b/server/api/v1/common.goindex d9908b3714..16e7b372a8 100644--- a/server/api/v1/common.go+++ b/server/api/v1/common.go@@ -14,9 +14,9 @@ var (func convertDeletedToState(deleted bool) v1pb.State {if deleted {- return v1pb.State_STATE_DELETED+ return v1pb.State_DELETED}- return v1pb.State_STATE_ACTIVE+ return v1pb.State_ACTIVE}func isValidResourceID(resourceID string) bool {diff --git a/server/api/v1/instance_service.go b/server/api/v1/instance_service.goindex c23191bbe0..c311d3a47f 100644--- a/server/api/v1/instance_service.go+++ b/server/api/v1/instance_service.go@@ -263,19 +263,19 @@ func convertToInstance(instance *store.InstanceMessage) *v1pb.Instance {engine := v1pb.Engine_ENGINE_UNSPECIFIEDswitch instance.Engine {case db.ClickHouse:- engine = v1pb.Engine_ENGINE_CLICKHOUSE+ engine = v1pb.Engine_CLICKHOUSEcase db.MySQL:- engine = v1pb.Engine_ENGINE_MYSQL+ engine = v1pb.Engine_MYSQLcase db.Postgres:- engine = v1pb.Engine_ENGINE_POSTGRES+ engine = v1pb.Engine_POSTGREScase db.Snowflake:- engine = v1pb.Engine_ENGINE_SNOWFLAKE+ engine = v1pb.Engine_SNOWFLAKEcase db.SQLite:- engine = v1pb.Engine_ENGINE_SQLITE+ engine = v1pb.Engine_SQLITEcase db.TiDB:- engine = v1pb.Engine_ENGINE_TIDB+ engine = v1pb.Engine_TIDBcase db.MongoDB:- engine = v1pb.Engine_ENGINE_MONGODB+ engine = v1pb.Engine_MONGODB}dataSourceList := []*v1pb.DataSource{}@@ -283,9 +283,9 @@ func convertToInstance(instance *store.InstanceMessage) *v1pb.Instance {dataSourceType := v1pb.DataSourceType_DATA_SOURCE_UNSPECIFIEDswitch ds.Type {case api.Admin:- dataSourceType = v1pb.DataSourceType_DATA_SOURCE_ADMIN+ dataSourceType = v1pb.DataSourceType_ADMINcase api.RO:- dataSourceType = v1pb.DataSourceType_DATA_SOURCE_RO+ dataSourceType = v1pb.DataSourceType_READ_ONLY}dataSourceList = append(dataSourceList, &v1pb.DataSource{@@ -315,19 +315,19 @@ func convertToInstance(instance *store.InstanceMessage) *v1pb.Instance {func convertToInstanceMessage(instanceID string, instance *v1pb.Instance) (*store.InstanceMessage, error) {var engine db.Typeswitch instance.Engine {- case v1pb.Engine_ENGINE_CLICKHOUSE:+ case v1pb.Engine_CLICKHOUSE:engine = db.ClickHouse- case v1pb.Engine_ENGINE_MYSQL:+ case v1pb.Engine_MYSQL:engine = db.MySQL- case v1pb.Engine_ENGINE_POSTGRES:+ case v1pb.Engine_POSTGRES:engine = db.Postgres- case v1pb.Engine_ENGINE_SNOWFLAKE:+ case v1pb.Engine_SNOWFLAKE:engine = db.Snowflake- case v1pb.Engine_ENGINE_SQLITE:+ case v1pb.Engine_SQLITE:engine = db.SQLite- case v1pb.Engine_ENGINE_TIDB:+ case v1pb.Engine_TIDB:engine = db.TiDB- case v1pb.Engine_ENGINE_MONGODB:+ case v1pb.Engine_MONGODB:engine = db.MongoDBdefault:return nil, errors.Errorf("invalid instance engine %v", instance.Engine)@@ -352,9 +352,9 @@ func convertToDataSourceMessageList(dataSources []*v1pb.DataSource) ([]*store.Dafor _, ds := range dataSources {var dsType api.DataSourceTypeswitch ds.Type {- case v1pb.DataSourceType_DATA_SOURCE_RO:+ case v1pb.DataSourceType_READ_ONLY:dsType = api.RO- case v1pb.DataSourceType_DATA_SOURCE_ADMIN:+ case v1pb.DataSourceType_ADMIN:dsType = api.Admindefault:return nil, errors.Errorf("invalid data source type %v", ds.Type)diff --git a/server/api/v1/project_service.go b/server/api/v1/project_service.goindex 8aac335053..6688fb3664 100644--- a/server/api/v1/project_service.go+++ b/server/api/v1/project_service.go@@ -227,9 +227,9 @@ func convertProject(projectMessage *store.ProjectMessage) *v1pb.Project {workflow := v1pb.Workflow_WORKFLOW_UNSPECIFIEDswitch projectMessage.Workflow {case api.UIWorkflow:- workflow = v1pb.Workflow_WORKFLOW_UI+ workflow = v1pb.Workflow_UIcase api.VCSWorkflow:- workflow = v1pb.Workflow_WORKFLOW_VCS+ workflow = v1pb.Workflow_VCS}visibility := v1pb.Visibility_VISIBILITY_UNSPECIFIED@@ -251,19 +251,19 @@ func convertProject(projectMessage *store.ProjectMessage) *v1pb.Project {roleProvider := v1pb.RoleProvider_ROLE_PROVIDER_UNSPECIFIEDswitch projectMessage.RoleProvider {case api.ProjectRoleProviderBytebase:- roleProvider = v1pb.RoleProvider_ROLE_PROVIDER_BYTEBASE+ roleProvider = v1pb.RoleProvider_BYTEBASEcase api.ProjectRoleProviderGitHubCom:- roleProvider = v1pb.RoleProvider_ROLE_PROVIDER_GITHUB_COM+ roleProvider = v1pb.RoleProvider_GITHUB_COMcase api.ProjectRoleProviderGitLabSelfHost:- roleProvider = v1pb.RoleProvider_ROLE_PROVIDER_GITLAB_SELF_HOST+ roleProvider = v1pb.RoleProvider_GITLAB_SELF_HOST}schemaChange := v1pb.SchemaChange_SCHEMA_CHANGE_UNSPECIFIEDswitch projectMessage.SchemaChangeType {case api.ProjectSchemaChangeTypeDDL:- schemaChange = v1pb.SchemaChange_SCHEMA_CHANGE_DDL+ schemaChange = v1pb.SchemaChange_DDLcase api.ProjectSchemaChangeTypeSDL:- schemaChange = v1pb.SchemaChange_SCHEMA_CHANGE_SDL+ schemaChange = v1pb.SchemaChange_SDL}lgtmCheck := v1pb.LgtmCheck_LGTM_CHECK_UNSPECIFIED@@ -295,9 +295,9 @@ func convertProject(projectMessage *store.ProjectMessage) *v1pb.Project {func convertToProjectWorkflowType(workflow v1pb.Workflow) (api.ProjectWorkflowType, error) {var w api.ProjectWorkflowTypeswitch workflow {- case v1pb.Workflow_WORKFLOW_UI:+ case v1pb.Workflow_UI:w = api.UIWorkflow- case v1pb.Workflow_WORKFLOW_VCS:+ case v1pb.Workflow_VCS:w = api.VCSWorkflowdefault:return w, errors.Errorf("invalid workflow %v", workflow)@@ -334,11 +334,11 @@ func convertToProjectTenantMode(tenantMode v1pb.TenantMode) (api.ProjectTenantMofunc convertToProjectRoleProvider(roleProvider v1pb.RoleProvider) (api.ProjectRoleProvider, error) {var r api.ProjectRoleProviderswitch roleProvider {- case v1pb.RoleProvider_ROLE_PROVIDER_BYTEBASE:+ case v1pb.RoleProvider_BYTEBASE:r = api.ProjectRoleProviderBytebase- case v1pb.RoleProvider_ROLE_PROVIDER_GITHUB_COM:+ case v1pb.RoleProvider_GITHUB_COM:r = api.ProjectRoleProviderGitHubCom- case v1pb.RoleProvider_ROLE_PROVIDER_GITLAB_SELF_HOST:+ case v1pb.RoleProvider_GITLAB_SELF_HOST:r = api.ProjectRoleProviderGitLabSelfHostdefault:return r, errors.Errorf("invalid role provider %v", roleProvider)@@ -349,9 +349,9 @@ func convertToProjectRoleProvider(roleProvider v1pb.RoleProvider) (api.ProjectRofunc convertToProjectSchemaChangeType(schemaChange v1pb.SchemaChange) (api.ProjectSchemaChangeType, error) {var s api.ProjectSchemaChangeTypeswitch schemaChange {- case v1pb.SchemaChange_SCHEMA_CHANGE_DDL:+ case v1pb.SchemaChange_DDL:s = api.ProjectSchemaChangeTypeDDL- case v1pb.SchemaChange_SCHEMA_CHANGE_SDL:+ case v1pb.SchemaChange_SDL:s = api.ProjectSchemaChangeTypeSDLdefault:return s, errors.Errorf("invalid schema change type %v", schemaChange)diff --git a/store/principal.go b/store/principal.goindex 159ecf4347..63ff865540 100644--- a/store/principal.go+++ b/store/principal.go@@ -420,6 +420,15 @@ type FindUserMessage struct {ShowDeleted bool}+// UpdateUserMessage is the message to update a user.+type UpdateUserMessage struct {+ Email *string+ Name *string+ PasswordHash *string+ Role *api.Role+ Delete *bool+}+// UserMessage is the message for an user.type UserMessage struct {ID int@@ -431,6 +440,26 @@ type UserMessage struct {MemberDeleted bool}+// ListUsers list all users.+func (s *Store) ListUsers(ctx context.Context, find *FindUserMessage) ([]*UserMessage, error) {+ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, FormatError(err)+ }+ defer tx.Rollback()++ userMessages, err := s.listUserImpl(ctx, tx, find)+ if err != nil {+ return nil, err+ }++ if err := tx.Commit(); err != nil {+ return nil, FormatError(err)+ }++ return userMessages, nil+}+// GetUserByID gets the user by ID.func (s *Store) GetUserByID(ctx context.Context, id int) (*UserMessage, error) {tx, err := s.db.BeginTx(ctx, nil)@@ -500,8 +529,9 @@ func (*Store) listUserImpl(ctx context.Context, tx *Tx, find *FindUserMessage) (rows, err := tx.QueryContext(ctx, `SELECTprincipal.id AS user_id,- principal.name,principal.email,+ principal.name,+ principal.type,principal.password_hash,member.role,member.row_status AS row_status@@ -519,8 +549,9 @@ func (*Store) listUserImpl(ctx context.Context, tx *Tx, find *FindUserMessage) (var rowStatus stringif err := rows.Scan(&userMessage.ID,- &userMessage.Name,&userMessage.Email,+ &userMessage.Name,+ &userMessage.Type,&userMessage.PasswordHash,&userMessage.Role,&rowStatus,@@ -559,9 +590,9 @@ func (s *Store) CreateUser(ctx context.Context, create *UserMessage, creatorID iINSERT INTO principal (creator_id,updater_id,- type,- name,email,+ name,+ type,password_hash)VALUES ($1, $2, $3, $4, $5, $6)@@ -569,9 +600,9 @@ func (s *Store) CreateUser(ctx context.Context, create *UserMessage, creatorID i`,creatorID,creatorID,- create.Type,- create.Name,create.Email,+ create.Name,+ create.Type,create.PasswordHash,).Scan(&userID); err != nil {return nil, FormatError(err)@@ -609,3 +640,83 @@ func (s *Store) CreateUser(ctx context.Context, create *UserMessage, creatorID iRole: role,}, nil}++// UpdateUser updates a user.+func (s *Store) UpdateUser(ctx context.Context, userID int, patch *UpdateUserMessage, updaterID int) (*UserMessage, error) {+ principalSet, principalArgs := []string{"updater_id = $1"}, []interface{}{fmt.Sprintf("%d", updaterID)}+ if v := patch.Email; v != nil {+ principalSet, principalArgs = append(principalSet, fmt.Sprintf("email = $%d", len(principalArgs)+1)), append(principalArgs, *v)+ }+ if v := patch.Name; v != nil {+ principalSet, principalArgs = append(principalSet, fmt.Sprintf("name = $%d", len(principalArgs)+1)), append(principalArgs, *v)+ }+ if v := patch.PasswordHash; v != nil {+ principalSet, principalArgs = append(principalSet, fmt.Sprintf("password_hash = $%d", len(principalArgs)+1)), append(principalArgs, *v)+ }+ principalArgs = append(principalArgs, userID)++ memberSet, memberArgs := []string{"updater_id = $1"}, []interface{}{fmt.Sprintf("%d", updaterID)}+ if v := patch.Role; v != nil {+ memberSet, memberArgs = append(memberSet, fmt.Sprintf("role = $%d", len(memberArgs)+1)), append(memberArgs, *v)+ }+ if v := patch.Delete; v != nil {+ rowStatus := api.Normal+ if *patch.Delete {+ rowStatus = api.Archived+ }+ memberSet, memberArgs = append(memberSet, fmt.Sprintf(`"row_status" = $%d`, len(memberArgs)+1)), append(memberArgs, rowStatus)+ }+ memberArgs = append(memberArgs, userID)++ tx, err := s.db.BeginTx(ctx, nil)+ if err != nil {+ return nil, FormatError(err)+ }+ defer tx.Rollback()++ user := &UserMessage{}++ if err := tx.QueryRowContext(ctx, fmt.Sprintf(`+ UPDATE principal+ SET `+strings.Join(principalSet, ", ")+`+ WHERE id = $%d+ RETURNING id, email, name, type, password_hash+ `, len(principalArgs)),+ principalArgs...,+ ).Scan(+ &user.ID,+ &user.Email,+ &user.Name,+ &user.Type,+ &user.PasswordHash,+ ); err != nil {+ if err == sql.ErrNoRows {+ return nil, nil+ }+ return nil, FormatError(err)+ }+ var rowStatus string+ if err := tx.QueryRowContext(ctx, fmt.Sprintf(`+ UPDATE member+ SET `+strings.Join(memberSet, ", ")+`+ WHERE principal_id = $%d+ RETURNING role, row_status+ `, len(memberArgs)),+ memberArgs...,+ ).Scan(+ &user.Role,+ &rowStatus,+ ); err != nil {+ if err == sql.ErrNoRows {+ return nil, nil+ }+ return nil, FormatError(err)+ }+ user.MemberDeleted = convertRowStatusToDeleted(rowStatus)++ if err := tx.Commit(); err != nil {+ return nil, FormatError(err)+ }++ return user, nil+}