Database governance built for humans and agents — controlling changes and access across every major database.
Go cicddata-governancedata-maskingdata-securitydatabase-accessdatabase-governancedevopsdevsecopsflywaygitopsliquibasemongodbmysqloraclepostgresqlschema-migrationssecuritysql-clientsqlservertidb
chore(proto): add MaskingExceptionPolicy into proto store (#7782)
h3n4l82bd9aa7305b
diff --git a/frontend/src/types/proto/store/policy.ts b/frontend/src/types/proto/store/policy.tsindex 65796de7d0..0b57291442 100644--- a/frontend/src/types/proto/store/policy.ts+++ b/frontend/src/types/proto/store/policy.ts@@ -45,6 +45,69 @@ export interface MaskData {maskingLevel: MaskingLevel;}+/** MaskingExceptionPolicy is the allowlist of users who can access sensitive data. */+export interface MaskingExceptionPolicy {+ maskingExceptions: MaskingExceptionPolicy_MaskingException[];+}++export interface MaskingExceptionPolicy_MaskingException {+ /** action is the action that the user can access sensitive data. */+ action: MaskingExceptionPolicy_MaskingException_Action;+ /** Level is the masking level that the user can access sensitive data. */+ maskingLevel: MaskingLevel;+ /**+ * Members is the list of principals who bind to this exception policy instance.+ *+ * * `user:{emailid}`: An email address that represents a specific Bytebase account. For example, `[email protected]`.+ */+ members: string[];+ /** The condition that is associated with this exception policy instance. */+ condition?: Expr | undefined;+}++export enum MaskingExceptionPolicy_MaskingException_Action {+ ACTION_UNSPECIFIED = 0,+ QUERY = 1,+ EXPORT = 2,+ UNRECOGNIZED = -1,+}++export function maskingExceptionPolicy_MaskingException_ActionFromJSON(+ object: any,+): MaskingExceptionPolicy_MaskingException_Action {+ switch (object) {+ case 0:+ case "ACTION_UNSPECIFIED":+ return MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED;+ case 1:+ case "QUERY":+ return MaskingExceptionPolicy_MaskingException_Action.QUERY;+ case 2:+ case "EXPORT":+ return MaskingExceptionPolicy_MaskingException_Action.EXPORT;+ case -1:+ case "UNRECOGNIZED":+ default:+ return MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED;+ }+}++export function maskingExceptionPolicy_MaskingException_ActionToJSON(+ object: MaskingExceptionPolicy_MaskingException_Action,+): string {+ switch (object) {+ case MaskingExceptionPolicy_MaskingException_Action.ACTION_UNSPECIFIED:+ return "ACTION_UNSPECIFIED";+ case MaskingExceptionPolicy_MaskingException_Action.QUERY:+ return "QUERY";+ case MaskingExceptionPolicy_MaskingException_Action.EXPORT:+ return "EXPORT";+ case MaskingExceptionPolicy_MaskingException_Action.UNRECOGNIZED:+ default:+ return "UNRECOGNIZED";+ }+}+export interface MaskingRulePolicy {rules: MaskingRulePolicy_MaskingRule[];}@@ -376,6 +439,176 @@ export const MaskData = {},};+function createBaseMaskingExceptionPolicy(): MaskingExceptionPolicy {+ return { maskingExceptions: [] };+}++export const MaskingExceptionPolicy = {+ encode(message: MaskingExceptionPolicy, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ for (const v of message.maskingExceptions) {+ MaskingExceptionPolicy_MaskingException.encode(v!, writer.uint32(10).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): MaskingExceptionPolicy {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseMaskingExceptionPolicy();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 10) {+ break;+ }++ message.maskingExceptions.push(MaskingExceptionPolicy_MaskingException.decode(reader, reader.uint32()));+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): MaskingExceptionPolicy {+ return {+ maskingExceptions: Array.isArray(object?.maskingExceptions)+ ? object.maskingExceptions.map((e: any) => MaskingExceptionPolicy_MaskingException.fromJSON(e))+ : [],+ };+ },++ toJSON(message: MaskingExceptionPolicy): unknown {+ const obj: any = {};+ if (message.maskingExceptions) {+ obj.maskingExceptions = message.maskingExceptions.map((e) =>+ e ? MaskingExceptionPolicy_MaskingException.toJSON(e) : undefined+ );+ } else {+ obj.maskingExceptions = [];+ }+ return obj;+ },++ create(base?: DeepPartial<MaskingExceptionPolicy>): MaskingExceptionPolicy {+ return MaskingExceptionPolicy.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<MaskingExceptionPolicy>): MaskingExceptionPolicy {+ const message = createBaseMaskingExceptionPolicy();+ message.maskingExceptions =+ object.maskingExceptions?.map((e) => MaskingExceptionPolicy_MaskingException.fromPartial(e)) || [];+ return message;+ },+};++function createBaseMaskingExceptionPolicy_MaskingException(): MaskingExceptionPolicy_MaskingException {+ return { action: 0, maskingLevel: 0, members: [], condition: undefined };+}++export const MaskingExceptionPolicy_MaskingException = {+ encode(message: MaskingExceptionPolicy_MaskingException, writer: _m0.Writer = _m0.Writer.create()): _m0.Writer {+ if (message.action !== 0) {+ writer.uint32(8).int32(message.action);+ }+ if (message.maskingLevel !== 0) {+ writer.uint32(16).int32(message.maskingLevel);+ }+ for (const v of message.members) {+ writer.uint32(26).string(v!);+ }+ if (message.condition !== undefined) {+ Expr.encode(message.condition, writer.uint32(34).fork()).ldelim();+ }+ return writer;+ },++ decode(input: _m0.Reader | Uint8Array, length?: number): MaskingExceptionPolicy_MaskingException {+ const reader = input instanceof _m0.Reader ? input : _m0.Reader.create(input);+ let end = length === undefined ? reader.len : reader.pos + length;+ const message = createBaseMaskingExceptionPolicy_MaskingException();+ while (reader.pos < end) {+ const tag = reader.uint32();+ switch (tag >>> 3) {+ case 1:+ if (tag !== 8) {+ break;+ }++ message.action = reader.int32() as any;+ continue;+ case 2:+ if (tag !== 16) {+ break;+ }++ message.maskingLevel = reader.int32() as any;+ continue;+ case 3:+ if (tag !== 26) {+ break;+ }++ message.members.push(reader.string());+ continue;+ case 4:+ if (tag !== 34) {+ break;+ }++ message.condition = Expr.decode(reader, reader.uint32());+ continue;+ }+ if ((tag & 7) === 4 || tag === 0) {+ break;+ }+ reader.skipType(tag & 7);+ }+ return message;+ },++ fromJSON(object: any): MaskingExceptionPolicy_MaskingException {+ return {+ action: isSet(object.action) ? maskingExceptionPolicy_MaskingException_ActionFromJSON(object.action) : 0,+ maskingLevel: isSet(object.maskingLevel) ? maskingLevelFromJSON(object.maskingLevel) : 0,+ members: Array.isArray(object?.members) ? object.members.map((e: any) => String(e)) : [],+ condition: isSet(object.condition) ? Expr.fromJSON(object.condition) : undefined,+ };+ },++ toJSON(message: MaskingExceptionPolicy_MaskingException): unknown {+ const obj: any = {};+ message.action !== undefined && (obj.action = maskingExceptionPolicy_MaskingException_ActionToJSON(message.action));+ message.maskingLevel !== undefined && (obj.maskingLevel = maskingLevelToJSON(message.maskingLevel));+ if (message.members) {+ obj.members = message.members.map((e) => e);+ } else {+ obj.members = [];+ }+ message.condition !== undefined && (obj.condition = message.condition ? Expr.toJSON(message.condition) : undefined);+ return obj;+ },++ create(base?: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {+ return MaskingExceptionPolicy_MaskingException.fromPartial(base ?? {});+ },++ fromPartial(object: DeepPartial<MaskingExceptionPolicy_MaskingException>): MaskingExceptionPolicy_MaskingException {+ const message = createBaseMaskingExceptionPolicy_MaskingException();+ message.action = object.action ?? 0;+ message.maskingLevel = object.maskingLevel ?? 0;+ message.members = object.members?.map((e) => e) || [];+ message.condition = (object.condition !== undefined && object.condition !== null)+ ? Expr.fromPartial(object.condition)+ : undefined;+ return message;+ },+};+function createBaseMaskingRulePolicy(): MaskingRulePolicy {return { rules: [] };}diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.mdindex b144af05dc..de74d5d628 100644--- a/proto/gen/grpc-doc/store/README.md+++ b/proto/gen/grpc-doc/store/README.md@@ -119,10 +119,14 @@- [Binding](#bytebase-store-Binding)- [IamPolicy](#bytebase-store-IamPolicy)- [MaskData](#bytebase-store-MaskData)+ - [MaskingExceptionPolicy](#bytebase-store-MaskingExceptionPolicy)+ - [MaskingExceptionPolicy.MaskingException](#bytebase-store-MaskingExceptionPolicy-MaskingException)- [MaskingPolicy](#bytebase-store-MaskingPolicy)- [MaskingRulePolicy](#bytebase-store-MaskingRulePolicy)- [MaskingRulePolicy.MaskingRule](#bytebase-store-MaskingRulePolicy-MaskingRule)+ - [MaskingExceptionPolicy.MaskingException.Action](#bytebase-store-MaskingExceptionPolicy-MaskingException-Action)+- [store/setting.proto](#store_setting-proto)- [AgentPluginSetting](#bytebase-store-AgentPluginSetting)- [DataClassificationSetting](#bytebase-store-DataClassificationSetting)@@ -1852,6 +1856,41 @@ Reference: https://cloud.google.com/pubsub/docs/reference/rpc/google.iam.v1#bind+<a name="bytebase-store-MaskingExceptionPolicy"></a>++### MaskingExceptionPolicy+MaskingExceptionPolicy is the allowlist of users who can access sensitive data.+++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| masking_exceptions | [MaskingExceptionPolicy.MaskingException](#bytebase-store-MaskingExceptionPolicy-MaskingException) | repeated | |+++++++<a name="bytebase-store-MaskingExceptionPolicy-MaskingException"></a>++### MaskingExceptionPolicy.MaskingException++++| Field | Type | Label | Description |+| ----- | ---- | ----- | ----------- |+| action | [MaskingExceptionPolicy.MaskingException.Action](#bytebase-store-MaskingExceptionPolicy-MaskingException-Action) | | action is the action that the user can access sensitive data. |+| masking_level | [MaskingLevel](#bytebase-store-MaskingLevel) | | Level is the masking level that the user can access sensitive data. |+| members | [string](#string) | repeated | Members is the list of principals who bind to this exception policy instance.++* `user:{emailid}`: An email address that represents a specific Bytebase account. For example, `[email protected]`. |+| condition | [google.type.Expr](#google-type-Expr) | | The condition that is associated with this exception policy instance. |++++++<a name="bytebase-store-MaskingPolicy"></a>### MaskingPolicy@@ -1900,6 +1939,19 @@ Reference: https://cloud.google.com/pubsub/docs/reference/rpc/google.iam.v1#bind++<a name="bytebase-store-MaskingExceptionPolicy-MaskingException-Action"></a>++### MaskingExceptionPolicy.MaskingException.Action+++| Name | Number | Description |+| ---- | ------ | ----------- |+| ACTION_UNSPECIFIED | 0 | |+| QUERY | 1 | |+| EXPORT | 2 | |++diff --git a/proto/generated-go/store/policy.pb.go b/proto/generated-go/store/policy.pb.goindex 870bece58a..96a6ca34a9 100644--- a/proto/generated-go/store/policy.pb.go+++ b/proto/generated-go/store/policy.pb.go@@ -21,6 +21,55 @@ const (_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20))+type MaskingExceptionPolicy_MaskingException_Action int32++const (+ MaskingExceptionPolicy_MaskingException_ACTION_UNSPECIFIED MaskingExceptionPolicy_MaskingException_Action = 0+ MaskingExceptionPolicy_MaskingException_QUERY MaskingExceptionPolicy_MaskingException_Action = 1+ MaskingExceptionPolicy_MaskingException_EXPORT MaskingExceptionPolicy_MaskingException_Action = 2+)++// Enum value maps for MaskingExceptionPolicy_MaskingException_Action.+var (+ MaskingExceptionPolicy_MaskingException_Action_name = map[int32]string{+ 0: "ACTION_UNSPECIFIED",+ 1: "QUERY",+ 2: "EXPORT",+ }+ MaskingExceptionPolicy_MaskingException_Action_value = map[string]int32{+ "ACTION_UNSPECIFIED": 0,+ "QUERY": 1,+ "EXPORT": 2,+ }+)++func (x MaskingExceptionPolicy_MaskingException_Action) Enum() *MaskingExceptionPolicy_MaskingException_Action {+ p := new(MaskingExceptionPolicy_MaskingException_Action)+ *p = x+ return p+}++func (x MaskingExceptionPolicy_MaskingException_Action) String() string {+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))+}++func (MaskingExceptionPolicy_MaskingException_Action) Descriptor() protoreflect.EnumDescriptor {+ return file_store_policy_proto_enumTypes[0].Descriptor()+}++func (MaskingExceptionPolicy_MaskingException_Action) Type() protoreflect.EnumType {+ return &file_store_policy_proto_enumTypes[0]+}++func (x MaskingExceptionPolicy_MaskingException_Action) Number() protoreflect.EnumNumber {+ return protoreflect.EnumNumber(x)+}++// Deprecated: Use MaskingExceptionPolicy_MaskingException_Action.Descriptor instead.+func (MaskingExceptionPolicy_MaskingException_Action) EnumDescriptor() ([]byte, []int) {+ return file_store_policy_proto_rawDescGZIP(), []int{4, 0, 0}+}+type IamPolicy struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -269,6 +318,54 @@ func (x *MaskData) GetMaskingLevel() MaskingLevel {return MaskingLevel_MASKING_LEVEL_UNSPECIFIED}+// MaskingExceptionPolicy is the allowlist of users who can access sensitive data.+type MaskingExceptionPolicy struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ MaskingExceptions []*MaskingExceptionPolicy_MaskingException `protobuf:"bytes,1,rep,name=masking_exceptions,json=maskingExceptions,proto3" json:"masking_exceptions,omitempty"`+}++func (x *MaskingExceptionPolicy) Reset() {+ *x = MaskingExceptionPolicy{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_policy_proto_msgTypes[4]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *MaskingExceptionPolicy) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*MaskingExceptionPolicy) ProtoMessage() {}++func (x *MaskingExceptionPolicy) ProtoReflect() protoreflect.Message {+ mi := &file_store_policy_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 MaskingExceptionPolicy.ProtoReflect.Descriptor instead.+func (*MaskingExceptionPolicy) Descriptor() ([]byte, []int) {+ return file_store_policy_proto_rawDescGZIP(), []int{4}+}++func (x *MaskingExceptionPolicy) GetMaskingExceptions() []*MaskingExceptionPolicy_MaskingException {+ if x != nil {+ return x.MaskingExceptions+ }+ return nil+}+type MaskingRulePolicy struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -280,7 +377,7 @@ type MaskingRulePolicy struct {func (x *MaskingRulePolicy) Reset() {*x = MaskingRulePolicy{}if protoimpl.UnsafeEnabled {- mi := &file_store_policy_proto_msgTypes[4]+ mi := &file_store_policy_proto_msgTypes[5]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -293,7 +390,7 @@ func (x *MaskingRulePolicy) String() string {func (*MaskingRulePolicy) ProtoMessage() {}func (x *MaskingRulePolicy) ProtoReflect() protoreflect.Message {- mi := &file_store_policy_proto_msgTypes[4]+ mi := &file_store_policy_proto_msgTypes[5]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -306,7 +403,7 @@ func (x *MaskingRulePolicy) ProtoReflect() protoreflect.Message {// Deprecated: Use MaskingRulePolicy.ProtoReflect.Descriptor instead.func (*MaskingRulePolicy) Descriptor() ([]byte, []int) {- return file_store_policy_proto_rawDescGZIP(), []int{4}+ return file_store_policy_proto_rawDescGZIP(), []int{5}}func (x *MaskingRulePolicy) GetRules() []*MaskingRulePolicy_MaskingRule {@@ -316,6 +413,83 @@ func (x *MaskingRulePolicy) GetRules() []*MaskingRulePolicy_MaskingRule {return nil}+type MaskingExceptionPolicy_MaskingException struct {+ state protoimpl.MessageState+ sizeCache protoimpl.SizeCache+ unknownFields protoimpl.UnknownFields++ // action is the action that the user can access sensitive data.+ Action MaskingExceptionPolicy_MaskingException_Action `protobuf:"varint,1,opt,name=action,proto3,enum=bytebase.store.MaskingExceptionPolicy_MaskingException_Action" json:"action,omitempty"`+ // Level is the masking level that the user can access sensitive data.+ MaskingLevel MaskingLevel `protobuf:"varint,2,opt,name=masking_level,json=maskingLevel,proto3,enum=bytebase.store.MaskingLevel" json:"masking_level,omitempty"`+ // Members is the list of principals who bind to this exception policy instance.+ //+ // * `user:{emailid}`: An email address that represents a specific Bytebase account. For example, `[email protected]`.+ Members []string `protobuf:"bytes,3,rep,name=members,proto3" json:"members,omitempty"`+ // The condition that is associated with this exception policy instance.+ Condition *expr.Expr `protobuf:"bytes,4,opt,name=condition,proto3" json:"condition,omitempty"`+}++func (x *MaskingExceptionPolicy_MaskingException) Reset() {+ *x = MaskingExceptionPolicy_MaskingException{}+ if protoimpl.UnsafeEnabled {+ mi := &file_store_policy_proto_msgTypes[6]+ ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))+ ms.StoreMessageInfo(mi)+ }+}++func (x *MaskingExceptionPolicy_MaskingException) String() string {+ return protoimpl.X.MessageStringOf(x)+}++func (*MaskingExceptionPolicy_MaskingException) ProtoMessage() {}++func (x *MaskingExceptionPolicy_MaskingException) ProtoReflect() protoreflect.Message {+ mi := &file_store_policy_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 MaskingExceptionPolicy_MaskingException.ProtoReflect.Descriptor instead.+func (*MaskingExceptionPolicy_MaskingException) Descriptor() ([]byte, []int) {+ return file_store_policy_proto_rawDescGZIP(), []int{4, 0}+}++func (x *MaskingExceptionPolicy_MaskingException) GetAction() MaskingExceptionPolicy_MaskingException_Action {+ if x != nil {+ return x.Action+ }+ return MaskingExceptionPolicy_MaskingException_ACTION_UNSPECIFIED+}++func (x *MaskingExceptionPolicy_MaskingException) GetMaskingLevel() MaskingLevel {+ if x != nil {+ return x.MaskingLevel+ }+ return MaskingLevel_MASKING_LEVEL_UNSPECIFIED+}++func (x *MaskingExceptionPolicy_MaskingException) GetMembers() []string {+ if x != nil {+ return x.Members+ }+ return nil+}++func (x *MaskingExceptionPolicy_MaskingException) GetCondition() *expr.Expr {+ if x != nil {+ return x.Condition+ }+ return nil+}+type MaskingRulePolicy_MaskingRule struct {state protoimpl.MessageStatesizeCache protoimpl.SizeCache@@ -330,7 +504,7 @@ type MaskingRulePolicy_MaskingRule struct {func (x *MaskingRulePolicy_MaskingRule) Reset() {*x = MaskingRulePolicy_MaskingRule{}if protoimpl.UnsafeEnabled {- mi := &file_store_policy_proto_msgTypes[5]+ mi := &file_store_policy_proto_msgTypes[7]ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))ms.StoreMessageInfo(mi)}@@ -343,7 +517,7 @@ func (x *MaskingRulePolicy_MaskingRule) String() string {func (*MaskingRulePolicy_MaskingRule) ProtoMessage() {}func (x *MaskingRulePolicy_MaskingRule) ProtoReflect() protoreflect.Message {- mi := &file_store_policy_proto_msgTypes[5]+ mi := &file_store_policy_proto_msgTypes[7]if protoimpl.UnsafeEnabled && x != nil {ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))if ms.LoadMessageInfo() == nil {@@ -356,7 +530,7 @@ func (x *MaskingRulePolicy_MaskingRule) ProtoReflect() protoreflect.Message {// Deprecated: Use MaskingRulePolicy_MaskingRule.ProtoReflect.Descriptor instead.func (*MaskingRulePolicy_MaskingRule) Descriptor() ([]byte, []int) {- return file_store_policy_proto_rawDescGZIP(), []int{4, 0}+ return file_store_policy_proto_rawDescGZIP(), []int{5, 0}}func (x *MaskingRulePolicy_MaskingRule) GetId() string {@@ -415,24 +589,51 @@ var file_store_policy_proto_rawDesc = []byte{0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x05, 0x20, 0x01, 0x28, 0x0e,0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72,0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c,- 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xec, 0x01, 0x0a,- 0x11, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69,- 0x63, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28,- 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f,- 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f,- 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65,- 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x91, 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x73, 0x6b,- 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e, 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20,- 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69,- 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f,- 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63,- 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b,- 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32,- 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65,- 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d,- 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 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,+ 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x22, 0xb4, 0x03, 0x0a,+ 0x16, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f,+ 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x66, 0x0a, 0x12, 0x6d, 0x61, 0x73, 0x6b, 0x69,+ 0x6e, 0x67, 0x5f, 0x65, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x18, 0x01, 0x20,+ 0x03, 0x28, 0x0b, 0x32, 0x37, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65,+ 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b,+ 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x11, 0x6d, 0x61,+ 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x73, 0x1a,+ 0xb1, 0x02, 0x0a, 0x10, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70,+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x56, 0x0a, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x01,+ 0x20, 0x01, 0x28, 0x0e, 0x32, 0x3e, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e,+ 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63,+ 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73,+ 0x6b, 0x69, 0x6e, 0x67, 0x45, 0x78, 0x63, 0x65, 0x70, 0x74, 0x69, 0x6f, 0x6e, 0x2e, 0x41, 0x63,+ 0x74, 0x69, 0x6f, 0x6e, 0x52, 0x06, 0x61, 0x63, 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x41, 0x0a, 0x0d,+ 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c, 0x18, 0x02, 0x20,+ 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73, 0x65, 0x2e, 0x73,+ 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65,+ 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76, 0x65, 0x6c, 0x12,+ 0x18, 0x0a, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x18, 0x03, 0x20, 0x03, 0x28, 0x09,+ 0x52, 0x07, 0x6d, 0x65, 0x6d, 0x62, 0x65, 0x72, 0x73, 0x12, 0x2f, 0x0a, 0x09, 0x63, 0x6f, 0x6e,+ 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x04, 0x20, 0x01, 0x28, 0x0b, 0x32, 0x11, 0x2e, 0x67,+ 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e, 0x45, 0x78, 0x70, 0x72, 0x52,+ 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x22, 0x37, 0x0a, 0x06, 0x41, 0x63,+ 0x74, 0x69, 0x6f, 0x6e, 0x12, 0x16, 0x0a, 0x12, 0x41, 0x43, 0x54, 0x49, 0x4f, 0x4e, 0x5f, 0x55,+ 0x4e, 0x53, 0x50, 0x45, 0x43, 0x49, 0x46, 0x49, 0x45, 0x44, 0x10, 0x00, 0x12, 0x09, 0x0a, 0x05,+ 0x51, 0x55, 0x45, 0x52, 0x59, 0x10, 0x01, 0x12, 0x0a, 0x0a, 0x06, 0x45, 0x58, 0x50, 0x4f, 0x52,+ 0x54, 0x10, 0x02, 0x22, 0xec, 0x01, 0x0a, 0x11, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52,+ 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x12, 0x43, 0x0a, 0x05, 0x72, 0x75, 0x6c,+ 0x65, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x2d, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62,+ 0x61, 0x73, 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e,+ 0x67, 0x52, 0x75, 0x6c, 0x65, 0x50, 0x6f, 0x6c, 0x69, 0x63, 0x79, 0x2e, 0x4d, 0x61, 0x73, 0x6b,+ 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x52, 0x05, 0x72, 0x75, 0x6c, 0x65, 0x73, 0x1a, 0x91,+ 0x01, 0x0a, 0x0b, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x52, 0x75, 0x6c, 0x65, 0x12, 0x0e,+ 0x0a, 0x02, 0x69, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x09, 0x52, 0x02, 0x69, 0x64, 0x12, 0x2f,+ 0x0a, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x18, 0x02, 0x20, 0x01, 0x28,+ 0x0b, 0x32, 0x11, 0x2e, 0x67, 0x6f, 0x6f, 0x67, 0x6c, 0x65, 0x2e, 0x74, 0x79, 0x70, 0x65, 0x2e,+ 0x45, 0x78, 0x70, 0x72, 0x52, 0x09, 0x63, 0x6f, 0x6e, 0x64, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x12,+ 0x41, 0x0a, 0x0d, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x5f, 0x6c, 0x65, 0x76, 0x65, 0x6c,+ 0x18, 0x03, 0x20, 0x01, 0x28, 0x0e, 0x32, 0x1c, 0x2e, 0x62, 0x79, 0x74, 0x65, 0x62, 0x61, 0x73,+ 0x65, 0x2e, 0x73, 0x74, 0x6f, 0x72, 0x65, 0x2e, 0x4d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c,+ 0x65, 0x76, 0x65, 0x6c, 0x52, 0x0c, 0x6d, 0x61, 0x73, 0x6b, 0x69, 0x6e, 0x67, 0x4c, 0x65, 0x76,+ 0x65, 0x6c, 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 (@@ -447,30 +648,38 @@ func file_store_policy_proto_rawDescGZIP() []byte {return file_store_policy_proto_rawDescData}-var file_store_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 6)+var file_store_policy_proto_enumTypes = make([]protoimpl.EnumInfo, 1)+var file_store_policy_proto_msgTypes = make([]protoimpl.MessageInfo, 8)var file_store_policy_proto_goTypes = []interface{}{- (*IamPolicy)(nil), // 0: bytebase.store.IamPolicy- (*Binding)(nil), // 1: bytebase.store.Binding- (*MaskingPolicy)(nil), // 2: bytebase.store.MaskingPolicy- (*MaskData)(nil), // 3: bytebase.store.MaskData- (*MaskingRulePolicy)(nil), // 4: bytebase.store.MaskingRulePolicy- (*MaskingRulePolicy_MaskingRule)(nil), // 5: bytebase.store.MaskingRulePolicy.MaskingRule- (*expr.Expr)(nil), // 6: google.type.Expr- (MaskingLevel)(0), // 7: bytebase.store.MaskingLevel+ (MaskingExceptionPolicy_MaskingException_Action)(0), // 0: bytebase.store.MaskingExceptionPolicy.MaskingException.Action+ (*IamPolicy)(nil), // 1: bytebase.store.IamPolicy+ (*Binding)(nil), // 2: bytebase.store.Binding+ (*MaskingPolicy)(nil), // 3: bytebase.store.MaskingPolicy+ (*MaskData)(nil), // 4: bytebase.store.MaskData+ (*MaskingExceptionPolicy)(nil), // 5: bytebase.store.MaskingExceptionPolicy+ (*MaskingRulePolicy)(nil), // 6: bytebase.store.MaskingRulePolicy+ (*MaskingExceptionPolicy_MaskingException)(nil), // 7: bytebase.store.MaskingExceptionPolicy.MaskingException+ (*MaskingRulePolicy_MaskingRule)(nil), // 8: bytebase.store.MaskingRulePolicy.MaskingRule+ (*expr.Expr)(nil), // 9: google.type.Expr+ (MaskingLevel)(0), // 10: bytebase.store.MaskingLevel}var file_store_policy_proto_depIdxs = []int32{- 1, // 0: bytebase.store.IamPolicy.bindings:type_name -> bytebase.store.Binding- 6, // 1: bytebase.store.Binding.condition:type_name -> google.type.Expr- 3, // 2: bytebase.store.MaskingPolicy.mask_data:type_name -> bytebase.store.MaskData- 7, // 3: bytebase.store.MaskData.masking_level:type_name -> bytebase.store.MaskingLevel- 5, // 4: bytebase.store.MaskingRulePolicy.rules:type_name -> bytebase.store.MaskingRulePolicy.MaskingRule- 6, // 5: bytebase.store.MaskingRulePolicy.MaskingRule.condition:type_name -> google.type.Expr- 7, // 6: bytebase.store.MaskingRulePolicy.MaskingRule.masking_level:type_name -> bytebase.store.MaskingLevel- 7, // [7:7] is the sub-list for method output_type- 7, // [7:7] 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+ 2, // 0: bytebase.store.IamPolicy.bindings:type_name -> bytebase.store.Binding+ 9, // 1: bytebase.store.Binding.condition:type_name -> google.type.Expr+ 4, // 2: bytebase.store.MaskingPolicy.mask_data:type_name -> bytebase.store.MaskData+ 10, // 3: bytebase.store.MaskData.masking_level:type_name -> bytebase.store.MaskingLevel+ 7, // 4: bytebase.store.MaskingExceptionPolicy.masking_exceptions:type_name -> bytebase.store.MaskingExceptionPolicy.MaskingException+ 8, // 5: bytebase.store.MaskingRulePolicy.rules:type_name -> bytebase.store.MaskingRulePolicy.MaskingRule+ 0, // 6: bytebase.store.MaskingExceptionPolicy.MaskingException.action:type_name -> bytebase.store.MaskingExceptionPolicy.MaskingException.Action+ 10, // 7: bytebase.store.MaskingExceptionPolicy.MaskingException.masking_level:type_name -> bytebase.store.MaskingLevel+ 9, // 8: bytebase.store.MaskingExceptionPolicy.MaskingException.condition:type_name -> google.type.Expr+ 9, // 9: bytebase.store.MaskingRulePolicy.MaskingRule.condition:type_name -> google.type.Expr+ 10, // 10: bytebase.store.MaskingRulePolicy.MaskingRule.masking_level:type_name -> bytebase.store.MaskingLevel+ 11, // [11:11] is the sub-list for method output_type+ 11, // [11:11] is the sub-list for method input_type+ 11, // [11:11] is the sub-list for extension type_name+ 11, // [11:11] is the sub-list for extension extendee+ 0, // [0:11] is the sub-list for field type_name}func init() { file_store_policy_proto_init() }@@ -529,7 +738,7 @@ func file_store_policy_proto_init() {}}file_store_policy_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {- switch v := v.(*MaskingRulePolicy); i {+ switch v := v.(*MaskingExceptionPolicy); i {case 0:return &v.statecase 1:@@ -541,6 +750,30 @@ func file_store_policy_proto_init() {}}file_store_policy_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*MaskingRulePolicy); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_policy_proto_msgTypes[6].Exporter = func(v interface{}, i int) interface{} {+ switch v := v.(*MaskingExceptionPolicy_MaskingException); i {+ case 0:+ return &v.state+ case 1:+ return &v.sizeCache+ case 2:+ return &v.unknownFields+ default:+ return nil+ }+ }+ file_store_policy_proto_msgTypes[7].Exporter = func(v interface{}, i int) interface{} {switch v := v.(*MaskingRulePolicy_MaskingRule); i {case 0:return &v.state@@ -558,13 +791,14 @@ func file_store_policy_proto_init() {File: protoimpl.DescBuilder{GoPackagePath: reflect.TypeOf(x{}).PkgPath(),RawDescriptor: file_store_policy_proto_rawDesc,- NumEnums: 0,- NumMessages: 6,+ NumEnums: 1,+ NumMessages: 8,NumExtensions: 0,NumServices: 0,},GoTypes: file_store_policy_proto_goTypes,DependencyIndexes: file_store_policy_proto_depIdxs,+ EnumInfos: file_store_policy_proto_enumTypes,MessageInfos: file_store_policy_proto_msgTypes,}.Build()File_store_policy_proto = out.Filediff --git a/proto/store/policy.proto b/proto/store/policy.protoindex 1e460d2625..bae313c04c 100644--- a/proto/store/policy.proto+++ b/proto/store/policy.proto@@ -43,6 +43,32 @@ message MaskData {MaskingLevel masking_level = 5;}+// MaskingExceptionPolicy is the allowlist of users who can access sensitive data.+message MaskingExceptionPolicy {+ message MaskingException {+ enum Action {+ ACTION_UNSPECIFIED = 0;+ QUERY = 1;+ EXPORT = 2;+ }+ // action is the action that the user can access sensitive data.+ Action action = 1;++ // Level is the masking level that the user can access sensitive data.+ MaskingLevel masking_level = 2;++ // Members is the list of principals who bind to this exception policy instance.+ //+ // * `user:{emailid}`: An email address that represents a specific Bytebase account. For example, `[email protected]`.+ repeated string members = 3;++ // The condition that is associated with this exception policy instance.+ google.type.Expr condition = 4;+ }++ repeated MaskingException masking_exceptions = 1;+}+message MaskingRulePolicy {message MaskingRule {// A unique identifier for a node in UUID format.