Skip to content

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

chore: instance feature proto (#16480)

Danny Xu9b4c5a7f9513
diff --git a/backend/enterprise/api/plan.yaml b/backend/enterprise/api/plan.yaml
index 0558916dec..2880d16116 100644
--- a/backend/enterprise/api/plan.yaml
+++ b/backend/enterprise/api/plan.yaml
@@ -173,4 +173,11 @@ plans:
- FEATURE_WATERMARK
- FEATURE_ROADMAP_PRIORITIZATION
- FEATURE_CUSTOM_MSA
- - FEATURE_DEDICATED_SUPPORT_WITH_SLA
\ No newline at end of file
+ - FEATURE_DEDICATED_SUPPORT_WITH_SLA
+instanceFeatures:
+ - FEATURE_DATA_MASKING
+ - FEATURE_DATABASE_SECRET_VARIABLES
+ - FEATURE_INSTANCE_READ_ONLY_CONNECTION
+ - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
+ - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
+ - FEATURE_EXTERNAL_SECRET_MANAGER
\ No newline at end of file
diff --git a/frontend/src/types/proto/v1/subscription_service.ts b/frontend/src/types/proto/v1/subscription_service.ts
index 75130498b1..2f3f1e0550 100644
--- a/frontend/src/types/proto/v1/subscription_service.ts
+++ b/frontend/src/types/proto/v1/subscription_service.ts
@@ -734,6 +734,7 @@ export interface Feature_MatrixEntry {
/** PlanConfig represents the configuration for all plans loaded from plan.yaml */
export interface PlanConfig {
plans: PlanLimitConfig[];
+ instanceFeatures: PlanFeature[];
}
/** PlanLimitConfig represents a single plan's configuration */
@@ -1311,7 +1312,7 @@ export const Feature_MatrixEntry: MessageFns<Feature_MatrixEntry> = {
};
function createBasePlanConfig(): PlanConfig {
- return { plans: [] };
+ return { plans: [], instanceFeatures: [] };
}
export const PlanConfig: MessageFns<PlanConfig> = {
@@ -1319,6 +1320,11 @@ export const PlanConfig: MessageFns<PlanConfig> = {
for (const v of message.plans) {
PlanLimitConfig.encode(v!, writer.uint32(10).fork()).join();
}
+ writer.uint32(18).fork();
+ for (const v of message.instanceFeatures) {
+ writer.int32(planFeatureToNumber(v));
+ }
+ writer.join();
return writer;
},
@@ -1337,6 +1343,24 @@ export const PlanConfig: MessageFns<PlanConfig> = {
message.plans.push(PlanLimitConfig.decode(reader, reader.uint32()));
continue;
}
+ case 2: {
+ if (tag === 16) {
+ message.instanceFeatures.push(planFeatureFromJSON(reader.int32()));
+
+ continue;
+ }
+
+ if (tag === 18) {
+ const end2 = reader.uint32() + reader.pos;
+ while (reader.pos < end2) {
+ message.instanceFeatures.push(planFeatureFromJSON(reader.int32()));
+ }
+
+ continue;
+ }
+
+ break;
+ }
}
if ((tag & 7) === 4 || tag === 0) {
break;
@@ -1351,6 +1375,9 @@ export const PlanConfig: MessageFns<PlanConfig> = {
if (message.plans?.length) {
obj.plans = message.plans.map((e) => PlanLimitConfig.toJSON(e));
}
+ if (message.instanceFeatures?.length) {
+ obj.instanceFeatures = message.instanceFeatures.map((e) => planFeatureToJSON(e));
+ }
return obj;
},
@@ -1360,6 +1387,7 @@ export const PlanConfig: MessageFns<PlanConfig> = {
fromPartial(object: DeepPartial<PlanConfig>): PlanConfig {
const message = createBasePlanConfig();
message.plans = object.plans?.map((e) => PlanLimitConfig.fromPartial(e)) || [];
+ message.instanceFeatures = object.instanceFeatures?.map((e) => e) || [];
return message;
},
};
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index c7b94d7899..0b4f53df73 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -4015,6 +4015,7 @@ PlanConfig represents the configuration for all plans loaded from plan.yaml
| Field | Type | Label | Description |
| ----- | ---- | ----- | ----------- |
| plans | [PlanLimitConfig](#bytebase-v1-PlanLimitConfig) | repeated | |
+| instance_features | [PlanFeature](#bytebase-v1-PlanFeature) | repeated | |
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 8807e23205..2fd6ca59d5 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -11961,6 +11961,13 @@ The access is based on approval flow.</p></td>
<td><p> </p></td>
</tr>
+ <tr>
+ <td>instance_features</td>
+ <td><a href="#bytebase.v1.PlanFeature">PlanFeature</a></td>
+ <td>repeated</td>
+ <td><p> </p></td>
+ </tr>
+
</tbody>
</table>
diff --git a/proto/generated-go/v1/subscription_service.pb.go b/proto/generated-go/v1/subscription_service.pb.go
index 0f339cd3e1..6839b91fa7 100644
--- a/proto/generated-go/v1/subscription_service.pb.go
+++ b/proto/generated-go/v1/subscription_service.pb.go
@@ -699,10 +699,11 @@ func (x *Feature) GetMatrix() map[string]bool {
// PlanConfig represents the configuration for all plans loaded from plan.yaml
type PlanConfig struct {
- state protoimpl.MessageState `protogen:"open.v1"`
- Plans []*PlanLimitConfig `protobuf:"bytes,1,rep,name=plans,proto3" json:"plans,omitempty"`
- unknownFields protoimpl.UnknownFields
- sizeCache protoimpl.SizeCache
+ state protoimpl.MessageState `protogen:"open.v1"`
+ Plans []*PlanLimitConfig `protobuf:"bytes,1,rep,name=plans,proto3" json:"plans,omitempty"`
+ InstanceFeatures []PlanFeature `protobuf:"varint,2,rep,packed,name=instance_features,json=instanceFeatures,proto3,enum=bytebase.v1.PlanFeature" json:"instance_features,omitempty"`
+ unknownFields protoimpl.UnknownFields
+ sizeCache protoimpl.SizeCache
}
func (x *PlanConfig) Reset() {
@@ -742,6 +743,13 @@ func (x *PlanConfig) GetPlans() []*PlanLimitConfig {
return nil
}
+func (x *PlanConfig) GetInstanceFeatures() []PlanFeature {
+ if x != nil {
+ return x.InstanceFeatures
+ }
+ return nil
+}
+
// PlanLimitConfig represents a single plan's configuration
type PlanLimitConfig struct {
state protoimpl.MessageState `protogen:"open.v1"`
@@ -839,10 +847,11 @@ const file_v1_subscription_service_proto_rawDesc = "" +
"\x06matrix\x18\x02 \x03(\v2 .bytebase.v1.Feature.MatrixEntryR\x06matrix\x1a9\n" +
"\vMatrixEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
- "\x05value\x18\x02 \x01(\bR\x05value:\x028\x01\"@\n" +
+ "\x05value\x18\x02 \x01(\bR\x05value:\x028\x01\"\x87\x01\n" +
"\n" +
"PlanConfig\x122\n" +
- "\x05plans\x18\x01 \x03(\v2\x1c.bytebase.v1.PlanLimitConfigR\x05plans\"\xd6\x01\n" +
+ "\x05plans\x18\x01 \x03(\v2\x1c.bytebase.v1.PlanLimitConfigR\x05plans\x12E\n" +
+ "\x11instance_features\x18\x02 \x03(\x0e2\x18.bytebase.v1.PlanFeatureR\x10instanceFeatures\"\xd6\x01\n" +
"\x0fPlanLimitConfig\x12)\n" +
"\x04type\x18\x01 \x01(\x0e2\x15.bytebase.v1.PlanTypeR\x04type\x124\n" +
"\x16maximum_instance_count\x18\x02 \x01(\x05R\x14maximumInstanceCount\x12,\n" +
@@ -971,19 +980,20 @@ var file_v1_subscription_service_proto_depIdxs = []int32{
8, // 4: bytebase.v1.FeatureMatrix.features:type_name -> bytebase.v1.Feature
11, // 5: bytebase.v1.Feature.matrix:type_name -> bytebase.v1.Feature.MatrixEntry
10, // 6: bytebase.v1.PlanConfig.plans:type_name -> bytebase.v1.PlanLimitConfig
- 0, // 7: bytebase.v1.PlanLimitConfig.type:type_name -> bytebase.v1.PlanType
- 1, // 8: bytebase.v1.PlanLimitConfig.features:type_name -> bytebase.v1.PlanFeature
- 2, // 9: bytebase.v1.SubscriptionService.GetSubscription:input_type -> bytebase.v1.GetSubscriptionRequest
- 3, // 10: bytebase.v1.SubscriptionService.GetFeatureMatrix:input_type -> bytebase.v1.GetFeatureMatrixRequest
- 4, // 11: bytebase.v1.SubscriptionService.UpdateSubscription:input_type -> bytebase.v1.UpdateSubscriptionRequest
- 6, // 12: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription
- 7, // 13: bytebase.v1.SubscriptionService.GetFeatureMatrix:output_type -> bytebase.v1.FeatureMatrix
- 6, // 14: bytebase.v1.SubscriptionService.UpdateSubscription:output_type -> bytebase.v1.Subscription
- 12, // [12:15] is the sub-list for method output_type
- 9, // [9:12] is the sub-list for method input_type
- 9, // [9:9] is the sub-list for extension type_name
- 9, // [9:9] is the sub-list for extension extendee
- 0, // [0:9] is the sub-list for field type_name
+ 1, // 7: bytebase.v1.PlanConfig.instance_features:type_name -> bytebase.v1.PlanFeature
+ 0, // 8: bytebase.v1.PlanLimitConfig.type:type_name -> bytebase.v1.PlanType
+ 1, // 9: bytebase.v1.PlanLimitConfig.features:type_name -> bytebase.v1.PlanFeature
+ 2, // 10: bytebase.v1.SubscriptionService.GetSubscription:input_type -> bytebase.v1.GetSubscriptionRequest
+ 3, // 11: bytebase.v1.SubscriptionService.GetFeatureMatrix:input_type -> bytebase.v1.GetFeatureMatrixRequest
+ 4, // 12: bytebase.v1.SubscriptionService.UpdateSubscription:input_type -> bytebase.v1.UpdateSubscriptionRequest
+ 6, // 13: bytebase.v1.SubscriptionService.GetSubscription:output_type -> bytebase.v1.Subscription
+ 7, // 14: bytebase.v1.SubscriptionService.GetFeatureMatrix:output_type -> bytebase.v1.FeatureMatrix
+ 6, // 15: bytebase.v1.SubscriptionService.UpdateSubscription:output_type -> bytebase.v1.Subscription
+ 13, // [13:16] is the sub-list for method output_type
+ 10, // [10:13] is the sub-list for method input_type
+ 10, // [10:10] is the sub-list for extension type_name
+ 10, // [10:10] is the sub-list for extension extendee
+ 0, // [0:10] is the sub-list for field type_name
}
func init() { file_v1_subscription_service_proto_init() }
diff --git a/proto/v1/v1/subscription_service.proto b/proto/v1/v1/subscription_service.proto
index ab97550a7a..2cac998bfd 100644
--- a/proto/v1/v1/subscription_service.proto
+++ b/proto/v1/v1/subscription_service.proto
@@ -174,6 +174,7 @@ enum PlanFeature {
// PlanConfig represents the configuration for all plans loaded from plan.yaml
message PlanConfig {
repeated PlanLimitConfig plans = 1;
+ repeated PlanFeature instance_features = 2;
}
// PlanLimitConfig represents a single plan's configuration