Skip to content

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

chore: project protection rules and changelist store proto (#8425)

Danny Xu50eb2f4c27e0
diff --git a/frontend/src/types/proto/store/changelist.ts b/frontend/src/types/proto/store/changelist.ts
new file mode 100644
index 0000000000..0de5b80c27
--- /dev/null
+++ b/frontend/src/types/proto/store/changelist.ts
@@ -0,0 +1,178 @@
+/* eslint-disable */
+import _m0 from "protobufjs/minimal";
+
+export const protobufPackage = "bytebase.store";
+
+export interface Changelist {
+ description: string;
+ changes: Changelist_Change[];
+}
+
+export interface Changelist_Change {
+ /** The name of a sheet. */
+ sheet: string;
+ /**
+ * The source of origin.
+ * 1) change history: instances/{instance}/databases/{database}/changeHistories/{changeHistory}.
+ * 2) branch: projects/{project}/schemaDesigns/{schemaDesign}.
+ * 3) raw SQL if empty.
+ */
+ source: string;
+}
+
+function createBaseChangelist(): Changelist {
+ return { description: "", changes: [] };
+}
+
+export const Changelist = {
+ encode(message: Changelist, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.description !== "") {
+ writer.uint32(10).string(message.description);
+ }
+ for (const v of message.changes) {
+ Changelist_Change.encode(v!, writer.uint32(18).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Changelist {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseChangelist();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.description = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.changes.push(Changelist_Change.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Changelist {
+ return {
+ description: isSet(object.description) ? String(object.description) : "",
+ changes: Array.isArray(object?.changes) ? object.changes.map((e: any) => Changelist_Change.fromJSON(e)) : [],
+ };
+ },
+
+ toJSON(message: Changelist): unknown {
+ const obj: any = {};
+ message.description !== undefined && (obj.description = message.description);
+ if (message.changes) {
+ obj.changes = message.changes.map((e) => e ? Changelist_Change.toJSON(e) : undefined);
+ } else {
+ obj.changes = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<Changelist>): Changelist {
+ return Changelist.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Changelist>): Changelist {
+ const message = createBaseChangelist();
+ message.description = object.description ?? "";
+ message.changes = object.changes?.map((e) => Changelist_Change.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseChangelist_Change(): Changelist_Change {
+ return { sheet: "", source: "" };
+}
+
+export const Changelist_Change = {
+ encode(message: Changelist_Change, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.sheet !== "") {
+ writer.uint32(10).string(message.sheet);
+ }
+ if (message.source !== "") {
+ writer.uint32(18).string(message.source);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Changelist_Change {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseChangelist_Change();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.sheet = reader.string();
+ continue;
+ case 2:
+ if (tag !== 18) {
+ break;
+ }
+
+ message.source = reader.string();
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Changelist_Change {
+ return {
+ sheet: isSet(object.sheet) ? String(object.sheet) : "",
+ source: isSet(object.source) ? String(object.source) : "",
+ };
+ },
+
+ toJSON(message: Changelist_Change): unknown {
+ const obj: any = {};
+ message.sheet !== undefined && (obj.sheet = message.sheet);
+ message.source !== undefined && (obj.source = message.source);
+ return obj;
+ },
+
+ create(base?: DeepPartial<Changelist_Change>): Changelist_Change {
+ return Changelist_Change.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Changelist_Change>): Changelist_Change {
+ const message = createBaseChangelist_Change();
+ message.sheet = object.sheet ?? "";
+ message.source = object.source ?? "";
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/frontend/src/types/proto/store/project.ts b/frontend/src/types/proto/store/project.ts
new file mode 100644
index 0000000000..a768640b44
--- /dev/null
+++ b/frontend/src/types/proto/store/project.ts
@@ -0,0 +1,236 @@
+/* eslint-disable */
+import _m0 from "protobufjs/minimal";
+
+export const protobufPackage = "bytebase.store";
+
+export interface Project {
+ protectionRules: ProtectionRule[];
+}
+
+export interface ProtectionRule {
+ /** A unique identifier for a node in UUID format. */
+ id: string;
+ target: ProtectionRule_Target;
+ /** The name of the branch/changelist or wildcard. */
+ nameFilter: string;
+ /** The roles allowed to create branches or changelists. */
+ createAllowedRoles: string[];
+}
+
+/** The type of target. */
+export enum ProtectionRule_Target {
+ PROTECTION_TARGET_UNSPECIFIED = 0,
+ BRANCH = 1,
+ CHANGELIST = 2,
+ UNRECOGNIZED = -1,
+}
+
+export function protectionRule_TargetFromJSON(object: any): ProtectionRule_Target {
+ switch (object) {
+ case 0:
+ case "PROTECTION_TARGET_UNSPECIFIED":
+ return ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED;
+ case 1:
+ case "BRANCH":
+ return ProtectionRule_Target.BRANCH;
+ case 2:
+ case "CHANGELIST":
+ return ProtectionRule_Target.CHANGELIST;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ProtectionRule_Target.UNRECOGNIZED;
+ }
+}
+
+export function protectionRule_TargetToJSON(object: ProtectionRule_Target): string {
+ switch (object) {
+ case ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED:
+ return "PROTECTION_TARGET_UNSPECIFIED";
+ case ProtectionRule_Target.BRANCH:
+ return "BRANCH";
+ case ProtectionRule_Target.CHANGELIST:
+ return "CHANGELIST";
+ case ProtectionRule_Target.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+function createBaseProject(): Project {
+ return { protectionRules: [] };
+}
+
+export const Project = {
+ encode(message: Project, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ for (const v of message.protectionRules) {
+ ProtectionRule.encode(v!, writer.uint32(10).fork()).ldelim();
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): Project {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseProject();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.protectionRules.push(ProtectionRule.decode(reader, reader.uint32()));
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): Project {
+ return {
+ protectionRules: Array.isArray(object?.protectionRules)
+ ? object.protectionRules.map((e: any) => ProtectionRule.fromJSON(e))
+ : [],
+ };
+ },
+
+ toJSON(message: Project): unknown {
+ const obj: any = {};
+ if (message.protectionRules) {
+ obj.protectionRules = message.protectionRules.map((e) => e ? ProtectionRule.toJSON(e) : undefined);
+ } else {
+ obj.protectionRules = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<Project>): Project {
+ return Project.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<Project>): Project {
+ const message = createBaseProject();
+ message.protectionRules = object.protectionRules?.map((e) => ProtectionRule.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseProtectionRule(): ProtectionRule {
+ return { id: "", target: 0, nameFilter: "", createAllowedRoles: [] };
+}
+
+export const ProtectionRule = {
+ encode(message: ProtectionRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.id !== "") {
+ writer.uint32(10).string(message.id);
+ }
+ if (message.target !== 0) {
+ writer.uint32(16).int32(message.target);
+ }
+ if (message.nameFilter !== "") {
+ writer.uint32(26).string(message.nameFilter);
+ }
+ for (const v of message.createAllowedRoles) {
+ writer.uint32(34).string(v!);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProtectionRule {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseProtectionRule();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.id = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.target = reader.int32() as any;
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.nameFilter = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.createAllowedRoles.push(reader.string());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ProtectionRule {
+ return {
+ id: isSet(object.id) ? String(object.id) : "",
+ target: isSet(object.target) ? protectionRule_TargetFromJSON(object.target) : 0,
+ nameFilter: isSet(object.nameFilter) ? String(object.nameFilter) : "",
+ createAllowedRoles: Array.isArray(object?.createAllowedRoles)
+ ? object.createAllowedRoles.map((e: any) => String(e))
+ : [],
+ };
+ },
+
+ toJSON(message: ProtectionRule): unknown {
+ const obj: any = {};
+ message.id !== undefined && (obj.id = message.id);
+ message.target !== undefined && (obj.target = protectionRule_TargetToJSON(message.target));
+ message.nameFilter !== undefined && (obj.nameFilter = message.nameFilter);
+ if (message.createAllowedRoles) {
+ obj.createAllowedRoles = message.createAllowedRoles.map((e) => e);
+ } else {
+ obj.createAllowedRoles = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<ProtectionRule>): ProtectionRule {
+ return ProtectionRule.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ProtectionRule>): ProtectionRule {
+ const message = createBaseProtectionRule();
+ message.id = object.id ?? "";
+ message.target = object.target ?? 0;
+ message.nameFilter = object.nameFilter ?? "";
+ message.createAllowedRoles = object.createAllowedRoles?.map((e) => e) || [];
+ return message;
+ },
+};
+
+type Builtin = Date | Function | Uint8Array | string | number | boolean | undefined;
+
+export type DeepPartial<T> = T extends Builtin ? T
+ : T extends Array<infer U> ? Array<DeepPartial<U>> : T extends ReadonlyArray<infer U> ? ReadonlyArray<DeepPartial<U>>
+ : T extends {} ? { [K in keyof T]?: DeepPartial<T[K]> }
+ : Partial<T>;
+
+function isSet(value: any): boolean {
+ return value !== null && value !== undefined;
+}
diff --git a/frontend/src/types/proto/v1/project_service.ts b/frontend/src/types/proto/v1/project_service.ts
index f47f1c9644..98b1284ca7 100644
--- a/frontend/src/types/proto/v1/project_service.ts
+++ b/frontend/src/types/proto/v1/project_service.ts
@@ -557,6 +557,57 @@ export interface Project {
schemaChange: SchemaChange;
webhooks: Webhook[];
dataClassificationConfigId: string;
+ protectionRules: ProtectionRule[];
+}
+
+export interface ProtectionRule {
+ /** A unique identifier for a node in UUID format. */
+ id: string;
+ target: ProtectionRule_Target;
+ /** The name of the branch/changelist or wildcard. */
+ nameFilter: string;
+ /** The roles allowed to create branches or changelists. */
+ createAllowedRoles: string[];
+}
+
+/** The type of target. */
+export enum ProtectionRule_Target {
+ PROTECTION_TARGET_UNSPECIFIED = 0,
+ BRANCH = 1,
+ CHANGELIST = 2,
+ UNRECOGNIZED = -1,
+}
+
+export function protectionRule_TargetFromJSON(object: any): ProtectionRule_Target {
+ switch (object) {
+ case 0:
+ case "PROTECTION_TARGET_UNSPECIFIED":
+ return ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED;
+ case 1:
+ case "BRANCH":
+ return ProtectionRule_Target.BRANCH;
+ case 2:
+ case "CHANGELIST":
+ return ProtectionRule_Target.CHANGELIST;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return ProtectionRule_Target.UNRECOGNIZED;
+ }
+}
+
+export function protectionRule_TargetToJSON(object: ProtectionRule_Target): string {
+ switch (object) {
+ case ProtectionRule_Target.PROTECTION_TARGET_UNSPECIFIED:
+ return "PROTECTION_TARGET_UNSPECIFIED";
+ case ProtectionRule_Target.BRANCH:
+ return "BRANCH";
+ case ProtectionRule_Target.CHANGELIST:
+ return "CHANGELIST";
+ case ProtectionRule_Target.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
}
export interface AddWebhookRequest {
@@ -2600,6 +2651,7 @@ function createBaseProject(): Project {
schemaChange: 0,
webhooks: [],
dataClassificationConfigId: "",
+ protectionRules: [],
};
}
@@ -2641,6 +2693,9 @@ export const Project = {
if (message.dataClassificationConfigId !== "") {
writer.uint32(98).string(message.dataClassificationConfigId);
}
+ for (const v of message.protectionRules) {
+ ProtectionRule.encode(v!, writer.uint32(106).fork()).ldelim();
+ }
return writer;
},
@@ -2735,6 +2790,13 @@ export const Project = {
message.dataClassificationConfigId = reader.string();
continue;
+ case 13:
+ if (tag !== 106) {
+ break;
+ }
+
+ message.protectionRules.push(ProtectionRule.decode(reader, reader.uint32()));
+ continue;
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -2760,6 +2822,9 @@ export const Project = {
dataClassificationConfigId: isSet(object.dataClassificationConfigId)
? String(object.dataClassificationConfigId)
: "",
+ protectionRules: Array.isArray(object?.protectionRules)
+ ? object.protectionRules.map((e: any) => ProtectionRule.fromJSON(e))
+ : [],
};
},
@@ -2782,6 +2847,11 @@ export const Project = {
}
message.dataClassificationConfigId !== undefined &&
(obj.dataClassificationConfigId = message.dataClassificationConfigId);
+ if (message.protectionRules) {
+ obj.protectionRules = message.protectionRules.map((e) => e ? ProtectionRule.toJSON(e) : undefined);
+ } else {
+ obj.protectionRules = [];
+ }
return obj;
},
@@ -2803,6 +2873,110 @@ export const Project = {
message.schemaChange = object.schemaChange ?? 0;
message.webhooks = object.webhooks?.map((e) => Webhook.fromPartial(e)) || [];
message.dataClassificationConfigId = object.dataClassificationConfigId ?? "";
+ message.protectionRules = object.protectionRules?.map((e) => ProtectionRule.fromPartial(e)) || [];
+ return message;
+ },
+};
+
+function createBaseProtectionRule(): ProtectionRule {
+ return { id: "", target: 0, nameFilter: "", createAllowedRoles: [] };
+}
+
+export const ProtectionRule = {
+ encode(message: ProtectionRule, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {
+ if (message.id !== "") {
+ writer.uint32(10).string(message.id);
+ }
+ if (message.target !== 0) {
+ writer.uint32(16).int32(message.target);
+ }
+ if (message.nameFilter !== "") {
+ writer.uint32(26).string(message.nameFilter);
+ }
+ for (const v of message.createAllowedRoles) {
+ writer.uint32(34).string(v!);
+ }
+ return writer;
+ },
+
+ decode(input: _m0.Reader | Uint8Array, length?: number): ProtectionRule {
+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);
+ let end = length === undefined ? reader.len : reader.pos + length;
+ const message = createBaseProtectionRule();
+ while (reader.pos < end) {
+ const tag = reader.uint32();
+ switch (tag >>> 3) {
+ case 1:
+ if (tag !== 10) {
+ break;
+ }
+
+ message.id = reader.string();
+ continue;
+ case 2:
+ if (tag !== 16) {
+ break;
+ }
+
+ message.target = reader.int32() as any;
+ continue;
+ case 3:
+ if (tag !== 26) {
+ break;
+ }
+
+ message.nameFilter = reader.string();
+ continue;
+ case 4:
+ if (tag !== 34) {
+ break;
+ }
+
+ message.createAllowedRoles.push(reader.string());
+ continue;
+ }
+ if ((tag & 7) === 4 || tag === 0) {
+ break;
+ }
+ reader.skipType(tag & 7);
+ }
+ return message;
+ },
+
+ fromJSON(object: any): ProtectionRule {
+ return {
+ id: isSet(object.id) ? String(object.id) : "",
+ target: isSet(object.target) ? protectionRule_TargetFromJSON(object.target) : 0,
+ nameFilter: isSet(object.nameFilter) ? String(object.nameFilter) : "",
+ createAllowedRoles: Array.isArray(object?.createAllowedRoles)
+ ? object.createAllowedRoles.map((e: any) => String(e))
+ : [],
+ };
+ },
+
+ toJSON(message: ProtectionRule): unknown {
+ const obj: any = {};
+ message.id !== undefined && (obj.id = message.id);
+ message.target !== undefined && (obj.target = protectionRule_TargetToJSON(message.target));
+ message.nameFilter !== undefined && (obj.nameFilter = message.nameFilter);
+ if (message.createAllowedRoles) {
+ obj.createAllowedRoles = message.createAllowedRoles.map((e) => e);
+ } else {
+ obj.createAllowedRoles = [];
+ }
+ return obj;
+ },
+
+ create(base?: DeepPartial<ProtectionRule>): ProtectionRule {
+ return ProtectionRule.fromPartial(base ?? {});
+ },
+
+ fromPartial(object: DeepPartial<ProtectionRule>): ProtectionRule {
+ const message = createBaseProtectionRule();
+ message.id = object.id ?? "";
+ message.target = object.target ?? 0;
+ message.nameFilter = object.nameFilter ?? "";
+ message.createAllowedRoles = object.createAllowedRoles?.map((e) => e) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4f5d4f118b..0fa4b4b084 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -28,6 +28,10 @@
- [ActivityIssueCommentCreatePayload.ExternalApprovalEvent.Action](#bytebase-store-ActivityIssueCommentCreatePayload-ExternalApprovalEvent-Action)
- [ActivityIssueCommentCreatePayload.ExternalApprovalEvent.Type](#bytebase-store-ActivityIssueCommentCreatePayload-ExternalApprovalEvent-Type)
+- [store/changelist.proto](#store_changelist-proto)
+ - [Changelist](#bytebase-store-Changelist)
+ - [Changelist.Change](#bytebase-store-Changelist-Change)
+
- [store/common.proto](#store_common-proto)
- [PageToken](#bytebase-store-PageToken)
@@ -130,6 +134,12 @@
- [MaskingExceptionPolicy.MaskingException.Action](#bytebase-store-MaskingExceptionPolicy-MaskingException-Action)
+- [store/project.proto](#store_project-proto)
+ - [Project](#bytebase-store-Project)
+ - [ProtectionRule](#bytebase-store-ProtectionRule)
+
+ - [ProtectionRule.Target](#bytebase-store-ProtectionRule-Target)
+
- [store/setting.proto](#store_setting-proto)
- [AgentPluginSetting](#bytebase-store-AgentPluginSetting)
- [Announcement](#bytebase-store-Announcement)
@@ -518,6 +528,54 @@ convert to the expected struct there.
+<a name="store_changelist-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/changelist.proto
+
+
+
+<a name="bytebase-store-Changelist"></a>
+
+### Changelist
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| description | [string](#string) | | |
+| changes | [Changelist.Change](#bytebase-store-Changelist-Change) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-Changelist-Change"></a>
+
+### Changelist.Change
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| sheet | [string](#string) | | The name of a sheet. |
+| source | [string](#string) | | The source of origin. 1) change history: instances/{instance}/databases/{database}/changeHistories/{changeHistory}. 2) branch: projects/{project}/schemaDesigns/{schemaDesign}. 3) raw SQL if empty. |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
<a name="store_common-proto"></a>
<p align="right"><a href="#top">Top</a></p>
@@ -2018,6 +2076,68 @@ MaskingExceptionPolicy is the allowlist of users who can access sensitive data.
+<a name="store_project-proto"></a>
+<p align="right"><a href="#top">Top</a></p>
+
+## store/project.proto
+
+
+
+<a name="bytebase-store-Project"></a>
+
+### Project
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| protection_rules | [ProtectionRule](#bytebase-store-ProtectionRule) | repeated | |
+
+
+
+
+
+
+<a name="bytebase-store-ProtectionRule"></a>
+
+### ProtectionRule
+
+
+
+| Field | Type | Label | Description |
+| ----- | ---- | ----- | ----------- |
+| id | [string](#string) | | A unique identifier for a node in UUID format. |
+| target | [ProtectionRule.Target](#bytebase-store-ProtectionRule-Target) | | |
+| name_filter | [string](#string) | | The name of the branch/changelist or wildcard. |
+| create_allowed_roles | [string](#string) | repeated | The roles allowed to create branches or changelists. |
+
+
+
+
+
+
+
+
+<a name="bytebase-store-ProtectionRule-Target"></a>
+
+### ProtectionRule.Target
+The type of target.
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| PROTECTION_TARGET_UNSPECIFIED | 0 | |
+| BRANCH | 1 | |
+| CHANGELIST | 2 | |
+
+
+
+
+
+
+
+
+
+
<a name="store_setting-proto"></a>
<p align="right"><a href="#top">Top</a></p>
diff --git a/proto/generated-go/store/changelist.pb.go b/proto/generated-go/store/changelist.pb.go
new file mode 100644
index 0000000000..bf0f850750
--- /dev/null
+++ b/proto/generated-go/store/changelist.pb.go
@@ -0,0 +1,233 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.31.0
+// protoc (unknown)
+// source: store/changelist.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+type Changelist struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ Description string `protobuf:"bytes,1,opt,name=description,proto3" json:"description,omitempty"`
+ Changes []*Changelist_Change `protobuf:"bytes,2,rep,name=changes,proto3" json:"changes,omitempty"`
+}
+
+func (x *Changelist) Reset() {
+ *x = Changelist{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_changelist_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Changelist) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Changelist) ProtoMessage() {}
+
+func (x *Changelist) ProtoReflect() protoreflect.Message {
+ mi := &file_store_changelist_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 Changelist.ProtoReflect.Descriptor instead.
+func (*Changelist) Descriptor() ([]byte, []int) {
+ return file_store_changelist_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Changelist) GetDescription() string {
+ if x != nil {
+ return x.Description
+ }
+ return ""
+}
+
+func (x *Changelist) GetChanges() []*Changelist_Change {
+ if x != nil {
+ return x.Changes
+ }
+ return nil
+}
+
+type Changelist_Change struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // The name of a sheet.
+ Sheet string `protobuf:"bytes,1,opt,name=sheet,proto3" json:"sheet,omitempty"`
+ // The source of origin.
+ // 1) change history: instances/{instance}/databases/{database}/changeHistories/{changeHistory}.
+ // 2) branch: projects/{project}/schemaDesigns/{schemaDesign}.
+ // 3) raw SQL if empty.
+ Source string `protobuf:"bytes,2,opt,name=source,proto3" json:"source,omitempty"`
+}
+
+func (x *Changelist_Change) Reset() {
+ *x = Changelist_Change{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_changelist_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Changelist_Change) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Changelist_Change) ProtoMessage() {}
+
+func (x *Changelist_Change) ProtoReflect() protoreflect.Message {
+ mi := &file_store_changelist_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 Changelist_Change.ProtoReflect.Descriptor instead.
+func (*Changelist_Change) Descriptor() ([]byte, []int) {
+ return file_store_changelist_proto_rawDescGZIP(), []int{0, 0}
+}
+
+func (x *Changelist_Change) GetSheet() string {
+ if x != nil {
+ return x.Sheet
+ }
+ return ""
+}
+
+func (x *Changelist_Change) GetSource() string {
+ if x != nil {
+ return x.Source
+ }
+ return ""
+}
+
+var File_store_changelist_proto protoreflect.FileDescriptor
+
+var file_store_changelist_proto_rawDesc = []byte{
+ 0x0a, 0x16, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x63, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x6c, 0x69,
+ 0x73, 0x74, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61,
+ 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0xa3, 0x01, 0x0a, 0x0a, 0x43, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x12, 0x20, 0x0a, 0x0b, 0x64, 0x65, 0x73, 0x63, 0x72,
+ 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x0b, 0x64, 0x65,
+ 0x73, 0x63, 0x72, 0x69, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x3b, 0x0a, 0x07, 0x63, 0x68, 0x61,
+ 0x6e, 0x67, 0x65, 0x73, 0x18, 0x02, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x21, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x43, 0x68, 0x61, 0x6e,
+ 0x67, 0x65, 0x6c, 0x69, 0x73, 0x74, 0x2e, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65, 0x52, 0x07, 0x63,
+ 0x68, 0x61, 0x6e, 0x67, 0x65, 0x73, 0x1a, 0x36, 0x0a, 0x06, 0x43, 0x68, 0x61, 0x6e, 0x67, 0x65,
+ 0x12, 0x14, 0x0a, 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52,
+ 0x05, 0x73, 0x68, 0x65, 0x65, 0x74, 0x12, 0x16, 0x0a, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65,
+ 0x18, 0x02, 0x20, 0x01, 0x28, 0x09, 0x52, 0x06, 0x73, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x42, 0x14,
+ 0x5a, 0x12, 0x67, 0x65, 0x6e, 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73,
+ 0x74, 0x6f, 0x72, 0x65, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_changelist_proto_rawDescOnce sync.Once
+ file_store_changelist_proto_rawDescData = file_store_changelist_proto_rawDesc
+)
+
+func file_store_changelist_proto_rawDescGZIP() []byte {
+ file_store_changelist_proto_rawDescOnce.Do(func() {
+ file_store_changelist_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_changelist_proto_rawDescData)
+ })
+ return file_store_changelist_proto_rawDescData
+}
+
+var file_store_changelist_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_store_changelist_proto_goTypes = []interface{}{
+ (*Changelist)(nil), // 0: bytebase.store.Changelist
+ (*Changelist_Change)(nil), // 1: bytebase.store.Changelist.Change
+}
+var file_store_changelist_proto_depIdxs = []int32{
+ 1, // 0: bytebase.store.Changelist.changes:type_name -> bytebase.store.Changelist.Change
+ 1, // [1:1] is the sub-list for method output_type
+ 1, // [1:1] is the sub-list for method input_type
+ 1, // [1:1] is the sub-list for extension type_name
+ 1, // [1:1] is the sub-list for extension extendee
+ 0, // [0:1] is the sub-list for field type_name
+}
+
+func init() { file_store_changelist_proto_init() }
+func file_store_changelist_proto_init() {
+ if File_store_changelist_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_store_changelist_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Changelist); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_changelist_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Changelist_Change); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_changelist_proto_rawDesc,
+ NumEnums: 0,
+ NumMessages: 2,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_changelist_proto_goTypes,
+ DependencyIndexes: file_store_changelist_proto_depIdxs,
+ MessageInfos: file_store_changelist_proto_msgTypes,
+ }.Build()
+ File_store_changelist_proto = out.File
+ file_store_changelist_proto_rawDesc = nil
+ file_store_changelist_proto_goTypes = nil
+ file_store_changelist_proto_depIdxs = nil
+}
diff --git a/proto/generated-go/store/project.pb.go b/proto/generated-go/store/project.pb.go
new file mode 100644
index 0000000000..e9cbbf2ca3
--- /dev/null
+++ b/proto/generated-go/store/project.pb.go
@@ -0,0 +1,304 @@
+// Code generated by protoc-gen-go. DO NOT EDIT.
+// versions:
+// protoc-gen-go v1.31.0
+// protoc (unknown)
+// source: store/project.proto
+
+package store
+
+import (
+ protoreflect "google.golang.org/protobuf/reflect/protoreflect"
+ protoimpl "google.golang.org/protobuf/runtime/protoimpl"
+ reflect "reflect"
+ sync "sync"
+)
+
+const (
+ // Verify that this generated code is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
+ // Verify that runtime/protoimpl is sufficiently up-to-date.
+ _ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
+)
+
+// The type of target.
+type ProtectionRule_Target int32
+
+const (
+ ProtectionRule_PROTECTION_TARGET_UNSPECIFIED ProtectionRule_Target = 0
+ ProtectionRule_BRANCH ProtectionRule_Target = 1
+ ProtectionRule_CHANGELIST ProtectionRule_Target = 2
+)
+
+// Enum value maps for ProtectionRule_Target.
+var (
+ ProtectionRule_Target_name = map[int32]string{
+ 0: "PROTECTION_TARGET_UNSPECIFIED",
+ 1: "BRANCH",
+ 2: "CHANGELIST",
+ }
+ ProtectionRule_Target_value = map[string]int32{
+ "PROTECTION_TARGET_UNSPECIFIED": 0,
+ "BRANCH": 1,
+ "CHANGELIST": 2,
+ }
+)
+
+func (x ProtectionRule_Target) Enum() *ProtectionRule_Target {
+ p := new(ProtectionRule_Target)
+ *p = x
+ return p
+}
+
+func (x ProtectionRule_Target) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (ProtectionRule_Target) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_project_proto_enumTypes[0].Descriptor()
+}
+
+func (ProtectionRule_Target) Type() protoreflect.EnumType {
+ return &file_store_project_proto_enumTypes[0]
+}
+
+func (x ProtectionRule_Target) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use ProtectionRule_Target.Descriptor instead.
+func (ProtectionRule_Target) EnumDescriptor() ([]byte, []int) {
+ return file_store_project_proto_rawDescGZIP(), []int{1, 0}
+}
+
+type Project struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ ProtectionRules []*ProtectionRule `protobuf:"bytes,1,rep,name=protection_rules,json=protectionRules,proto3" json:"protection_rules,omitempty"`
+}
+
+func (x *Project) Reset() {
+ *x = Project{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_project_proto_msgTypes[0]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *Project) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*Project) ProtoMessage() {}
+
+func (x *Project) ProtoReflect() protoreflect.Message {
+ mi := &file_store_project_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 Project.ProtoReflect.Descriptor instead.
+func (*Project) Descriptor() ([]byte, []int) {
+ return file_store_project_proto_rawDescGZIP(), []int{0}
+}
+
+func (x *Project) GetProtectionRules() []*ProtectionRule {
+ if x != nil {
+ return x.ProtectionRules
+ }
+ return nil
+}
+
+type ProtectionRule struct {
+ state protoimpl.MessageState
+ sizeCache protoimpl.SizeCache
+ unknownFields protoimpl.UnknownFields
+
+ // A unique identifier for a node in UUID format.
+ Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
+ Target ProtectionRule_Target `protobuf:"varint,2,opt,name=target,proto3,enum=bytebase.store.ProtectionRule_Target" json:"target,omitempty"`
+ // The name of the branch/changelist or wildcard.
+ NameFilter string `protobuf:"bytes,3,opt,name=name_filter,json=nameFilter,proto3" json:"name_filter,omitempty"`
+ // The roles allowed to create branches or changelists.
+ CreateAllowedRoles []string `protobuf:"bytes,4,rep,name=create_allowed_roles,json=createAllowedRoles,proto3" json:"create_allowed_roles,omitempty"`
+}
+
+func (x *ProtectionRule) Reset() {
+ *x = ProtectionRule{}
+ if protoimpl.UnsafeEnabled {
+ mi := &file_store_project_proto_msgTypes[1]
+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
+ ms.StoreMessageInfo(mi)
+ }
+}
+
+func (x *ProtectionRule) String() string {
+ return protoimpl.X.MessageStringOf(x)
+}
+
+func (*ProtectionRule) ProtoMessage() {}
+
+func (x *ProtectionRule) ProtoReflect() protoreflect.Message {
+ mi := &file_store_project_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 ProtectionRule.ProtoReflect.Descriptor instead.
+func (*ProtectionRule) Descriptor() ([]byte, []int) {
+ return file_store_project_proto_rawDescGZIP(), []int{1}
+}
+
+func (x *ProtectionRule) GetId() string {
+ if x != nil {
+ return x.Id
+ }
+ return ""
+}
+
+func (x *ProtectionRule) GetTarget() ProtectionRule_Target {
+ if x != nil {
+ return x.Target
+ }
+ return ProtectionRule_PROTECTION_TARGET_UNSPECIFIED
+}
+
+func (x *ProtectionRule) GetNameFilter() string {
+ if x != nil {
+ return x.NameFilter
+ }
+ return ""
+}
+
+func (x *ProtectionRule) GetCreateAllowedRoles() []string {
+ if x != nil {
+ return x.CreateAllowedRoles
+ }
+ return nil
+}
+
+var File_store_project_proto protoreflect.FileDescriptor
+
+var file_store_project_proto_rawDesc = []byte{
+ 0x0a, 0x13, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2f, 0x70, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74, 0x2e,
+ 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x12, 0x0e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,
+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x22, 0x54, 0x0a, 0x07, 0x50, 0x72, 0x6f, 0x6a, 0x65, 0x63, 0x74,
+ 0x12, 0x49, 0x0a, 0x10, 0x70, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x5f, 0x72,
+ 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x1e, 0x2e, 0x62, 0x79, 0x74,
+ 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x50, 0x72, 0x6f, 0x74,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x0f, 0x70, 0x72, 0x6f, 0x74,
+ 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x73, 0x22, 0xfb, 0x01, 0x0a, 0x0e,
+ 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e,
+ 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x3d,
+ 0x0a, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x25,
+ 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e,
+ 0x50, 0x72, 0x6f, 0x74, 0x65, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x75, 0x6c, 0x65, 0x2e, 0x54,
+ 0x61, 0x72, 0x67, 0x65, 0x74, 0x52, 0x06, 0x74, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x1f, 0x0a,
+ 0x0b, 0x6e, 0x61, 0x6d, 0x65, 0x5f, 0x66, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x18, 0x03, 0x20, 0x01,
+ 0x28, 0x09, 0x52, 0x0a, 0x6e, 0x61, 0x6d, 0x65, 0x46, 0x69, 0x6c, 0x74, 0x65, 0x72, 0x12, 0x30,
+ 0x0a, 0x14, 0x63, 0x72, 0x65, 0x61, 0x74, 0x65, 0x5f, 0x61, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64,
+ 0x5f, 0x72, 0x6f, 0x6c, 0x65, 0x73, 0x18, 0x04, 0x20, 0x03, 0x28, 0x09, 0x52, 0x12, 0x63, 0x72,
+ 0x65, 0x61, 0x74, 0x65, 0x41, 0x6c, 0x6c, 0x6f, 0x77, 0x65, 0x64, 0x52, 0x6f, 0x6c, 0x65, 0x73,
+ 0x22, 0x47, 0x0a, 0x06, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x12, 0x21, 0x0a, 0x1d, 0x50, 0x52,
+ 0x4f, 0x54, 0x45, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x54, 0x41, 0x52, 0x47, 0x45, 0x54, 0x5f,
+ 0x55, 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x0a, 0x0a,
+ 0x06, 0x42, 0x52, 0x41, 0x4e, 0x43, 0x48, 0x10, 0x01, 0x12, 0x0e, 0x0a, 0x0a, 0x43, 0x48, 0x41,
+ 0x4e, 0x47, 0x45, 0x4c, 0x49, 0x53, 0x54, 0x10, 0x02, 0x42, 0x14, 0x5a, 0x12, 0x67, 0x65, 0x6e,
+ 0x65, 0x72, 0x61, 0x74, 0x65, 0x64, 0x2d, 0x67, 0x6f, 0x2f, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x62,
+ 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
+}
+
+var (
+ file_store_project_proto_rawDescOnce sync.Once
+ file_store_project_proto_rawDescData = file_store_project_proto_rawDesc
+)
+
+func file_store_project_proto_rawDescGZIP() []byte {
+ file_store_project_proto_rawDescOnce.Do(func() {
+ file_store_project_proto_rawDescData = protoimpl.X.CompressGZIP(file_store_project_proto_rawDescData)
+ })
+ return file_store_project_proto_rawDescData
+}
+
+var file_store_project_proto_enumTypes = make([]protoimpl.EnumInfo, 1)
+var file_store_project_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
+var file_store_project_proto_goTypes = []interface{}{
+ (ProtectionRule_Target)(0), // 0: bytebase.store.ProtectionRule.Target
+ (*Project)(nil), // 1: bytebase.store.Project
+ (*ProtectionRule)(nil), // 2: bytebase.store.ProtectionRule
+}
+var file_store_project_proto_depIdxs = []int32{
+ 2, // 0: bytebase.store.Project.protection_rules:type_name -> bytebase.store.ProtectionRule
+ 0, // 1: bytebase.store.ProtectionRule.target:type_name -> bytebase.store.ProtectionRule.Target
+ 2, // [2:2] is the sub-list for method output_type
+ 2, // [2:2] is the sub-list for method input_type
+ 2, // [2:2] is the sub-list for extension type_name
+ 2, // [2:2] is the sub-list for extension extendee
+ 0, // [0:2] is the sub-list for field type_name
+}
+
+func init() { file_store_project_proto_init() }
+func file_store_project_proto_init() {
+ if File_store_project_proto != nil {
+ return
+ }
+ if !protoimpl.UnsafeEnabled {
+ file_store_project_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*Project); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ file_store_project_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
+ switch v := v.(*ProtectionRule); i {
+ case 0:
+ return &v.state
+ case 1:
+ return &v.sizeCache
+ case 2:
+ return &v.unknownFields
+ default:
+ return nil
+ }
+ }
+ }
+ type x struct{}
+ out := protoimpl.TypeBuilder{
+ File: protoimpl.DescBuilder{
+ GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
+ RawDescriptor: file_store_project_proto_rawDesc,
+ NumEnums: 1,
+ NumMessages: 2,
+ NumExtensions: 0,
+ NumServices: 0,
+ },
+ GoTypes: file_store_project_proto_goTypes,
+ DependencyIndexes: file_store_project_proto_depIdxs,
+ EnumInfos: file_store_project_proto_enumTypes,
+ MessageInfos: file_store_project_proto_msgTypes,
+ }.Build()
+ File_store_project_proto = out.File
+ file_store_project_proto_rawDesc = nil
+ file_store_project_proto_goTypes = nil
+ file_store_project_proto_depIdxs = nil
+}
diff --git a/proto/store/changelist.proto b/proto/store/changelist.proto
new file mode 100644
index 0000000000..3fd6484887
--- /dev/null
+++ b/proto/store/changelist.proto
@@ -0,0 +1,20 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+option go_package = "generated-go/store";
+
+message Changelist {
+ string description = 1;
+
+ message Change {
+ // The name of a sheet.
+ string sheet = 1;
+ // The source of origin.
+ // 1) change history: instances/{instance}/databases/{database}/changeHistories/{changeHistory}.
+ // 2) branch: projects/{project}/schemaDesigns/{schemaDesign}.
+ // 3) raw SQL if empty.
+ string source = 2;
+ }
+ repeated Change changes = 2;
+}
diff --git a/proto/store/project.proto b/proto/store/project.proto
new file mode 100644
index 0000000000..f1d0aca48e
--- /dev/null
+++ b/proto/store/project.proto
@@ -0,0 +1,29 @@
+syntax = "proto3";
+
+package bytebase.store;
+
+option go_package = "generated-go/store";
+
+message Project {
+ repeated ProtectionRule protection_rules = 1;
+}
+
+message ProtectionRule {
+ // A unique identifier for a node in UUID format.
+ string id = 1;
+
+ // The type of target.
+ enum Target {
+ PROTECTION_TARGET_UNSPECIFIED = 0;
+ BRANCH = 1;
+ CHANGELIST = 2;
+ }
+
+ Target target = 2;
+
+ // The name of the branch/changelist or wildcard.
+ string name_filter = 3;
+
+ // The roles allowed to create branches or changelists.
+ repeated string create_allowed_roles = 4;
+}