Skip to content

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

chore: external secret manager effective based on instance license (#16515)

Danny Xu23edbd249590
diff --git a/backend/api/v1/auth_service.go b/backend/api/v1/auth_service.go
index 51581a17c6..b0093747d8 100644
--- a/backend/api/v1/auth_service.go
+++ b/backend/api/v1/auth_service.go
@@ -395,6 +395,9 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
}
if user != nil {
if user.MemberDeleted {
+ if err := s.userCountGuard(ctx); err != nil {
+ return nil, err
+ }
// Undelete the user when login via SSO.
user, err = s.store.UpdateUser(ctx, user, &store.UpdateUserMessage{Delete: &undeletePatch})
if err != nil {
@@ -411,7 +414,12 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
return user, nil
}
- if err := s.licenseService.IsFeatureEnabled(v1pb.PlanFeature_FEATURE_ENTERPRISE_SSO); err != nil {
+ // For expired license, we will only block new create creation and still allow SSO login from existing users.
+ featurePlan := v1pb.PlanFeature_FEATURE_ENTERPRISE_SSO
+ if idp.Type == storepb.IdentityProviderType_OAUTH2 && googleGitHubDomains[idp.Domain] {
+ featurePlan = v1pb.PlanFeature_FEATURE_GOOGLE_AND_GITHUB_SSO
+ }
+ if err := s.licenseService.IsFeatureEnabled(featurePlan); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
// Create new user from identity provider.
@@ -423,6 +431,9 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate password hash")
}
+ if err := s.userCountGuard(ctx); err != nil {
+ return nil, err
+ }
newUser, err := s.store.CreateUser(ctx, &store.UserMessage{
Name: userInfo.DisplayName,
Email: email,
@@ -443,6 +454,19 @@ func (s *AuthService) getOrCreateUserWithIDP(ctx context.Context, request *v1pb.
return newUser, nil
}
+func (s *AuthService) userCountGuard(ctx context.Context) error {
+ userLimit := s.licenseService.GetUserLimit(ctx)
+
+ count, err := s.store.CountActiveUsers(ctx)
+ if err != nil {
+ return status.Error(codes.Internal, err.Error())
+ }
+ if count >= userLimit {
+ return status.Errorf(codes.ResourceExhausted, "reached the maximum user count %d", userLimit)
+ }
+ return nil
+}
+
func challengeMFACode(user *store.UserMessage, mfaCode string) error {
if !validateWithCodeAndSecret(mfaCode, user.MFAConfig.OtpSecret) {
return status.Errorf(codes.Unauthenticated, "invalid MFA code")
diff --git a/backend/api/v1/idp_service.go b/backend/api/v1/idp_service.go
index e5f308a5a1..0c75f4ef2c 100644
--- a/backend/api/v1/idp_service.go
+++ b/backend/api/v1/idp_service.go
@@ -204,12 +204,11 @@ var googleGitHubDomains = map[string]bool{
}
func (s *IdentityProviderService) checkFeatureAvailable(idp *v1pb.IdentityProvider) error {
+ featurePlan := v1pb.PlanFeature_FEATURE_ENTERPRISE_SSO
if idp.Type == v1pb.IdentityProviderType_OAUTH2 && googleGitHubDomains[idp.Domain] {
- if err := s.licenseService.IsFeatureEnabled(v1pb.PlanFeature_FEATURE_GOOGLE_AND_GITHUB_SSO); err != nil {
- return status.Error(codes.PermissionDenied, err.Error())
- }
+ featurePlan = v1pb.PlanFeature_FEATURE_GOOGLE_AND_GITHUB_SSO
}
- if err := s.licenseService.IsFeatureEnabled(v1pb.PlanFeature_FEATURE_ENTERPRISE_SSO); err != nil {
+ if err := s.licenseService.IsFeatureEnabled(featurePlan); err != nil {
return status.Error(codes.PermissionDenied, err.Error())
}
return nil
diff --git a/backend/api/v1/sql_service.go b/backend/api/v1/sql_service.go
index ae2fefa3ae..858e712852 100644
--- a/backend/api/v1/sql_service.go
+++ b/backend/api/v1/sql_service.go
@@ -174,7 +174,7 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
}
}
- dataSource, err := checkAndGetDataSourceQueriable(ctx, s.store, database, request.DataSourceId)
+ dataSource, err := checkAndGetDataSourceQueriable(ctx, s.store, s.licenseService, database, request.DataSourceId)
if err != nil {
return nil, err
}
@@ -198,7 +198,10 @@ func (s *SQLService) Query(ctx context.Context, request *v1pb.QueryRequest) (*v1
defer conn.Close()
}
- maximumSQLResultSize := s.store.GetMaximumSQLResultLimit(ctx)
+ maximumSQLResultSize := common.DefaultMaximumSQLResultSize
+ if err := s.licenseService.IsFeatureEnabled(v1pb.PlanFeature_FEATURE_QUERY_POLICY); err == nil {
+ maximumSQLResultSize = s.store.GetMaximumSQLResultLimit(ctx)
+ }
queryContext := db.QueryContext{
Explain: request.Explain,
Limit: int(request.Limit),
@@ -729,7 +732,7 @@ func (s *SQLService) Export(ctx context.Context, request *v1pb.ExportRequest) (*
}
}
- dataSource, err := checkAndGetDataSourceQueriable(ctx, s.store, database, request.DataSourceId)
+ dataSource, err := checkAndGetDataSourceQueriable(ctx, s.store, s.licenseService, database, request.DataSourceId)
if err != nil {
return nil, err
}
@@ -1898,6 +1901,7 @@ func GetQueriableDataSource(instance *store.InstanceMessage) *storepb.DataSource
func checkAndGetDataSourceQueriable(
ctx context.Context,
storeInstance *store.Store,
+ licenseService *enterprise.LicenseService,
database *store.DatabaseMessage,
dataSourceID string,
) (*storepb.DataSource, error) {
@@ -1926,9 +1930,16 @@ func checkAndGetDataSourceQueriable(
// Always allow non-admin data source.
if dataSource.GetType() != storepb.DataSourceType_ADMIN {
+ if err := licenseService.IsFeatureEnabledForInstance(v1pb.PlanFeature_FEATURE_INSTANCE_READ_ONLY_CONNECTION, instance); err != nil {
+ return nil, status.Error(codes.PermissionDenied, err.Error())
+ }
return dataSource, nil
}
+ //nolint:nilerr
+ if err := licenseService.IsFeatureEnabled(v1pb.PlanFeature_FEATURE_QUERY_DATASOURCE_RESTRICTION); err != nil {
+ return dataSource, nil
+ }
var envAdminDataSourceRestriction, projectAdminDataSourceRestriction v1pb.DataSourceQueryPolicy_Restriction
environment, err := storeInstance.GetEnvironmentByID(ctx, database.EffectiveEnvironmentID)
if err != nil {
diff --git a/backend/common/util.go b/backend/common/util.go
index 431ebbc250..fea6d1f879 100644
--- a/backend/common/util.go
+++ b/backend/common/util.go
@@ -21,7 +21,7 @@ const (
MaxSheetCheckSize = 2 * 1024 * 1024
// The maximum number of bytes for sql results in response body.
// 100 MB.
- DefaultMaximumSQLResultSize = 100 * 1024 * 1024
+ DefaultMaximumSQLResultSize = int64(100 * 1024 * 1024)
// MaximumCommands is the maximum number of commands that can be executed in a single transaction.
MaximumCommands = 200
// MaximumAdvicePerStatus is the maximum number of advice that can be returned per status.
diff --git a/backend/component/dbfactory/dbfactory.go b/backend/component/dbfactory/dbfactory.go
index 2f3723eee5..2cd63d01c2 100644
--- a/backend/component/dbfactory/dbfactory.go
+++ b/backend/component/dbfactory/dbfactory.go
@@ -6,21 +6,25 @@ import (
"github.com/bytebase/bytebase/backend/common"
secretlib "github.com/bytebase/bytebase/backend/component/secret"
+ "github.com/bytebase/bytebase/backend/enterprise"
"github.com/bytebase/bytebase/backend/plugin/db"
"github.com/bytebase/bytebase/backend/store"
"github.com/bytebase/bytebase/backend/utils"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
+ v1pb "github.com/bytebase/bytebase/proto/generated-go/v1"
)
// DBFactory is the factory for building database driver.
type DBFactory struct {
- store *store.Store
+ store *store.Store
+ licenseService *enterprise.LicenseService
}
// New creates a new database driver factory.
-func New(store *store.Store) *DBFactory {
+func New(store *store.Store, licenseService *enterprise.LicenseService) *DBFactory {
return &DBFactory{
- store: store,
+ store: store,
+ licenseService: licenseService,
}
}
@@ -38,10 +42,14 @@ func (d *DBFactory) GetAdminDatabaseDriver(ctx context.Context, instance *store.
}
// GetDataSourceDriver returns the database driver for a data source.
-func (*DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.InstanceMessage, dataSource *storepb.DataSource, connectionContext db.ConnectionContext) (db.Driver, error) {
- password, err := secretlib.ReplaceExternalSecret(ctx, dataSource.GetPassword(), dataSource.GetExternalSecret())
- if err != nil {
- return nil, err
+func (d *DBFactory) GetDataSourceDriver(ctx context.Context, instance *store.InstanceMessage, dataSource *storepb.DataSource, connectionContext db.ConnectionContext) (db.Driver, error) {
+ password := dataSource.GetPassword()
+ if err := d.licenseService.IsFeatureEnabledForInstance(v1pb.PlanFeature_FEATURE_EXTERNAL_SECRET_MANAGER, instance); err == nil {
+ p, err := secretlib.ReplaceExternalSecret(ctx, dataSource.GetPassword(), dataSource.GetExternalSecret())
+ if err != nil {
+ return nil, err
+ }
+ password = p
}
connectionContext.InstanceID = instance.ResourceID
connectionContext.EngineVersion = instance.Metadata.GetVersion()
diff --git a/backend/enterprise/plan.yaml b/backend/enterprise/plan.yaml
index 6b23e514b7..c71f30614f 100644
--- a/backend/enterprise/plan.yaml
+++ b/backend/enterprise/plan.yaml
@@ -37,6 +37,8 @@ plans:
- FEATURE_INSTANCE_SSL_CONNECTION
- FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL
- FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION
+ - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
+ - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
# Administration & Support
- FEATURE_ENVIRONMENT_MANAGEMENT
- FEATURE_IM_NOTIFICATIONS
@@ -83,13 +85,13 @@ plans:
- FEATURE_INSTANCE_SSL_CONNECTION
- FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL
- FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION
+ - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
+ - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
- FEATURE_GOOGLE_AND_GITHUB_SSO
- FEATURE_USER_GROUPS
- FEATURE_DISALLOW_SELF_SERVICE_SIGNUP
- FEATURE_DATABASE_SECRET_VARIABLES
- FEATURE_QUERY_DATASOURCE_RESTRICTION
- - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
- - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
- FEATURE_AUDIT_LOG # Limited for TEAM
# Administration & Support
- FEATURE_ENVIRONMENT_MANAGEMENT
@@ -140,13 +142,13 @@ plans:
- FEATURE_INSTANCE_SSL_CONNECTION
- FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL
- FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION
+ - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
+ - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
- FEATURE_GOOGLE_AND_GITHUB_SSO
- FEATURE_USER_GROUPS
- FEATURE_DISALLOW_SELF_SERVICE_SIGNUP
- FEATURE_DATABASE_SECRET_VARIABLES
- FEATURE_QUERY_DATASOURCE_RESTRICTION
- - FEATURE_CUSTOM_INSTANCE_SYNC_TIME
- - FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT
- FEATURE_RISK_ASSESSMENT
- FEATURE_APPROVAL_WORKFLOW
- FEATURE_AUDIT_LOG # Full for ENTERPRISE
@@ -179,6 +181,4 @@ 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/backend/server/server.go b/backend/server/server.go
index 73b11d129a..8b56422f06 100644
--- a/backend/server/server.go
+++ b/backend/server/server.go
@@ -193,7 +193,7 @@ func NewServer(ctx context.Context, profile *config.Profile) (*Server, error) {
return nil, errors.Wrapf(err, "failed to create iam manager")
}
s.webhookManager = webhook.NewManager(stores, s.iamManager)
- s.dbFactory = dbfactory.New(s.store)
+ s.dbFactory = dbfactory.New(s.store, s.licenseService)
// Configure echo server.
s.echoServer = echo.New()
diff --git a/frontend/src/components/InstanceForm/ScanIntervalInput.vue b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
index 6c3b03d5a1..73cadf4234 100644
--- a/frontend/src/components/InstanceForm/ScanIntervalInput.vue
+++ b/frontend/src/components/InstanceForm/ScanIntervalInput.vue
@@ -7,10 +7,6 @@
<label class="textlabel">
{{ $t("instance.scan-interval.self") }}
</label>
- <FeatureBadge
- :feature="PlanFeature.FEATURE_CUSTOM_INSTANCE_SYNC_TIME"
- :instance="instance"
- />
</div>
<div class="textinfolabel">
{{ $t("instance.scan-interval.description") }}
@@ -18,7 +14,7 @@
<div class="flex items-center gap-x-6">
<NRadio
:checked="state.mode === 'DEFAULT'"
- :disabled="!allowEdit || !hasFeature"
+ :disabled="!allowEdit"
value="DEFAULT"
@click="handleModeChange('DEFAULT')"
>
@@ -28,7 +24,7 @@
<div class="flex items-center">
<NRadio
:checked="state.mode === 'CUSTOM'"
- :disabled="!allowEdit || !hasFeature"
+ :disabled="!allowEdit"
value="CUSTOM"
class="!items-center"
@click="handleModeChange('CUSTOM')"
@@ -42,7 +38,7 @@
size="small"
style="width: 4rem"
:status="state.isValid ? undefined : 'error'"
- :disabled="state.mode !== 'CUSTOM' || !hasFeature"
+ :disabled="state.mode !== 'CUSTOM'"
@update:value="handleMinuteChange($event as number)"
/>
<span v-if="!state.isValid" class="text-error">
@@ -61,12 +57,9 @@
</template>
<script setup lang="ts">
-import { NInputNumber, NRadio } from "naive-ui";
-import { computed, reactive, watch } from "vue";
-import { useSubscriptionV1Store } from "@/store";
import { Duration } from "@/types/proto/google/protobuf/duration";
-import { PlanFeature } from "@/types/proto/v1/subscription_service";
-import { FeatureBadge } from "../FeatureGuard";
+import { NInputNumber, NRadio } from "naive-ui";
+import { reactive, watch } from "vue";
import { useInstanceFormContext } from "./context";
type Mode = "DEFAULT" | "CUSTOM";
@@ -88,15 +81,7 @@ const emit = defineEmits<{
(event: "update:scan-interval", interval: Duration | undefined): void;
}>();
-const subscriptionStore = useSubscriptionV1Store();
-const { instance, hideAdvancedFeatures } = useInstanceFormContext();
-
-const hasFeature = computed(() => {
- return subscriptionStore.hasInstanceFeature(
- PlanFeature.FEATURE_CUSTOM_INSTANCE_SYNC_TIME,
- instance.value
- );
-});
+const { hideAdvancedFeatures } = useInstanceFormContext();
const extractStateFromDuration = (
duration: Duration | undefined
diff --git a/frontend/src/locales/dynamic/en-US.json b/frontend/src/locales/dynamic/en-US.json
index 304c1212b4..78931415b3 100644
--- a/frontend/src/locales/dynamic/en-US.json
+++ b/frontend/src/locales/dynamic/en-US.json
@@ -217,6 +217,14 @@
"title": "IAM authentication",
"desc": "Use cloud provider IAM for database authentication."
},
+ "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
+ "title": "Custom instance sync time",
+ "desc": "Customize database synchronization intervals and settings."
+ },
+ "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
+ "title": "Custom instance connection limit",
+ "desc": "Configure maximum database connection limits."
+ },
"FEATURE_GOOGLE_AND_GITHUB_SSO": {
"title": "Google and GitHub SSO",
"desc": "Sign in with Google or GitHub accounts."
@@ -237,14 +245,6 @@
"title": "Query datasource restriction",
"desc": "Restrict which data sources users can query."
},
- "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
- "title": "Custom instance sync time",
- "desc": "Customize database synchronization intervals and settings."
- },
- "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
- "title": "Custom instance connection limit",
- "desc": "Configure maximum database connection limits."
- },
"FEATURE_RISK_ASSESSMENT": {
"title": "Risk assessment",
"desc": "Evaluate and categorize the risk level of database changes."
diff --git a/frontend/src/locales/dynamic/es-ES.json b/frontend/src/locales/dynamic/es-ES.json
index d0b0b45366..633ac105f8 100644
--- a/frontend/src/locales/dynamic/es-ES.json
+++ b/frontend/src/locales/dynamic/es-ES.json
@@ -217,6 +217,14 @@
"title": "Autenticación IAM",
"desc": "Use IAM del proveedor de nube para la autenticación de base de datos."
},
+ "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
+ "title": "Tiempo de sincronización de instancia personalizado",
+ "desc": "Personalice los intervalos y configuraciones de sincronización de base de datos."
+ },
+ "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
+ "title": "Límite de conexión de instancia personalizado",
+ "desc": "Configure límites máximos de conexión de base de datos."
+ },
"FEATURE_GOOGLE_AND_GITHUB_SSO": {
"title": "SSO de Google y GitHub",
"desc": "Inicie sesión con cuentas de Google o GitHub."
@@ -237,14 +245,6 @@
"title": "Restricción de fuente de datos de consultas",
"desc": "Restrinja qué fuentes de datos pueden consultar los usuarios."
},
- "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
- "title": "Tiempo de sincronización de instancia personalizado",
- "desc": "Personalice los intervalos y configuraciones de sincronización de base de datos."
- },
- "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
- "title": "Límite de conexión de instancia personalizado",
- "desc": "Configure límites máximos de conexión de base de datos."
- },
"FEATURE_RISK_ASSESSMENT": {
"title": "Evaluación de riesgos",
"desc": "Evalúe y categorice el nivel de riesgo de los cambios de base de datos."
diff --git a/frontend/src/locales/dynamic/ja-JP.json b/frontend/src/locales/dynamic/ja-JP.json
index b4394d02c4..ceae97352f 100644
--- a/frontend/src/locales/dynamic/ja-JP.json
+++ b/frontend/src/locales/dynamic/ja-JP.json
@@ -217,6 +217,14 @@
"title": "IAM認証",
"desc": "データベース認証にクラウドプロバイダーのIAMを使用します。"
},
+ "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
+ "title": "カスタムインスタンス同期時間",
+ "desc": "データベース同期間隔と設定をカスタマイズします。"
+ },
+ "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
+ "title": "カスタムインスタンス接続制限",
+ "desc": "最大データベース接続制限を設定します。"
+ },
"FEATURE_GOOGLE_AND_GITHUB_SSO": {
"title": "GoogleとGitHub SSO",
"desc": "GoogleまたはGitHubアカウントでサインインします。"
@@ -237,14 +245,6 @@
"title": "クエリデータソース制限",
"desc": "ユーザーがクエリできるデータソースを制限します。"
},
- "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
- "title": "カスタムインスタンス同期時間",
- "desc": "データベース同期間隔と設定をカスタマイズします。"
- },
- "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
- "title": "カスタムインスタンス接続制限",
- "desc": "最大データベース接続制限を設定します。"
- },
"FEATURE_RISK_ASSESSMENT": {
"title": "リスク評価",
"desc": "データベース変更のリスクレベルを評価し分類します。"
diff --git a/frontend/src/locales/dynamic/vi-VN.json b/frontend/src/locales/dynamic/vi-VN.json
index 5fb44c978c..a00a4ddfd7 100644
--- a/frontend/src/locales/dynamic/vi-VN.json
+++ b/frontend/src/locales/dynamic/vi-VN.json
@@ -217,6 +217,14 @@
"title": "Xác thực IAM",
"desc": "Sử dụng IAM của nhà cung cấp đám mây để xác thực cơ sở dữ liệu."
},
+ "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
+ "title": "Thời gian đồng bộ instance tùy chỉnh",
+ "desc": "Tùy chỉnh khoảng thời gian và cài đặt đồng bộ hóa cơ sở dữ liệu."
+ },
+ "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
+ "title": "Giới hạn kết nối instance tùy chỉnh",
+ "desc": "Cấu hình giới hạn kết nối cơ sở dữ liệu tối đa."
+ },
"FEATURE_GOOGLE_AND_GITHUB_SSO": {
"title": "Google và GitHub SSO",
"desc": "Đăng nhập bằng tài khoản Google hoặc GitHub."
@@ -237,14 +245,6 @@
"title": "Hạn chế nguồn dữ liệu truy vấn",
"desc": "Hạn chế người dùng có thể truy vấn nguồn dữ liệu nào."
},
- "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
- "title": "Thời gian đồng bộ instance tùy chỉnh",
- "desc": "Tùy chỉnh khoảng thời gian và cài đặt đồng bộ hóa cơ sở dữ liệu."
- },
- "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
- "title": "Giới hạn kết nối instance tùy chỉnh",
- "desc": "Cấu hình giới hạn kết nối cơ sở dữ liệu tối đa."
- },
"FEATURE_RISK_ASSESSMENT": {
"title": "Đánh giá rủi ro",
"desc": "Đánh giá và phân loại mức độ rủi ro của các thay đổi cơ sở dữ liệu."
diff --git a/frontend/src/locales/dynamic/zh-CN.json b/frontend/src/locales/dynamic/zh-CN.json
index c0c4672863..f891602eb6 100644
--- a/frontend/src/locales/dynamic/zh-CN.json
+++ b/frontend/src/locales/dynamic/zh-CN.json
@@ -217,6 +217,14 @@
"title": "IAM 身份验证",
"desc": "使用云提供商 IAM 进行数据库身份验证。"
},
+ "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
+ "title": "自定义实例同步时间",
+ "desc": "自定义数据库同步间隔和设置。"
+ },
+ "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
+ "title": "自定义实例连接限制",
+ "desc": "配置最大数据库连接限制。"
+ },
"FEATURE_GOOGLE_AND_GITHUB_SSO": {
"title": "Google 和 GitHub SSO",
"desc": "使用 Google 或 GitHub 账户登录。"
@@ -237,14 +245,6 @@
"title": "查询数据源限制",
"desc": "限制用户可以查询哪些数据源。"
},
- "FEATURE_CUSTOM_INSTANCE_SYNC_TIME": {
- "title": "自定义实例同步时间",
- "desc": "自定义数据库同步间隔和设置。"
- },
- "FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT": {
- "title": "自定义实例连接限制",
- "desc": "配置最大数据库连接限制。"
- },
"FEATURE_RISK_ASSESSMENT": {
"title": "风险评估",
"desc": "评估和分类数据库更改的风险级别。"
diff --git a/proto/v1/v1/subscription_service.proto b/proto/v1/v1/subscription_service.proto
index 727eb8a101..41ae38c700 100644
--- a/proto/v1/v1/subscription_service.proto
+++ b/proto/v1/v1/subscription_service.proto
@@ -106,13 +106,13 @@ enum PlanFeature {
FEATURE_INSTANCE_SSL_CONNECTION = 34;
FEATURE_INSTANCE_CONNECTION_OVER_SSH_TUNNEL = 35;
FEATURE_INSTANCE_CONNECTION_IAM_AUTHENTICATION = 36;
+ FEATURE_CUSTOM_INSTANCE_SYNC_TIME = 42;
+ FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT = 43;
FEATURE_GOOGLE_AND_GITHUB_SSO = 37;
FEATURE_USER_GROUPS = 38;
FEATURE_DISALLOW_SELF_SERVICE_SIGNUP = 39;
FEATURE_DATABASE_SECRET_VARIABLES = 40;
FEATURE_QUERY_DATASOURCE_RESTRICTION = 41;
- FEATURE_CUSTOM_INSTANCE_SYNC_TIME = 42;
- FEATURE_CUSTOM_INSTANCE_CONNECTION_LIMIT = 43;
FEATURE_RISK_ASSESSMENT = 44;
FEATURE_APPROVAL_WORKFLOW = 45;
FEATURE_AUDIT_LOG = 46;