Skip to content

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

chore: setting name proto (#16408)

Danny Xu9806b81f5259
diff --git a/CLAUDE.md b/CLAUDE.md
index 60bcd254db..78762084c6 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -4,7 +4,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
## Project Architecture
- The database schema is defined in `./backend/migrator/migration/LATEST.sql`
-- The database migration files are in `./backend/migrator/<<version>>/`. `TestLatestVersion` in `./backend/migrator/migrator_test.go` and `./backend/migrator/migration/LATEST.sql` needs update after new migration files are added.
+- The database migration files are in `./backend/migrator/<<version>>/`. `TestLatestVersion` in `./backend/migrator/migrator_test.go` needs update after new migration files are added. `./backend/migrator/migration/LATEST.sql` should updated for DDL migrations.
- Files in `./backend/store` are mappings to the database tables.
## Build/Test Commands
diff --git a/backend/api/directory-sync/webhook.go b/backend/api/directory-sync/webhook.go
index fbb51e4f77..13240987ba 100644
--- a/backend/api/directory-sync/webhook.go
+++ b/backend/api/directory-sync/webhook.go
@@ -583,7 +583,7 @@ func (s *Service) validRequestURL(ctx context.Context, c echo.Context) error {
return errors.Errorf("invalid workspace id %q, my ID %q", workspaceID, myWorkspaceID)
}
- scimSetting, err := s.store.GetSettingV2(ctx, base.SettingSCIM)
+ scimSetting, err := s.store.GetSettingV2(ctx, storepb.SettingName_SCIM)
if err != nil {
return errors.Wrapf(err, "failed to find scim setting")
}
diff --git a/backend/api/v1/actuator_service.go b/backend/api/v1/actuator_service.go
index 3cfaf59f49..be8be43f25 100644
--- a/backend/api/v1/actuator_service.go
+++ b/backend/api/v1/actuator_service.go
@@ -81,12 +81,12 @@ func (s *ActuatorService) DeleteCache(_ context.Context, _ *v1pb.DeleteCacheRequ
// GetResourcePackage gets the theme resources.
func (s *ActuatorService) GetResourcePackage(ctx context.Context, _ *v1pb.GetResourcePackageRequest) (*v1pb.ResourcePackage, error) {
- brandingSetting, err := s.store.GetSettingV2(ctx, base.SettingBrandingLogo)
+ brandingSetting, err := s.store.GetSettingV2(ctx, storepb.SettingName_BRANDING_LOGO)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to find workspace branding: %v", err)
}
if brandingSetting == nil {
- return nil, errors.Errorf("cannot find setting %v", base.SettingBrandingLogo)
+ return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_BRANDING_LOGO)
}
return &v1pb.ResourcePackage{
@@ -346,7 +346,7 @@ func (s *ActuatorService) getUsedFeatures(ctx context.Context) ([]base.FeatureTy
}
// setting
- brandingLogo, err := s.store.GetSettingV2(ctx, base.SettingBrandingLogo)
+ brandingLogo, err := s.store.GetSettingV2(ctx, storepb.SettingName_BRANDING_LOGO)
if err != nil {
return nil, errors.Wrapf(err, "failed to get branding logo setting")
}
@@ -354,7 +354,7 @@ func (s *ActuatorService) getUsedFeatures(ctx context.Context) ([]base.FeatureTy
features = append(features, base.FeatureBranding)
}
- watermark, err := s.store.GetSettingV2(ctx, base.SettingWatermark)
+ watermark, err := s.store.GetSettingV2(ctx, storepb.SettingName_WATERMARK)
if err != nil {
return nil, errors.Wrapf(err, "failed to get watermark setting")
}
diff --git a/backend/api/v1/setting_service.go b/backend/api/v1/setting_service.go
index 59fc486ce3..95e80cb788 100644
--- a/backend/api/v1/setting_service.go
+++ b/backend/api/v1/setting_service.go
@@ -62,23 +62,23 @@ func NewSettingService(
}
// Some settings contain secret info so we only return settings that are needed by the client.
-var whitelistSettings = []base.SettingName{
- base.SettingBrandingLogo,
- base.SettingWorkspaceID,
- base.SettingAppIM,
- base.SettingWatermark,
- base.SettingAI,
- base.SettingWorkspaceApproval,
- base.SettingWorkspaceMailDelivery,
- base.SettingWorkspaceProfile,
- base.SettingWorkspaceExternalApproval,
- base.SettingSchemaTemplate,
- base.SettingDataClassification,
- base.SettingSemanticTypes,
- base.SettingSQLResultSizeLimit,
- base.SettingSCIM,
- base.SettingPasswordRestriction,
- base.SettingEnvironment,
+var whitelistSettings = []storepb.SettingName{
+ storepb.SettingName_BRANDING_LOGO,
+ storepb.SettingName_WORKSPACE_ID,
+ storepb.SettingName_APP_IM,
+ storepb.SettingName_WATERMARK,
+ storepb.SettingName_AI,
+ storepb.SettingName_WORKSPACE_APPROVAL,
+ storepb.SettingName_WORKSPACE_MAIL_DELIVERY,
+ storepb.SettingName_WORKSPACE_PROFILE,
+ storepb.SettingName_WORKSPACE_EXTERNAL_APPROVAL,
+ storepb.SettingName_SCHEMA_TEMPLATE,
+ storepb.SettingName_DATA_CLASSIFICATION,
+ storepb.SettingName_SEMANTIC_TYPES,
+ storepb.SettingName_SQL_RESULT_SIZE_LIMIT,
+ storepb.SettingName_SCIM,
+ storepb.SettingName_PASSWORD_RESTRICTION,
+ storepb.SettingName_ENVIRONMENT,
}
//go:embed mail_templates/testmail/template.html
@@ -116,7 +116,10 @@ func (s *SettingService) GetSetting(ctx context.Context, request *v1pb.GetSettin
if settingName == "" {
return nil, status.Errorf(codes.InvalidArgument, "setting name is empty")
}
- apiSettingName := base.SettingName(settingName)
+ apiSettingName, err := convertStringToSettingName(settingName)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid setting name: %v", err)
+ }
if !settingInWhitelist(apiSettingName) {
return nil, status.Errorf(codes.InvalidArgument, "setting is not available")
}
@@ -153,7 +156,10 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
if s.profile.IsFeatureUnavailable(settingName) {
return nil, status.Errorf(codes.InvalidArgument, "feature %s is unavailable in current mode", settingName)
}
- apiSettingName := base.SettingName(settingName)
+ apiSettingName, err := convertStringToSettingName(settingName)
+ if err != nil {
+ return nil, status.Errorf(codes.InvalidArgument, "invalid setting name: %v", err)
+ }
existedSetting, err := s.store.GetSettingV2(ctx, apiSettingName)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to find setting %s with error: %v", settingName, err)
@@ -176,7 +182,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
var storeSettingValue string
switch apiSettingName {
- case base.SettingWorkspaceProfile:
+ case storepb.SettingName_WORKSPACE_PROFILE:
if request.UpdateMask == nil {
return nil, status.Errorf(codes.InvalidArgument, "update mask is required")
}
@@ -278,7 +284,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingWorkspaceApproval:
+ case storepb.SettingName_WORKSPACE_APPROVAL:
if err := s.licenseService.IsFeatureEnabled(base.FeatureCustomApproval); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
@@ -311,7 +317,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingWorkspaceMailDelivery:
+ case storepb.SettingName_WORKSPACE_MAIL_DELIVERY:
apiValue := request.Setting.Value.GetSmtpMailDeliverySettingValue()
// We will fill the password read from the store if it is not set.
if apiValue.Password == nil {
@@ -363,12 +369,12 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting value for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingBrandingLogo:
+ case storepb.SettingName_BRANDING_LOGO:
if err := s.licenseService.IsFeatureEnabled(base.FeatureBranding); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
storeSettingValue = request.Setting.Value.GetStringValue()
- case base.SettingPluginAgent:
+ case storepb.SettingName_PLUGIN_AGENT:
payload := new(storepb.AgentPluginSetting)
if err := convertProtoToProto(request.Setting.Value.GetAgentPluginSettingValue(), payload); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", apiSettingName, err)
@@ -380,7 +386,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
}
storeSettingValue = string(bytes)
- case base.SettingAppIM:
+ case storepb.SettingName_APP_IM:
payload := new(storepb.AppIMSetting)
if err := convertProtoToProto(request.Setting.Value.GetAppImSettingValue(), payload); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s, error: %v", apiSettingName, err)
@@ -444,7 +450,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
}
storeSettingValue = string(bytes)
- case base.SettingSchemaTemplate:
+ case storepb.SettingName_SCHEMA_TEMPLATE:
if err := s.licenseService.IsFeatureEnabled(base.FeatureSchemaTemplate); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
@@ -466,7 +472,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal external approval setting, error: %v", err)
}
storeSettingValue = string(bytes)
- case base.SettingDataClassification:
+ case storepb.SettingName_DATA_CLASSIFICATION:
payload := new(storepb.DataClassificationSetting)
if err := convertProtoToProto(request.Setting.Value.GetDataClassificationSettingValue(), payload); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", apiSettingName, err)
@@ -483,7 +489,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingSemanticTypes:
+ case storepb.SettingName_SEMANTIC_TYPES:
storeSemanticTypeSetting := new(storepb.SemanticTypeSetting)
if err := convertProtoToProto(request.Setting.Value.GetSemanticTypeSettingValue(), storeSemanticTypeSetting); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", apiSettingName, err)
@@ -509,12 +515,12 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingWatermark:
+ case storepb.SettingName_WATERMARK:
if err := s.licenseService.IsFeatureEnabled(base.FeatureWatermark); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
storeSettingValue = request.Setting.Value.GetStringValue()
- case base.SettingSQLResultSizeLimit:
+ case storepb.SettingName_SQL_RESULT_SIZE_LIMIT:
maximumSQLResultSizeSetting := new(storepb.MaximumSQLResultSizeSetting)
if err := convertProtoToProto(request.Setting.Value.GetMaximumSqlResultSizeSetting(), maximumSQLResultSizeSetting); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", apiSettingName, err)
@@ -527,7 +533,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingSCIM:
+ case storepb.SettingName_SCIM:
scimToken, err := common.RandomString(32)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to generate random SCIM secret with error: %v", err)
@@ -539,7 +545,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal SCIM setting with error: %v", err)
}
storeSettingValue = string(bytes)
- case base.SettingPasswordRestriction:
+ case storepb.SettingName_PASSWORD_RESTRICTION:
if err := s.licenseService.IsFeatureEnabled(base.FeaturePasswordRestriction); err != nil {
return nil, status.Error(codes.PermissionDenied, err.Error())
}
@@ -555,7 +561,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingAI:
+ case storepb.SettingName_AI:
aiSetting := &storepb.AISetting{}
if err := convertProtoToProto(request.Setting.Value.GetAiSetting(), aiSetting); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", apiSettingName, err)
@@ -583,7 +589,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
return nil, status.Errorf(codes.Internal, "failed to marshal setting for %s with error: %v", apiSettingName, err)
}
storeSettingValue = string(bytes)
- case base.SettingEnvironment:
+ case storepb.SettingName_ENVIRONMENT:
if serr := validateEnvironments(request.Setting.Value.GetEnvironmentSetting().GetEnvironments()); serr != nil {
return nil, serr.Err()
}
@@ -640,7 +646,7 @@ func (s *SettingService) UpdateSetting(ctx context.Context, request *v1pb.Update
}
// it's a temporary solution to map the classification to all projects before we support it in the UX.
- if apiSettingName == base.SettingDataClassification && len(settingMessage.Value.GetDataClassificationSettingValue().Configs) == 1 {
+ if apiSettingName == storepb.SettingName_DATA_CLASSIFICATION && len(settingMessage.Value.GetDataClassificationSettingValue().Configs) == 1 {
classificationID := settingMessage.Value.GetDataClassificationSettingValue().Configs[0].Id
projects, err := s.store.ListProjectV2(ctx, &store.FindProjectMessage{ShowDeleted: false})
if err != nil {
@@ -672,9 +678,9 @@ func convertProtoToProto(inputPB, outputPB protoreflect.ProtoMessage) error {
}
func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, error) {
- settingName := fmt.Sprintf("%s%s", common.SettingNamePrefix, setting.Name)
+ settingName := fmt.Sprintf("%s%s", common.SettingNamePrefix, convertStoreSettingNameToV1(setting.Name).String())
switch setting.Name {
- case base.SettingWorkspaceMailDelivery:
+ case storepb.SettingName_WORKSPACE_MAIL_DELIVERY:
storeValue := new(storepb.SMTPMailDeliverySetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), storeValue); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -698,7 +704,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
})
- case base.SettingAppIM:
+ case storepb.SettingName_APP_IM:
storeValue := new(storepb.AppIMSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), storeValue); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -727,7 +733,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingPluginAgent:
+ case storepb.SettingName_PLUGIN_AGENT:
v1Value := new(v1pb.AgentPluginSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -740,7 +746,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingWorkspaceProfile:
+ case storepb.SettingName_WORKSPACE_PROFILE:
v1Value := new(v1pb.WorkspaceProfileSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -753,7 +759,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingWorkspaceApproval:
+ case storepb.SettingName_WORKSPACE_APPROVAL:
storeValue := new(storepb.WorkspaceApprovalSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), storeValue); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -774,7 +780,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingSchemaTemplate:
+ case storepb.SettingName_SCHEMA_TEMPLATE:
value := new(storepb.SchemaTemplateSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -792,7 +798,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingDataClassification:
+ case storepb.SettingName_DATA_CLASSIFICATION:
v1Value := new(v1pb.DataClassificationSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -805,7 +811,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingSemanticTypes:
+ case storepb.SettingName_SEMANTIC_TYPES:
v1Value := new(v1pb.SemanticTypeSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -818,7 +824,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingSQLResultSizeLimit:
+ case storepb.SettingName_SQL_RESULT_SIZE_LIMIT:
v1Value := new(v1pb.MaximumSQLResultSizeSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -834,7 +840,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingSCIM:
+ case storepb.SettingName_SCIM:
v1Value := new(v1pb.SCIMSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -847,7 +853,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingPasswordRestriction:
+ case storepb.SettingName_PASSWORD_RESTRICTION:
v1Value := new(v1pb.PasswordRestrictionSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -860,7 +866,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingAI:
+ case storepb.SettingName_AI:
v1Value := &v1pb.AISetting{}
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), v1Value); err != nil {
return nil, status.Errorf(codes.Internal, "failed to unmarshal setting value for %s with error: %v", setting.Name, err)
@@ -875,7 +881,7 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
},
},
}, nil
- case base.SettingEnvironment:
+ case storepb.SettingName_ENVIRONMENT:
v1Value, err := convertToEnvironmentSetting(setting.Value)
if err != nil {
return nil, status.Errorf(codes.Internal, "failed to convert setting value for %s with error: %v", setting.Name, err)
@@ -901,9 +907,9 @@ func convertToSettingMessage(setting *store.SettingMessage) (*v1pb.Setting, erro
}
func (s *SettingService) validateSchemaTemplate(ctx context.Context, schemaTemplateSetting *v1pb.SchemaTemplateSetting) error {
- oldStoreSetting, err := s.store.GetSettingV2(ctx, base.SettingSchemaTemplate)
+ oldStoreSetting, err := s.store.GetSettingV2(ctx, storepb.SettingName_SCHEMA_TEMPLATE)
if err != nil {
- return status.Errorf(codes.Internal, "failed to get setting %q: %v", base.SettingSchemaTemplate, err)
+ return status.Errorf(codes.Internal, "failed to get setting %q: %v", storepb.SettingName_SCHEMA_TEMPLATE, err)
}
settingValue := "{}"
if oldStoreSetting != nil {
@@ -912,7 +918,7 @@ func (s *SettingService) validateSchemaTemplate(ctx context.Context, schemaTempl
value := new(storepb.SchemaTemplateSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(settingValue), value); err != nil {
- return status.Errorf(codes.Internal, "failed to unmarshal setting value for %v with error: %v", base.SettingSchemaTemplate, err)
+ return status.Errorf(codes.Internal, "failed to unmarshal setting value for %v with error: %v", storepb.SettingName_SCHEMA_TEMPLATE, err)
}
v1Value, err := convertSchemaTemplateSetting(value)
if err != nil {
@@ -981,7 +987,7 @@ func validateTableMetadata(engine v1pb.Engine, tableMetadata *v1pb.TableMetadata
return nil
}
-func settingInWhitelist(name base.SettingName) bool {
+func settingInWhitelist(name storepb.SettingName) bool {
for _, whitelist := range whitelistSettings {
if name == whitelist {
return true
@@ -990,6 +996,117 @@ func settingInWhitelist(name base.SettingName) bool {
return false
}
+// convertStringToSettingName converts a string to storepb.SettingName.
+// It first converts to v1pb.Setting_SettingName, then to storepb.SettingName.
+func convertStringToSettingName(name string) (storepb.SettingName, error) {
+ // First try to convert string to v1pb.Setting_SettingName
+ v1Value, ok := v1pb.Setting_SettingName_value[name]
+ if !ok {
+ return storepb.SettingName_SETTING_NAME_UNSPECIFIED, errors.Errorf("invalid setting name: %s", name)
+ }
+ v1SettingName := v1pb.Setting_SettingName(v1Value)
+
+ // Then convert v1pb to storepb
+ return convertV1SettingNameToStore(v1SettingName), nil
+}
+
+// convertStoreSettingNameToV1 converts storepb.SettingName to v1pb.Setting_SettingName.
+func convertStoreSettingNameToV1(storeName storepb.SettingName) v1pb.Setting_SettingName {
+ //exhaustive:enforce
+ switch storeName {
+ case storepb.SettingName_SETTING_NAME_UNSPECIFIED:
+ return v1pb.Setting_SETTING_NAME_UNSPECIFIED
+ case storepb.SettingName_AUTH_SECRET:
+ return v1pb.Setting_AUTH_SECRET
+ case storepb.SettingName_BRANDING_LOGO:
+ return v1pb.Setting_BRANDING_LOGO
+ case storepb.SettingName_WORKSPACE_ID:
+ return v1pb.Setting_WORKSPACE_ID
+ case storepb.SettingName_WORKSPACE_PROFILE:
+ return v1pb.Setting_WORKSPACE_PROFILE
+ case storepb.SettingName_WORKSPACE_APPROVAL:
+ return v1pb.Setting_WORKSPACE_APPROVAL
+ case storepb.SettingName_WORKSPACE_EXTERNAL_APPROVAL:
+ return v1pb.Setting_WORKSPACE_EXTERNAL_APPROVAL
+ case storepb.SettingName_ENTERPRISE_LICENSE:
+ return v1pb.Setting_ENTERPRISE_LICENSE
+ case storepb.SettingName_APP_IM:
+ return v1pb.Setting_APP_IM
+ case storepb.SettingName_WATERMARK:
+ return v1pb.Setting_WATERMARK
+ case storepb.SettingName_AI:
+ return v1pb.Setting_AI
+ case storepb.SettingName_PLUGIN_AGENT:
+ return v1pb.Setting_PLUGIN_AGENT
+ case storepb.SettingName_WORKSPACE_MAIL_DELIVERY:
+ return v1pb.Setting_WORKSPACE_MAIL_DELIVERY
+ case storepb.SettingName_SCHEMA_TEMPLATE:
+ return v1pb.Setting_SCHEMA_TEMPLATE
+ case storepb.SettingName_DATA_CLASSIFICATION:
+ return v1pb.Setting_DATA_CLASSIFICATION
+ case storepb.SettingName_SEMANTIC_TYPES:
+ return v1pb.Setting_SEMANTIC_TYPES
+ case storepb.SettingName_SQL_RESULT_SIZE_LIMIT:
+ return v1pb.Setting_SQL_RESULT_SIZE_LIMIT
+ case storepb.SettingName_SCIM:
+ return v1pb.Setting_SCIM
+ case storepb.SettingName_PASSWORD_RESTRICTION:
+ return v1pb.Setting_PASSWORD_RESTRICTION
+ case storepb.SettingName_ENVIRONMENT:
+ return v1pb.Setting_ENVIRONMENT
+ }
+ return v1pb.Setting_SETTING_NAME_UNSPECIFIED
+}
+
+// convertV1SettingNameToStore converts v1pb.Setting_SettingName to storepb.SettingName.
+func convertV1SettingNameToStore(v1Name v1pb.Setting_SettingName) storepb.SettingName {
+ //exhaustive:enforce
+ switch v1Name {
+ case v1pb.Setting_SETTING_NAME_UNSPECIFIED:
+ return storepb.SettingName_SETTING_NAME_UNSPECIFIED
+ case v1pb.Setting_AUTH_SECRET:
+ return storepb.SettingName_AUTH_SECRET
+ case v1pb.Setting_BRANDING_LOGO:
+ return storepb.SettingName_BRANDING_LOGO
+ case v1pb.Setting_WORKSPACE_ID:
+ return storepb.SettingName_WORKSPACE_ID
+ case v1pb.Setting_WORKSPACE_PROFILE:
+ return storepb.SettingName_WORKSPACE_PROFILE
+ case v1pb.Setting_WORKSPACE_APPROVAL:
+ return storepb.SettingName_WORKSPACE_APPROVAL
+ case v1pb.Setting_WORKSPACE_EXTERNAL_APPROVAL:
+ return storepb.SettingName_WORKSPACE_EXTERNAL_APPROVAL
+ case v1pb.Setting_ENTERPRISE_LICENSE:
+ return storepb.SettingName_ENTERPRISE_LICENSE
+ case v1pb.Setting_APP_IM:
+ return storepb.SettingName_APP_IM
+ case v1pb.Setting_WATERMARK:
+ return storepb.SettingName_WATERMARK
+ case v1pb.Setting_AI:
+ return storepb.SettingName_AI
+ case v1pb.Setting_PLUGIN_AGENT:
+ return storepb.SettingName_PLUGIN_AGENT
+ case v1pb.Setting_WORKSPACE_MAIL_DELIVERY:
+ return storepb.SettingName_WORKSPACE_MAIL_DELIVERY
+ case v1pb.Setting_SCHEMA_TEMPLATE:
+ return storepb.SettingName_SCHEMA_TEMPLATE
+ case v1pb.Setting_DATA_CLASSIFICATION:
+ return storepb.SettingName_DATA_CLASSIFICATION
+ case v1pb.Setting_SEMANTIC_TYPES:
+ return storepb.SettingName_SEMANTIC_TYPES
+ case v1pb.Setting_SQL_RESULT_SIZE_LIMIT:
+ return storepb.SettingName_SQL_RESULT_SIZE_LIMIT
+ case v1pb.Setting_SCIM:
+ return storepb.SettingName_SCIM
+ case v1pb.Setting_PASSWORD_RESTRICTION:
+ return storepb.SettingName_PASSWORD_RESTRICTION
+ case v1pb.Setting_ENVIRONMENT:
+ return storepb.SettingName_ENVIRONMENT
+ default:
+ return storepb.SettingName_SETTING_NAME_UNSPECIFIED
+ }
+}
+
func validateApprovalTemplate(template *v1pb.ApprovalTemplate) error {
if template.Flow == nil {
return errors.Errorf("approval template cannot be nil")
@@ -1157,9 +1274,12 @@ func stripSensitiveData(setting *v1pb.Setting) (*v1pb.Setting, error) {
if err != nil {
return nil, err
}
- apiSettingName := base.SettingName(settingName)
+ apiSettingName, err := convertStringToSettingName(settingName)
+ if err != nil {
+ return nil, err
+ }
switch apiSettingName {
- case base.SettingWorkspaceMailDelivery:
+ case storepb.SettingName_WORKSPACE_MAIL_DELIVERY:
mailDeliveryValue, ok := setting.Value.Value.(*v1pb.Value_SmtpMailDeliverySettingValue)
if !ok {
return nil, status.Errorf(codes.InvalidArgument, "invalid setting value type: %T", setting.Value.Value)
diff --git a/backend/base/setting.go b/backend/base/setting.go
deleted file mode 100644
index 6b6e75172a..0000000000
--- a/backend/base/setting.go
+++ /dev/null
@@ -1,46 +0,0 @@
-package base
-
-// SettingName is the name of a setting.
-type SettingName string
-
-const (
- // SettingAuthSecret is the setting name for auth secret.
- SettingAuthSecret SettingName = "bb.auth.secret"
- // SettingBrandingLogo is the setting name for branding logo.
- SettingBrandingLogo SettingName = "bb.branding.logo"
- // SettingWorkspaceID is the setting name for workspace identifier.
- SettingWorkspaceID SettingName = "bb.workspace.id"
- // SettingWorkspaceProfile is the setting name for workspace profile settings.
- SettingWorkspaceProfile SettingName = "bb.workspace.profile"
- // SettingWorkspaceApproval is the setting name for workspace approval config.
- SettingWorkspaceApproval SettingName = "bb.workspace.approval"
- // SettingWorkspaceExternalApproval is the setting name for workspace external approval config.
- SettingWorkspaceExternalApproval SettingName = "bb.workspace.approval.external"
- // SettingEnterpriseLicense is the setting name for enterprise license.
- SettingEnterpriseLicense SettingName = "bb.enterprise.license"
- // SettingAppIM is the setting name for IM applications.
- SettingAppIM SettingName = "bb.app.im"
- // SettingWatermark is the setting name for watermark displaying.
- SettingWatermark SettingName = "bb.workspace.watermark"
- // SettingAI is used for AI setting.
- SettingAI SettingName = "bb.ai"
- // SettingPluginAgent is the setting name for the internal agent API.
- // For now we will call the hub to fetch the subscription license.
- SettingPluginAgent SettingName = "bb.plugin.agent"
- // SettingWorkspaceMailDelivery is the setting name for workspace mail delivery.
- SettingWorkspaceMailDelivery SettingName = "bb.workspace.mail-delivery"
- // SettingSchemaTemplate is the setting name for schema template.
- SettingSchemaTemplate SettingName = "bb.workspace.schema-template"
- // SettingDataClassification is the setting name for data classification.
- SettingDataClassification SettingName = "bb.workspace.data-classification"
- // SettingSemanticTypes is the setting name for semantic types.
- SettingSemanticTypes SettingName = "bb.workspace.semantic-types"
- // SettingSQLResultSizeLimit is the setting name for SQL query result size limit.
- SettingSQLResultSizeLimit SettingName = "bb.workspace.maximum-sql-result-size"
- // SettingSCIM is the setting name for SCIM config.
- SettingSCIM SettingName = "bb.workspace.scim"
- // SettingPasswordRestriction is the setting name for password.
- SettingPasswordRestriction SettingName = "bb.workspace.password-restriction"
- // SettingEnvironment is the setting name for environments.
- SettingEnvironment SettingName = "bb.workspace.environment"
-)
diff --git a/backend/component/config/profile.go b/backend/component/config/profile.go
index 0b5023d46e..23a7595983 100644
--- a/backend/component/config/profile.go
+++ b/backend/component/config/profile.go
@@ -4,8 +4,8 @@ package config
import (
"sync/atomic"
- "github.com/bytebase/bytebase/backend/base"
"github.com/bytebase/bytebase/backend/common"
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
// Profile is the configuration to start main server.
@@ -64,8 +64,8 @@ func (prof *Profile) UseEmbedDB() bool {
}
var saasFeatureControlMap = map[string]bool{
- string(base.SettingPluginAgent): true,
- string(base.SettingWorkspaceID): true,
+ storepb.SettingName_PLUGIN_AGENT.String(): true,
+ storepb.SettingName_WORKSPACE_ID.String(): true,
}
// IsFeatureUnavailable returns if the feature is unavailable in SaaS mode.
diff --git a/backend/enterprise/plugin/hub/hub.go b/backend/enterprise/plugin/hub/hub.go
index 51149e6b24..3df92b2562 100644
--- a/backend/enterprise/plugin/hub/hub.go
+++ b/backend/enterprise/plugin/hub/hub.go
@@ -16,6 +16,7 @@ import (
"github.com/bytebase/bytebase/backend/enterprise/config"
"github.com/bytebase/bytebase/backend/enterprise/plugin"
"github.com/bytebase/bytebase/backend/store"
+ storepb "github.com/bytebase/bytebase/proto/generated-go/store"
)
var _ plugin.LicenseProvider = (*Provider)(nil)
@@ -61,7 +62,7 @@ func (p *Provider) StoreLicense(ctx context.Context, patch *enterprise.Subscript
}
}
if _, err := p.store.UpsertSettingV2(ctx, &store.SetSettingMessage{
- Name: base.SettingEnterpriseLicense,
+ Name: storepb.SettingName_ENTERPRISE_LICENSE,
Value: patch.License,
}); err != nil {
return err
@@ -110,7 +111,7 @@ func (p *Provider) fetchLicense(ctx context.Context) (*enterprise.License, error
}
if _, err := p.store.UpsertSettingV2(ctx, &store.SetSettingMessage{
- Name: base.SettingEnterpriseLicense,
+ Name: storepb.SettingName_ENTERPRISE_LICENSE,
Value: license,
}); err != nil {
return nil, errors.Wrapf(err, "failed to store the license")
@@ -154,7 +155,7 @@ func (p *Provider) parseLicense(ctx context.Context, license string) (*enterpris
func (p *Provider) findEnterpriseLicense(ctx context.Context) (*enterprise.License, error) {
// Find enterprise license.
- setting, err := p.store.GetSettingV2(ctx, base.SettingEnterpriseLicense)
+ setting, err := p.store.GetSettingV2(ctx, storepb.SettingName_ENTERPRISE_LICENSE)
if err != nil {
return nil, errors.Wrapf(err, "failed to load enterprise license from settings")
}
diff --git a/backend/enterprise/plugin/hub/remote_provider.go b/backend/enterprise/plugin/hub/remote_provider.go
index bb75437c8d..7dd9b657a8 100644
--- a/backend/enterprise/plugin/hub/remote_provider.go
+++ b/backend/enterprise/plugin/hub/remote_provider.go
@@ -12,7 +12,6 @@ import (
"github.com/golang-jwt/jwt/v5"
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/backend/base"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/enterprise/config"
"github.com/bytebase/bytebase/backend/store"
@@ -64,7 +63,7 @@ func (p *remoteLicenseProvider) FetchLicense(ctx context.Context) (string, error
return "", nil
}
- setting, err := p.store.GetSettingV2(ctx, base.SettingPluginAgent)
+ setting, err := p.store.GetSettingV2(ctx, storepb.SettingName_PLUGIN_AGENT)
if err != nil {
return "", errors.Wrapf(err, "failed to find the hub token from settings")
}
diff --git a/backend/migrator/migration/3.7/0019##migrate_setting_name.sql b/backend/migrator/migration/3.7/0019##migrate_setting_name.sql
new file mode 100644
index 0000000000..333226817e
--- /dev/null
+++ b/backend/migrator/migration/3.7/0019##migrate_setting_name.sql
@@ -0,0 +1,23 @@
+-- Update setting name values to match proto enum names
+UPDATE setting SET name = CASE
+ WHEN name = 'bb.auth.secret' THEN 'AUTH_SECRET'
+ WHEN name = 'bb.branding.logo' THEN 'BRANDING_LOGO'
+ WHEN name = 'bb.workspace.id' THEN 'WORKSPACE_ID'
+ WHEN name = 'bb.workspace.profile' THEN 'WORKSPACE_PROFILE'
+ WHEN name = 'bb.workspace.approval' THEN 'WORKSPACE_APPROVAL'
+ WHEN name = 'bb.workspace.approval.external' THEN 'WORKSPACE_EXTERNAL_APPROVAL'
+ WHEN name = 'bb.enterprise.license' THEN 'ENTERPRISE_LICENSE'
+ WHEN name = 'bb.app.im' THEN 'APP_IM'
+ WHEN name = 'bb.workspace.watermark' THEN 'WATERMARK'
+ WHEN name = 'bb.ai' THEN 'AI'
+ WHEN name = 'bb.plugin.agent' THEN 'PLUGIN_AGENT'
+ WHEN name = 'bb.workspace.mail-delivery' THEN 'WORKSPACE_MAIL_DELIVERY'
+ WHEN name = 'bb.workspace.schema-template' THEN 'SCHEMA_TEMPLATE'
+ WHEN name = 'bb.workspace.data-classification' THEN 'DATA_CLASSIFICATION'
+ WHEN name = 'bb.workspace.semantic-types' THEN 'SEMANTIC_TYPES'
+ WHEN name = 'bb.workspace.maximum-sql-result-size' THEN 'SQL_RESULT_SIZE_LIMIT'
+ WHEN name = 'bb.workspace.scim' THEN 'SCIM'
+ WHEN name = 'bb.workspace.password-restriction' THEN 'PASSWORD_RESTRICTION'
+ WHEN name = 'bb.workspace.environment' THEN 'ENVIRONMENT'
+ ELSE name
+END;
\ No newline at end of file
diff --git a/backend/migrator/migrator_test.go b/backend/migrator/migrator_test.go
index 602a5e9a38..26f2280e4c 100644
--- a/backend/migrator/migrator_test.go
+++ b/backend/migrator/migrator_test.go
@@ -12,7 +12,7 @@ import (
func TestLatestVersion(t *testing.T) {
files, err := getSortedVersionedFiles()
require.NoError(t, err)
- require.Equal(t, semver.MustParse("3.7.18"), *files[len(files)-1].version)
+ require.Equal(t, semver.MustParse("3.7.19"), *files[len(files)-1].version)
}
func TestVersionUnique(t *testing.T) {
diff --git a/backend/server/init.go b/backend/server/init.go
index a04988a5c0..d9d649543c 100644
--- a/backend/server/init.go
+++ b/backend/server/init.go
@@ -22,7 +22,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
// initial branding
_, firstTimeOnboarding, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingBrandingLogo,
+ Name: storepb.SettingName_BRANDING_LOGO,
Value: "",
})
if err != nil {
@@ -35,7 +35,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to generate random JWT secret")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingAuthSecret,
+ Name: storepb.SettingName_AUTH_SECRET,
Value: secret,
}); err != nil {
return err
@@ -43,7 +43,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
// initial workspace
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingWorkspaceID,
+ Name: storepb.SettingName_WORKSPACE_ID,
Value: uuid.New().String(),
}); err != nil {
return err
@@ -61,7 +61,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to marshal initial scim setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingSCIM,
+ Name: storepb.SettingName_SCIM,
Value: string(scimSettingValue),
}); err != nil {
return err
@@ -80,7 +80,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to marshal initial password validation setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingPasswordRestriction,
+ Name: storepb.SettingName_PASSWORD_RESTRICTION,
Value: string(passwordSettingValue),
}); err != nil {
return err
@@ -88,7 +88,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
// initial license
if _, _, err = s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingEnterpriseLicense,
+ Name: storepb.SettingName_ENTERPRISE_LICENSE,
Value: "",
}); err != nil {
return err
@@ -96,7 +96,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
// initial IM app
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingAppIM,
+ Name: storepb.SettingName_APP_IM,
Value: "{}",
}); err != nil {
return err
@@ -104,7 +104,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
// initial watermark setting
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingWatermark,
+ Name: storepb.SettingName_WATERMARK,
Value: "0",
}); err != nil {
return err
@@ -116,7 +116,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to marshal initial schema template setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingSchemaTemplate,
+ Name: storepb.SettingName_SCHEMA_TEMPLATE,
Value: string(schemaTemplateSettingValue),
}); err != nil {
return err
@@ -128,7 +128,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to marshal initial data classification setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingDataClassification,
+ Name: storepb.SettingName_DATA_CLASSIFICATION,
Value: string(dataClassificationSettingValue),
}); err != nil {
return err
@@ -140,7 +140,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrap(err, "failed to marshal initial workspace approval setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingWorkspaceApproval,
+ Name: storepb.SettingName_WORKSPACE_APPROVAL,
// Value is ""
Value: string(approvalSettingValue),
}); err != nil {
@@ -148,7 +148,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
}
// initial workspace profile setting
- workspaceProfileSetting, err := s.store.GetSettingV2(ctx, base.SettingWorkspaceProfile)
+ workspaceProfileSetting, err := s.store.GetSettingV2(ctx, storepb.SettingName_WORKSPACE_PROFILE)
if err != nil {
return err
}
@@ -172,7 +172,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
}
if _, err := s.store.UpsertSettingV2(ctx, &store.SetSettingMessage{
- Name: base.SettingWorkspaceProfile,
+ Name: storepb.SettingName_WORKSPACE_PROFILE,
Value: string(bytes),
}); err != nil {
return err
@@ -207,7 +207,7 @@ func (s *Server) initializeSetting(ctx context.Context) error {
return errors.Wrapf(err, "failed to marshal initial environment setting")
}
if _, _, err := s.store.CreateSettingIfNotExistV2(ctx, &store.SettingMessage{
- Name: base.SettingEnvironment,
+ Name: storepb.SettingName_ENVIRONMENT,
Value: string(environmentSettingValue),
}); err != nil {
return err
diff --git a/backend/store/setting.go b/backend/store/setting.go
index be59dacda9..650d682379 100644
--- a/backend/store/setting.go
+++ b/backend/store/setting.go
@@ -9,7 +9,6 @@ import (
"github.com/pkg/errors"
- "github.com/bytebase/bytebase/backend/base"
"github.com/bytebase/bytebase/backend/common"
"github.com/bytebase/bytebase/backend/common/log"
storepb "github.com/bytebase/bytebase/proto/generated-go/store"
@@ -17,18 +16,18 @@ import (
// FindSettingMessage is the message for finding setting.
type FindSettingMessage struct {
- Name *base.SettingName
+ Name *storepb.SettingName
}
// SetSettingMessage is the message for updating setting.
type SetSettingMessage struct {
- Name base.SettingName
+ Name storepb.SettingName
Value string
}
// SettingMessage is the message of setting.
type SettingMessage struct {
- Name base.SettingName
+ Name storepb.SettingName
Value string
}
@@ -36,7 +35,7 @@ func (s *Store) GetPasswordRestrictionSetting(ctx context.Context) (*storepb.Pas
passwordRestriction := &storepb.PasswordRestrictionSetting{
MinLength: 8,
}
- setting, err := s.GetSettingV2(ctx, base.SettingPasswordRestriction)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_PASSWORD_RESTRICTION)
if err != nil {
return nil, err
}
@@ -51,9 +50,9 @@ func (s *Store) GetPasswordRestrictionSetting(ctx context.Context) (*storepb.Pas
}
func (s *Store) GetMaximumSQLResultLimit(ctx context.Context) int64 {
- setting, err := s.GetSettingV2(ctx, base.SettingSQLResultSizeLimit)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_SQL_RESULT_SIZE_LIMIT)
if err != nil {
- slog.Error("failed to get setting", slog.String("setting", string(base.SettingSQLResultSizeLimit)), log.BBError(err))
+ slog.Error("failed to get setting", slog.String("setting", string(storepb.SettingName_SQL_RESULT_SIZE_LIMIT)), log.BBError(err))
return common.DefaultMaximumSQLResultSize
}
if setting == nil {
@@ -62,7 +61,7 @@ func (s *Store) GetMaximumSQLResultLimit(ctx context.Context) int64 {
payload := new(storepb.MaximumSQLResultSizeSetting)
if err := common.ProtojsonUnmarshaler.Unmarshal([]byte(setting.Value), payload); err != nil {
- slog.Error("failed to unmarshaler setting", slog.String("setting", string(base.SettingSQLResultSizeLimit)), log.BBError(err))
+ slog.Error("failed to unmarshaler setting", slog.String("setting", string(storepb.SettingName_SQL_RESULT_SIZE_LIMIT)), log.BBError(err))
return common.DefaultMaximumSQLResultSize
}
if payload.Limit <= 0 {
@@ -73,12 +72,12 @@ func (s *Store) GetMaximumSQLResultLimit(ctx context.Context) int64 {
// GetWorkspaceGeneralSetting gets the workspace general setting payload.
func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.WorkspaceProfileSetting, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingWorkspaceProfile)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_WORKSPACE_PROFILE)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get setting %v", base.SettingWorkspaceProfile)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_WORKSPACE_PROFILE)
}
if setting == nil {
- return nil, errors.Errorf("cannot find setting %v", base.SettingWorkspaceProfile)
+ return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_WORKSPACE_PROFILE)
}
payload := new(storepb.WorkspaceProfileSetting)
@@ -89,12 +88,12 @@ func (s *Store) GetWorkspaceGeneralSetting(ctx context.Context) (*storepb.Worksp
}
func (s *Store) GetAppIMSetting(ctx context.Context) (*storepb.AppIMSetting, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingAppIM)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_APP_IM)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get setting %v", base.SettingAppIM)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_APP_IM)
}
if setting == nil {
- return nil, errors.Errorf("cannot find setting %v", base.SettingAppIM)
+ return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_APP_IM)
}
payload := new(storepb.AppIMSetting)
@@ -106,24 +105,24 @@ func (s *Store) GetAppIMSetting(ctx context.Context) (*storepb.AppIMSetting, err
// GetWorkspaceID finds the workspace id in setting bb.workspace.id.
func (s *Store) GetWorkspaceID(ctx context.Context) (string, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingWorkspaceID)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_WORKSPACE_ID)
if err != nil {
- return "", errors.Wrapf(err, "failed to get setting %v", base.SettingWorkspaceID)
+ return "", errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_WORKSPACE_ID)
}
if setting == nil {
- return "", errors.Errorf("cannot find setting %v", base.SettingWorkspaceID)
+ return "", errors.Errorf("cannot find setting %v", storepb.SettingName_WORKSPACE_ID)
}
return setting.Value, nil
}
// GetWorkspaceApprovalSetting gets the workspace approval setting.
func (s *Store) GetWorkspaceApprovalSetting(ctx context.Context) (*storepb.WorkspaceApprovalSetting, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingWorkspaceApproval)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_WORKSPACE_APPROVAL)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get setting %v", base.SettingWorkspaceApproval)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_WORKSPACE_APPROVAL)
}
if setting == nil {
- return nil, errors.Errorf("cannot find setting %v", base.SettingWorkspaceApproval)
+ return nil, errors.Errorf("cannot find setting %v", storepb.SettingName_WORKSPACE_APPROVAL)
}
payload := new(storepb.WorkspaceApprovalSetting)
@@ -135,9 +134,9 @@ func (s *Store) GetWorkspaceApprovalSetting(ctx context.Context) (*storepb.Works
// GetSemanticTypesSetting gets the semantic types setting.
func (s *Store) GetSemanticTypesSetting(ctx context.Context) (*storepb.SemanticTypeSetting, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingSemanticTypes)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_SEMANTIC_TYPES)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get setting %v", base.SettingSemanticTypes)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_SEMANTIC_TYPES)
}
if setting == nil {
return &storepb.SemanticTypeSetting{}, nil
@@ -152,9 +151,9 @@ func (s *Store) GetSemanticTypesSetting(ctx context.Context) (*storepb.SemanticT
// GetDataClassificationSetting gets the data classification setting.
func (s *Store) GetDataClassificationSetting(ctx context.Context) (*storepb.DataClassificationSetting, error) {
- setting, err := s.GetSettingV2(ctx, base.SettingDataClassification)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_DATA_CLASSIFICATION)
if err != nil {
- return nil, errors.Wrapf(err, "failed to get setting %v", base.SettingDataClassification)
+ return nil, errors.Wrapf(err, "failed to get setting %v", storepb.SettingName_DATA_CLASSIFICATION)
}
if setting == nil {
return &storepb.DataClassificationSetting{}, nil
@@ -183,7 +182,7 @@ func (s *Store) GetDataClassificationConfigByID(ctx context.Context, classificat
func (s *Store) GetAISetting(ctx context.Context) (*storepb.AISetting, error) {
aiSetting := &storepb.AISetting{}
- setting, err := s.GetSettingV2(ctx, base.SettingAI)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_AI)
if err != nil {
return nil, err
}
@@ -199,7 +198,7 @@ func (s *Store) GetAISetting(ctx context.Context) (*storepb.AISetting, error) {
func (s *Store) GetEnvironmentSetting(ctx context.Context) (*storepb.EnvironmentSetting, error) {
envSetting := &storepb.EnvironmentSetting{}
- setting, err := s.GetSettingV2(ctx, base.SettingEnvironment)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_ENVIRONMENT)
if err != nil {
return nil, err
}
@@ -222,7 +221,7 @@ func (s *Store) DeleteCache() {
}
// GetSettingV2 returns the setting by name.
-func (s *Store) GetSettingV2(ctx context.Context, name base.SettingName) (*SettingMessage, error) {
+func (s *Store) GetSettingV2(ctx context.Context, name storepb.SettingName) (*SettingMessage, error) {
if v, ok := s.settingCache.Get(name); ok && s.enableCache {
return v, nil
}
@@ -277,7 +276,7 @@ func (s *Store) GetSecret(ctx context.Context) (string, error) {
if s.Secret != "" {
return s.Secret, nil
}
- setting, err := s.GetSettingV2(ctx, base.SettingAuthSecret)
+ setting, err := s.GetSettingV2(ctx, storepb.SettingName_AUTH_SECRET)
if err != nil {
return "", err
}
@@ -292,7 +291,7 @@ func (s *Store) GetSecret(ctx context.Context) (string, error) {
func (s *Store) UpsertSettingV2(ctx context.Context, update *SetSettingMessage) (*SettingMessage, error) {
fields := []string{"name", "value"}
updateFields := []string{"value = EXCLUDED.value"}
- valuePlaceholders, args := []string{"$1", "$2"}, []any{update.Name, update.Value}
+ valuePlaceholders, args := []string{"$1", "$2"}, []any{update.Name.String(), update.Value}
query := `INSERT INTO setting (` + strings.Join(fields, ", ") + `)
VALUES (` + strings.Join(valuePlaceholders, ", ") + `)
@@ -306,8 +305,9 @@ func (s *Store) UpsertSettingV2(ctx context.Context, update *SetSettingMessage)
defer tx.Rollback()
var setting SettingMessage
+ var nameString string
if err := tx.QueryRowContext(ctx, query, args...).Scan(
- &setting.Name,
+ &nameString,
&setting.Value,
); err != nil {
if err == sql.ErrNoRows {
@@ -315,6 +315,11 @@ func (s *Store) UpsertSettingV2(ctx context.Context, update *SetSettingMessage)
}
return nil, err
}
+ value, ok := storepb.SettingName_value[nameString]
+ if !ok {
+ return nil, errors.Errorf("invalid setting name string: %s", nameString)
+ }
+ setting.Name = storepb.SettingName(value)
if err := tx.Commit(); err != nil {
return nil, errors.Wrap(err, "failed to commit transaction")
@@ -347,18 +352,24 @@ func (s *Store) CreateSettingIfNotExistV2(ctx context.Context, create *SettingMe
}
fields := []string{"name", "value"}
- valuesPlaceholders, args := []string{"$1", "$2"}, []any{create.Name, create.Value}
+ valuesPlaceholders, args := []string{"$1", "$2"}, []any{create.Name.String(), create.Value}
query := `INSERT INTO setting (` + strings.Join(fields, ",") + `)
VALUES (` + strings.Join(valuesPlaceholders, ",") + `)
RETURNING name, value`
var setting SettingMessage
+ var nameString string
if err := tx.QueryRowContext(ctx, query, args...).Scan(
- &setting.Name,
+ &nameString,
&setting.Value,
); err != nil {
return nil, false, err
}
+ value, ok := storepb.SettingName_value[nameString]
+ if !ok {
+ return nil, false, errors.Errorf("invalid setting name string: %s", nameString)
+ }
+ setting.Name = storepb.SettingName(value)
if err := tx.Commit(); err != nil {
return nil, false, errors.Wrap(err, "failed to commit transaction")
@@ -368,14 +379,14 @@ func (s *Store) CreateSettingIfNotExistV2(ctx context.Context, create *SettingMe
}
// DeleteSettingV2 deletes a setting by the name.
-func (s *Store) DeleteSettingV2(ctx context.Context, name base.SettingName) error {
+func (s *Store) DeleteSettingV2(ctx context.Context, name storepb.SettingName) error {
tx, err := s.db.BeginTx(ctx, nil)
if err != nil {
return errors.Wrap(err, "failed to begin transaction")
}
defer tx.Rollback()
- if _, err := tx.ExecContext(ctx, `DELETE FROM setting WHERE name = $1`, name); err != nil {
+ if _, err := tx.ExecContext(ctx, `DELETE FROM setting WHERE name = $1`, name.String()); err != nil {
return err
}
@@ -390,7 +401,7 @@ func (s *Store) DeleteSettingV2(ctx context.Context, name base.SettingName) erro
func listSettingV2Impl(ctx context.Context, txn *sql.Tx, find *FindSettingMessage) ([]*SettingMessage, error) {
where, args := []string{"TRUE"}, []any{}
if v := find.Name; v != nil {
- where, args = append(where, fmt.Sprintf("name = $%d", len(args)+1)), append(args, *v)
+ where, args = append(where, fmt.Sprintf("name = $%d", len(args)+1)), append(args, v.String())
}
rows, err := txn.QueryContext(ctx, `
SELECT
@@ -406,12 +417,18 @@ func listSettingV2Impl(ctx context.Context, txn *sql.Tx, find *FindSettingMessag
var settingMessages []*SettingMessage
for rows.Next() {
var settingMessage SettingMessage
+ var nameString string
if err := rows.Scan(
- &settingMessage.Name,
+ &nameString,
&settingMessage.Value,
); err != nil {
return nil, err
}
+ value, ok := storepb.SettingName_value[nameString]
+ if !ok {
+ return nil, errors.Errorf("invalid setting name string: %s", nameString)
+ }
+ settingMessage.Name = storepb.SettingName(value)
settingMessages = append(settingMessages, &settingMessage)
}
if err := rows.Err(); err != nil {
diff --git a/backend/store/store.go b/backend/store/store.go
index 5a4ea18df5..928aeb2f70 100644
--- a/backend/store/store.go
+++ b/backend/store/store.go
@@ -31,7 +31,7 @@ type Store struct {
issueCache *lru.Cache[int, *IssueMessage]
issueByPipelineCache *lru.Cache[int, *IssueMessage]
pipelineCache *lru.Cache[int, *PipelineMessage]
- settingCache *lru.Cache[base.SettingName, *SettingMessage]
+ settingCache *lru.Cache[storepb.SettingName, *SettingMessage]
idpCache *lru.Cache[string, *IdentityProviderMessage]
risksCache *lru.Cache[int, []*RiskMessage] // Use 0 as the key.
databaseGroupCache *lru.Cache[string, *DatabaseGroupMessage]
@@ -82,7 +82,7 @@ func New(ctx context.Context, pgURL string, enableCache bool) (*Store, error) {
if err != nil {
return nil, err
}
- settingCache, err := lru.New[base.SettingName, *SettingMessage](64)
+ settingCache, err := lru.New[storepb.SettingName, *SettingMessage](64)
if err != nil {
return nil, err
}
diff --git a/backend/tests/environment.go b/backend/tests/environment.go
index e9eb8ac634..94b7208ca8 100644
--- a/backend/tests/environment.go
+++ b/backend/tests/environment.go
@@ -13,7 +13,7 @@ import (
func (ctl *controller) getEnvironment(ctx context.Context, id string) (*v1pb.EnvironmentSetting_Environment, error) {
setting, err := ctl.settingServiceClient.GetSetting(ctx,
&v1pb.GetSettingRequest{
- Name: "settings/bb.workspace.environment",
+ Name: "settings/" + v1pb.Setting_ENVIRONMENT.String(),
})
if err != nil {
return nil, err
@@ -33,7 +33,7 @@ func (ctl *controller) getEnvironment(ctx context.Context, id string) (*v1pb.Env
func (ctl *controller) createEnvironment(ctx context.Context, id, title string) (*v1pb.EnvironmentSetting_Environment, error) {
setting, err := ctl.settingServiceClient.GetSetting(ctx,
&v1pb.GetSettingRequest{
- Name: "settings/bb.workspace.environment",
+ Name: "settings/" + v1pb.Setting_ENVIRONMENT.String(),
})
if err != nil {
return nil, err
@@ -46,7 +46,7 @@ func (ctl *controller) createEnvironment(ctx context.Context, id, title string)
_, err = ctl.settingServiceClient.UpdateSetting(ctx,
&v1pb.UpdateSettingRequest{
Setting: &v1pb.Setting{
- Name: "settings/bb.workspace.environment",
+ Name: "settings/" + v1pb.Setting_ENVIRONMENT.String(),
Value: &v1pb.Value{
Value: &v1pb.Value_EnvironmentSetting{
EnvironmentSetting: &v1pb.EnvironmentSetting{
diff --git a/backend/tests/sensitive_data_test.go b/backend/tests/sensitive_data_test.go
index 53dae68cf5..28b84850c6 100644
--- a/backend/tests/sensitive_data_test.go
+++ b/backend/tests/sensitive_data_test.go
@@ -106,7 +106,7 @@ func TestSensitiveData(t *testing.T) {
_, err = ctl.settingServiceClient.UpdateSetting(ctx, &v1pb.UpdateSettingRequest{
Setting: &v1pb.Setting{
- Name: "settings/bb.workspace.semantic-types",
+ Name: "settings/" + v1pb.Setting_SEMANTIC_TYPES.String(),
Value: &v1pb.Value{
Value: &v1pb.Value_SemanticTypeSettingValue{
SemanticTypeSettingValue: &v1pb.SemanticTypeSetting{
diff --git a/backend/tests/tests.go b/backend/tests/tests.go
index 7c85e65790..b4b2c08b1d 100644
--- a/backend/tests/tests.go
+++ b/backend/tests/tests.go
@@ -28,7 +28,6 @@ import (
// init() in pgx/v5/stdlib will register it's pgx driver.
_ "github.com/jackc/pgx/v5/stdlib"
- "github.com/bytebase/bytebase/backend/base"
"github.com/bytebase/bytebase/backend/common"
component "github.com/bytebase/bytebase/backend/component/config"
"github.com/bytebase/bytebase/backend/server"
@@ -184,7 +183,7 @@ func (ctl *controller) initWorkspaceProfile(ctx context.Context) error {
_, err := ctl.settingServiceClient.UpdateSetting(ctx, &v1pb.UpdateSettingRequest{
AllowMissing: true,
Setting: &v1pb.Setting{
- Name: fmt.Sprintf("settings/%s", base.SettingWorkspaceProfile),
+ Name: "settings/" + v1pb.Setting_WORKSPACE_PROFILE.String(),
Value: &v1pb.Value{
Value: &v1pb.Value_WorkspaceProfileSettingValue{
WorkspaceProfileSettingValue: &v1pb.WorkspaceProfileSetting{
diff --git a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
index a1ca8e47db..c2eac0ca7c 100644
--- a/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
+++ b/frontend/src/components/GeneralSetting/AIAugmentationSetting.vue
@@ -165,6 +165,7 @@ import { useSettingV1Store } from "@/store/modules/v1/setting";
import {
AISetting,
AISetting_Provider,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
import { FeatureBadge } from "../FeatureGuard";
@@ -194,7 +195,7 @@ const state = reactive<LocalState>({
});
const aiSetting = computed(
- () => settingV1Store.getSettingByName("bb.ai")?.value?.aiSetting
+ () => settingV1Store.getSettingByName(Setting_SettingName.AI)?.value?.aiSetting
);
const hasAIFeature = computed(() => hasFeature("bb.feature.ai-assistant"));
@@ -295,7 +296,7 @@ const toggleAIEnabled = (on: boolean) => {
const updateAISetting = async () => {
await settingV1Store.upsertSetting({
- name: "bb.ai",
+ name: Setting_SettingName.AI,
value: {
aiSetting: AISetting.fromPartial({
...(aiSetting.value ?? {}),
diff --git a/frontend/src/components/GeneralSetting/BrandingSetting.vue b/frontend/src/components/GeneralSetting/BrandingSetting.vue
index 4b350fa10b..607b5b2c94 100644
--- a/frontend/src/components/GeneralSetting/BrandingSetting.vue
+++ b/frontend/src/components/GeneralSetting/BrandingSetting.vue
@@ -67,6 +67,7 @@ import { computed, reactive } from "vue";
import { featureToRef } from "@/store";
import { useActuatorV1Store } from "@/store/modules/v1/actuator";
import { useSettingV1Store } from "@/store/modules/v1/setting";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
import SingleFileSelector from "../SingleFileSelector.vue";
@@ -114,7 +115,7 @@ const doUpdate = async (content: string) => {
state.loading = true;
try {
await settingV1Store.upsertSetting({
- name: "bb.branding.logo",
+ name: Setting_SettingName.BRANDING_LOGO,
value: {
stringValue: content,
},
diff --git a/frontend/src/components/GeneralSetting/MaximumSQLResultSizeSetting.vue b/frontend/src/components/GeneralSetting/MaximumSQLResultSizeSetting.vue
index 359ca5e419..33e500dceb 100644
--- a/frontend/src/components/GeneralSetting/MaximumSQLResultSizeSetting.vue
+++ b/frontend/src/components/GeneralSetting/MaximumSQLResultSizeSetting.vue
@@ -28,6 +28,7 @@ import Long from "long";
import { NInputNumber } from "naive-ui";
import { ref, computed } from "vue";
import { useSettingV1Store } from "@/store/modules/v1/setting";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
defineProps<{
allowEdit: boolean;
@@ -38,7 +39,7 @@ const timing = ref<ReturnType<typeof setTimeout>>();
const initialState = () => {
const limit =
- settingV1Store.getSettingByName("bb.workspace.maximum-sql-result-size")
+ settingV1Store.getSettingByName(Setting_SettingName.SQL_RESULT_SIZE_LIMIT)
?.value?.maximumSqlResultSizeSetting?.limit ??
Long.fromNumber(100 * 1024 * 1024);
@@ -57,7 +58,7 @@ const updateChange = async () => {
}
clearTimeout(timing.value);
await settingV1Store.upsertSetting({
- name: "bb.workspace.maximum-sql-result-size",
+ name: Setting_SettingName.SQL_RESULT_SIZE_LIMIT,
value: {
maximumSqlResultSizeSetting: {
limit: Long.fromNumber(maximumSQLResultLimit.value * 1024 * 1024),
diff --git a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
index 3d1014fddb..9615240963 100644
--- a/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
+++ b/frontend/src/components/GeneralSetting/PasswordRestrictionSetting.vue
@@ -180,7 +180,7 @@ import { computed, ref, reactive } from "vue";
import { featureToRef } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { Duration } from "@/types/proto/google/protobuf/duration";
-import { PasswordRestrictionSetting } from "@/types/proto/v1/setting_service";
+import { PasswordRestrictionSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
const DEFAULT_MIN_LENGTH = 8;
@@ -195,7 +195,7 @@ const hasPasswordFeature = featureToRef("bb.feature.password-restriction");
const passwordRestrictionSetting = computed(
() =>
- settingV1Store.getSettingByName("bb.workspace.password-restriction")?.value
+ settingV1Store.getSettingByName(Setting_SettingName.PASSWORD_RESTRICTION)?.value
?.passwordRestrictionSetting ?? PasswordRestrictionSetting.fromPartial({})
);
@@ -215,7 +215,7 @@ defineExpose({
isDirty: computed(() => !isEqual(passwordRestrictionSetting.value, state)),
update: async () => {
await settingV1Store.upsertSetting({
- name: "bb.workspace.password-restriction",
+ name: Setting_SettingName.PASSWORD_RESTRICTION,
value: {
passwordRestrictionSetting: {
...state,
diff --git a/frontend/src/components/GeneralSetting/SecuritySetting.vue b/frontend/src/components/GeneralSetting/SecuritySetting.vue
index 8c296c3a25..16c30eeb2e 100644
--- a/frontend/src/components/GeneralSetting/SecuritySetting.vue
+++ b/frontend/src/components/GeneralSetting/SecuritySetting.vue
@@ -88,6 +88,7 @@ import {
PolicyType,
PolicyResourceType,
} from "@/types/proto/v1/org_policy_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { FeatureBadge, FeatureModal } from "../FeatureGuard";
import DomainRestrictionSetting from "./DomainRestrictionSetting.vue";
import MaximumRoleExpirationSetting from "./MaximumRoleExpirationSetting.vue";
@@ -140,7 +141,7 @@ const { policy: exportDataPolicy } = usePolicyByParentAndType(
const getInitialState = (): LocalState => {
return {
enableWatermark:
- settingV1Store.getSettingByName("bb.workspace.watermark")?.value
+ settingV1Store.getSettingByName(Setting_SettingName.WATERMARK)?.value
?.stringValue === "1",
enableDataExport: !exportDataPolicy.value?.exportDataPolicy?.disable,
};
@@ -173,7 +174,7 @@ const handleDataExportToggle = async () => {
const handleWatermarkToggle = async () => {
const value = state.enableWatermark ? "1" : "0";
await settingV1Store.upsertSetting({
- name: "bb.workspace.watermark",
+ name: Setting_SettingName.WATERMARK,
value: {
stringValue: value,
},
diff --git a/frontend/src/components/ProjectWebhookForm.vue b/frontend/src/components/ProjectWebhookForm.vue
index df7c4b2948..637071e7eb 100644
--- a/frontend/src/components/ProjectWebhookForm.vue
+++ b/frontend/src/components/ProjectWebhookForm.vue
@@ -265,6 +265,7 @@ import {
type Activity_Type,
type Webhook,
} from "@/types/proto/v1/project_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { projectWebhookV1Slug } from "../utils";
import WebhookTypeIcon from "./Project/WebhookTypeIcon.vue";
@@ -335,7 +336,7 @@ const selectedWebhook = computed(() => {
});
const imSetting = computed(
- () => settingStore.getSettingByName("bb.app.im")?.value?.appImSettingValue
+ () => settingStore.getSettingByName(Setting_SettingName.APP_IM)?.value?.appImSettingValue
);
const imApp = computed(() => {
diff --git a/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue b/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
index b10abb90bf..f871685366 100644
--- a/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
+++ b/frontend/src/components/SchemaEditorLite/Panels/TableColumnEditor/TableColumnEditor.vue
@@ -70,6 +70,7 @@ import { useSettingV1Store, hasFeature } from "@/store";
import type { ComposedDatabase } from "@/types";
import { Engine } from "@/types/proto/v1/common";
import { ColumnCatalog } from "@/types/proto/v1/database_catalog_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import type {
ColumnMetadata,
DatabaseMetadata,
@@ -236,7 +237,7 @@ const markColumnStatus = (
const semanticTypeList = computed(() => {
return (
- settingStore.getSettingByName("bb.workspace.semantic-types")?.value
+ settingStore.getSettingByName(Setting_SettingName.SEMANTIC_TYPES)?.value
?.semanticTypeSettingValue?.types ?? []
);
});
@@ -622,7 +623,7 @@ const isColumnPrimaryKey = (column: ColumnMetadata): boolean => {
};
const schemaTemplateColumnTypes = computed(() => {
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
const columnTypes = setting?.value?.schemaTemplateSettingValue?.columnTypes;
if (columnTypes && columnTypes.length > 0) {
const columnType = columnTypes.find(
diff --git a/frontend/src/components/SchemaEditorLite/SchemaEditorLite.vue b/frontend/src/components/SchemaEditorLite/SchemaEditorLite.vue
index 6a30c0875d..4366c635e2 100644
--- a/frontend/src/components/SchemaEditorLite/SchemaEditorLite.vue
+++ b/frontend/src/components/SchemaEditorLite/SchemaEditorLite.vue
@@ -28,6 +28,7 @@ import MaskSpinner from "@/components/misc/MaskSpinner.vue";
import { useEmitteryEventListener } from "@/composables/useEmitteryEventListener";
import { useSettingV1Store } from "@/store";
import type { ComposedProject } from "@/types";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import Aside from "./Aside";
import Editor from "./Editor.vue";
import { useAlgorithm } from "./algorithm";
@@ -62,7 +63,7 @@ const state = reactive<LocalState>({
// Prepare schema template contexts.
onMounted(async () => {
- await settingStore.getOrFetchSettingByName("bb.workspace.schema-template");
+ await settingStore.getOrFetchSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
state.initialized = true;
});
diff --git a/frontend/src/components/SchemaTemplate/FieldTemplateForm.vue b/frontend/src/components/SchemaTemplate/FieldTemplateForm.vue
index acc73b3916..ecbead61bc 100644
--- a/frontend/src/components/SchemaTemplate/FieldTemplateForm.vue
+++ b/frontend/src/components/SchemaTemplate/FieldTemplateForm.vue
@@ -266,6 +266,7 @@ import { ColumnMetadata } from "@/types/proto/v1/database_service";
import {
SchemaTemplateSetting,
SchemaTemplateSetting_FieldTemplate,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
import {
getDataTypeSuggestionList,
@@ -311,7 +312,7 @@ const settingStore = useSettingV1Store();
const semanticTypeList = computed(() => {
return (
- settingStore.getSettingByName("bb.workspace.semantic-types")?.value
+ settingStore.getSettingByName(Setting_SettingName.SEMANTIC_TYPES)?.value
?.semanticTypeSettingValue?.types ?? []
);
});
@@ -380,7 +381,7 @@ const defaultValueOptions = computed(() => {
});
const schemaTemplateColumnTypes = computed(() => {
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
const columnTypes = setting?.value?.schemaTemplateSettingValue?.columnTypes;
if (columnTypes && columnTypes.length > 0) {
const columnType = columnTypes.find(
@@ -422,7 +423,7 @@ const submit = async () => {
}),
});
const setting = await settingStore.fetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const settingValue = SchemaTemplateSetting.fromPartial({});
@@ -443,7 +444,7 @@ const submit = async () => {
}
await settingStore.upsertSetting({
- name: "bb.workspace.schema-template",
+ name: Setting_SettingName.SCHEMA_TEMPLATE,
value: {
schemaTemplateSettingValue: settingValue,
},
diff --git a/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue b/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
index 072238f7c9..6eacc334c5 100644
--- a/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
+++ b/frontend/src/components/SchemaTemplate/FieldTemplateTable.vue
@@ -22,7 +22,7 @@ import { DatabaseLabelsCell } from "@/components/v2/Model/DatabaseV1Table/cells"
import { useSettingV1Store } from "@/store";
import type { Engine } from "@/types/proto/v1/common";
import type { SchemaTemplateSetting_FieldTemplate } from "@/types/proto/v1/setting_service";
-import { SchemaTemplateSetting } from "@/types/proto/v1/setting_service";
+import { SchemaTemplateSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { EngineIcon } from "../Icon";
import ClassificationLevelBadge from "./ClassificationLevelBadge.vue";
import { classificationConfig } from "./utils";
@@ -166,7 +166,7 @@ const rowProps = (row: SchemaTemplateSetting_FieldTemplate) => {
const deleteTemplate = async (id: string) => {
const setting = await settingStore.fetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const settingValue = SchemaTemplateSetting.fromPartial({});
@@ -179,7 +179,7 @@ const deleteTemplate = async (id: string) => {
pullAt(settingValue.fieldTemplates, index);
await settingStore.upsertSetting({
- name: "bb.workspace.schema-template",
+ name: Setting_SettingName.SCHEMA_TEMPLATE,
value: {
schemaTemplateSettingValue: settingValue,
},
@@ -189,7 +189,7 @@ const deleteTemplate = async (id: string) => {
const semanticTypeList = computed(() => {
return (
- settingStore.getSettingByName("bb.workspace.semantic-types")?.value
+ settingStore.getSettingByName(Setting_SettingName.SEMANTIC_TYPES)?.value
?.semanticTypeSettingValue?.types ?? []
);
});
diff --git a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
index b559c6d52d..7e17509010 100644
--- a/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
+++ b/frontend/src/components/SchemaTemplate/TableTemplateForm.vue
@@ -209,7 +209,7 @@ import {
SchemaTemplateSetting_TableTemplate,
type SchemaTemplateSetting_FieldTemplate,
} from "@/types/proto/v1/setting_service";
-import { SchemaTemplateSetting } from "@/types/proto/v1/setting_service";
+import { SchemaTemplateSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { arraySwap, instanceV1AllowsReorderColumns } from "@/utils";
import FieldTemplates from "@/views/SchemaTemplate/FieldTemplates.vue";
import ClassificationLevelBadge from "./ClassificationLevelBadge.vue";
@@ -347,7 +347,7 @@ const onSubmit = async () => {
tableCatalog: tableCatalog.value ?? TableCatalog.fromPartial({}),
});
const setting = await settingStore.fetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const settingValue = SchemaTemplateSetting.fromPartial({});
@@ -368,7 +368,7 @@ const onSubmit = async () => {
}
await settingStore.upsertSetting({
- name: "bb.workspace.schema-template",
+ name: Setting_SettingName.SCHEMA_TEMPLATE,
value: {
schemaTemplateSettingValue: settingValue,
},
diff --git a/frontend/src/components/SchemaTemplate/TableTemplateTable.vue b/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
index 4d4c78f868..2d8be2f7d7 100644
--- a/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
+++ b/frontend/src/components/SchemaTemplate/TableTemplateTable.vue
@@ -20,7 +20,7 @@ import { MiniActionButton } from "@/components/v2";
import { useSettingV1Store } from "@/store";
import type { Engine } from "@/types/proto/v1/common";
import type { SchemaTemplateSetting_TableTemplate } from "@/types/proto/v1/setting_service";
-import { SchemaTemplateSetting } from "@/types/proto/v1/setting_service";
+import { SchemaTemplateSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { EngineIcon } from "../Icon";
import ClassificationLevelBadge from "./ClassificationLevelBadge.vue";
import { classificationConfig } from "./utils";
@@ -133,7 +133,7 @@ const rowProps = (row: SchemaTemplateSetting_TableTemplate) => {
const deleteTemplate = async (id: string) => {
const setting = await settingStore.fetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const settingValue = SchemaTemplateSetting.fromPartial({});
@@ -146,7 +146,7 @@ const deleteTemplate = async (id: string) => {
pullAt(settingValue.tableTemplates, index);
await settingStore.upsertSetting({
- name: "bb.workspace.schema-template",
+ name: Setting_SettingName.SCHEMA_TEMPLATE,
value: {
schemaTemplateSettingValue: settingValue,
},
diff --git a/frontend/src/components/SchemaTemplate/utils.ts b/frontend/src/components/SchemaTemplate/utils.ts
index 53fddea48a..2ccdf61815 100644
--- a/frontend/src/components/SchemaTemplate/utils.ts
+++ b/frontend/src/components/SchemaTemplate/utils.ts
@@ -17,13 +17,14 @@ import {
import {
SchemaTemplateSetting_TableTemplate,
DataClassificationSetting_DataClassificationConfig,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
export const engineList = [Engine.MYSQL, Engine.POSTGRES];
export const categoryList = computed(() => {
const settingStore = useSettingV1Store();
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
const fieldTemplateList =
setting?.value?.schemaTemplateSettingValue?.fieldTemplates ?? [];
const tableTemplateList =
diff --git a/frontend/src/components/SensitiveData/ClassificationView.vue b/frontend/src/components/SensitiveData/ClassificationView.vue
index 32608eacc3..c7ba313c5a 100644
--- a/frontend/src/components/SensitiveData/ClassificationView.vue
+++ b/frontend/src/components/SensitiveData/ClassificationView.vue
@@ -102,8 +102,9 @@ import { featureToRef, useSettingV1Store, pushNotification } from "@/store";
import {
DataClassificationSetting_DataClassificationConfig_Level as ClassificationLevel,
DataClassificationSetting_DataClassificationConfig_DataClassification as DataClassification,
+ DataClassificationSetting_DataClassificationConfig,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
-import { DataClassificationSetting_DataClassificationConfig } from "@/types/proto/v1/setting_service";
import { hasWorkspacePermissionV2 } from "@/utils";
import LearnMoreLink from "../LearnMoreLink.vue";
import ClassificationTree from "../SchemaTemplate/ClassificationTree.vue";
@@ -193,7 +194,7 @@ const saveChanges = async () => {
const upsertSetting = async () => {
await settingStore.upsertSetting({
- name: "bb.workspace.data-classification",
+ name: Setting_SettingName.DATA_CLASSIFICATION,
value: {
dataClassificationSettingValue: {
configs: [state.classification],
diff --git a/frontend/src/components/SensitiveData/SemanticTypesView.vue b/frontend/src/components/SensitiveData/SemanticTypesView.vue
index 3401f8caa6..abaa46ae3e 100644
--- a/frontend/src/components/SensitiveData/SemanticTypesView.vue
+++ b/frontend/src/components/SensitiveData/SemanticTypesView.vue
@@ -43,7 +43,7 @@ import { v4 as uuidv4 } from "uuid";
import { computed, reactive, onMounted } from "vue";
import { useI18n } from "vue-i18n";
import { featureToRef, pushNotification, useSettingV1Store } from "@/store";
-import { SemanticTypeSetting_SemanticType } from "@/types/proto/v1/setting_service";
+import { SemanticTypeSetting_SemanticType, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { hasWorkspacePermissionV2 } from "@/utils";
import SemanticTemplateDrawer from "./components/SemanticTemplateDrawer.vue";
import type { SemanticItem } from "./components/SemanticTypesTable.vue";
@@ -70,7 +70,7 @@ const hasSensitiveDataFeature = featureToRef("bb.feature.sensitive-data");
const semanticTypeSettingValue = computed(() => {
const semanticTypeSetting = settingStore.getSettingByName(
- "bb.workspace.semantic-types"
+ Setting_SettingName.SEMANTIC_TYPES
);
return semanticTypeSetting?.value?.semanticTypeSettingValue?.types ?? [];
});
@@ -108,7 +108,7 @@ const onRemove = async (index: number) => {
}
await settingStore.upsertSetting({
- name: "bb.workspace.semantic-types",
+ name: Setting_SettingName.SEMANTIC_TYPES,
value: {
semanticTypeSettingValue: {
types: state.semanticItemList
@@ -146,7 +146,7 @@ const onUpsert = async (
notification: string
) => {
await settingStore.upsertSetting({
- name: "bb.workspace.semantic-types",
+ name: Setting_SettingName.SEMANTIC_TYPES,
value: {
semanticTypeSettingValue: {
types: semanticItemList,
@@ -168,7 +168,7 @@ const onCancel = (index: number) => {
state.semanticItemList.splice(index, 1);
} else {
const semanticTypeSetting = settingStore.getSettingByName(
- "bb.workspace.semantic-types"
+ Setting_SettingName.SEMANTIC_TYPES
);
const origin = (
semanticTypeSetting?.value?.semanticTypeSettingValue?.types ?? []
diff --git a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
index 72ae3ed92e..93bf6deb42 100644
--- a/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
+++ b/frontend/src/components/SensitiveData/components/MaskingRuleConfig.vue
@@ -103,6 +103,7 @@ import { useSettingV1Store } from "@/store";
import { Expr } from "@/types/proto/google/type/expr";
import type { MaskingRulePolicy_MaskingRule } from "@/types/proto/v1/org_policy_service";
import type { SemanticTypeSetting_SemanticType as SemanticType } from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import {
batchConvertCELStringToParsedExpr,
batchConvertParsedExprToCELString,
@@ -147,7 +148,7 @@ const settingStore = useSettingV1Store();
const semanticTypeSettingValue = computed(() => {
const semanticTypeSetting = settingStore.getSettingByName(
- "bb.workspace.semantic-types"
+ Setting_SettingName.SEMANTIC_TYPES
);
return semanticTypeSetting?.value?.semanticTypeSettingValue?.types ?? [];
});
diff --git a/frontend/src/components/SensitiveData/components/utils.ts b/frontend/src/components/SensitiveData/components/utils.ts
index 8d9556a1fa..19effa88bc 100644
--- a/frontend/src/components/SensitiveData/components/utils.ts
+++ b/frontend/src/components/SensitiveData/components/utils.ts
@@ -6,12 +6,13 @@ import { EqualityOperatorList, CollectionOperatorList } from "@/plugins/cel";
import { useSettingV1Store } from "@/store";
import type { ComposedInstance } from "@/types";
import type { Algorithm } from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { extractInstanceResourceName } from "@/utils";
export const getClassificationLevelOptions = () => {
const settingStore = useSettingV1Store();
const setting = settingStore.getSettingByName(
- "bb.workspace.data-classification"
+ Setting_SettingName.DATA_CLASSIFICATION
);
if (!setting) {
return [];
diff --git a/frontend/src/components/SensitiveData/useSemanticType.ts b/frontend/src/components/SensitiveData/useSemanticType.ts
index 7f90bb4fd0..e677b704f8 100644
--- a/frontend/src/components/SensitiveData/useSemanticType.ts
+++ b/frontend/src/components/SensitiveData/useSemanticType.ts
@@ -1,12 +1,13 @@
import { computed, unref, type MaybeRef } from "vue";
import { useSettingV1Store } from "@/store";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
export const useSemanticType = (semanticTypeId: MaybeRef<string>) => {
const settingV1Store = useSettingV1Store();
const semanticTypeList = computed(() => {
return (
- settingV1Store.getSettingByName("bb.workspace.semantic-types")?.value
+ settingV1Store.getSettingByName(Setting_SettingName.SEMANTIC_TYPES)?.value
?.semanticTypeSettingValue?.types ?? []
);
});
diff --git a/frontend/src/components/User/Settings/AADSyncDrawer.vue b/frontend/src/components/User/Settings/AADSyncDrawer.vue
index 6da85dd6b0..d46d9c50fc 100644
--- a/frontend/src/components/User/Settings/AADSyncDrawer.vue
+++ b/frontend/src/components/User/Settings/AADSyncDrawer.vue
@@ -121,6 +121,7 @@ import LearnMoreLink from "@/components/LearnMoreLink.vue";
import { Drawer, DrawerContent } from "@/components/v2";
import { SETTING_ROUTE_WORKSPACE_GENERAL } from "@/router/dashboard/workspaceSetting";
import { pushNotification, useSettingV1Store } from "@/store";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { hasWorkspacePermissionV2 } from "@/utils";
defineProps<{
@@ -144,7 +145,7 @@ const hasPermission = computed(() =>
const workspaceId = computed(() => {
return (
- settingV1Store.getSettingByName("bb.workspace.id")?.value?.stringValue ?? ""
+ settingV1Store.getSettingByName(Setting_SettingName.WORKSPACE_ID)?.value?.stringValue ?? ""
);
});
@@ -161,7 +162,7 @@ const scimUrl = computed(() => {
const scimToken = computed(() => {
return (
- settingV1Store.getSettingByName("bb.workspace.scim")?.value?.scimSetting
+ settingV1Store.getSettingByName(Setting_SettingName.SCIM)?.value?.scimSetting
?.token ?? ""
);
});
@@ -206,7 +207,7 @@ const resetToken = () => {
onPositiveClick: () => {
settingV1Store
.upsertSetting({
- name: "bb.workspace.scim",
+ name: Setting_SettingName.SCIM,
value: {
scimSetting: {
token: "",
diff --git a/frontend/src/components/misc/Watermark.vue b/frontend/src/components/misc/Watermark.vue
index ca1bdc607a..e07e742cf1 100644
--- a/frontend/src/components/misc/Watermark.vue
+++ b/frontend/src/components/misc/Watermark.vue
@@ -38,6 +38,7 @@ import { computed } from "vue";
import { featureToRef, useCurrentUserV1, extractUserId, useActuatorV1Store } from "@/store";
import { useSettingV1Store } from "@/store/modules/v1/setting";
import { UNKNOWN_USER_NAME } from "@/types";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
const GAP = 320;
const SIZE = 16;
@@ -46,7 +47,7 @@ const PADDING = 6;
const currentUserV1 = useCurrentUserV1();
const version = computed(() => useActuatorV1Store().version + "-" + useActuatorV1Store().gitCommitBE.substring(0, 7));
const setting = computed(() =>
- useSettingV1Store().getSettingByName("bb.workspace.watermark")
+ useSettingV1Store().getSettingByName(Setting_SettingName.WATERMARK)
);
const hasWatermarkFeature = featureToRef("bb.feature.watermark");
diff --git a/frontend/src/customAppProfile.ts b/frontend/src/customAppProfile.ts
index 905981577c..f8c5493582 100644
--- a/frontend/src/customAppProfile.ts
+++ b/frontend/src/customAppProfile.ts
@@ -2,10 +2,10 @@ import { computed } from "vue";
import i18n from "./plugins/i18n";
import { useActuatorV1Store, useSettingByName } from "./store";
import { defaultAppProfile } from "./types";
-import { DatabaseChangeMode } from "./types/proto/v1/setting_service";
+import { DatabaseChangeMode, Setting_SettingName } from "./types/proto/v1/setting_service";
export const overrideAppProfile = () => {
- const setting = useSettingByName("bb.workspace.profile");
+ const setting = useSettingByName(Setting_SettingName.WORKSPACE_PROFILE);
const databaseChangeMode = computed(() => {
const mode =
setting.value?.value?.workspaceProfileSettingValue?.databaseChangeMode;
diff --git a/frontend/src/plugins/ai/components/ProvideAIContext.vue b/frontend/src/plugins/ai/components/ProvideAIContext.vue
index 1708926462..d6513e38dd 100644
--- a/frontend/src/plugins/ai/components/ProvideAIContext.vue
+++ b/frontend/src/plugins/ai/components/ProvideAIContext.vue
@@ -10,7 +10,7 @@ import {
useSettingV1Store,
useSQLEditorTabStore,
} from "@/store";
-import { AISetting } from "@/types/proto/v1/setting_service";
+import { AISetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { wrapRefAsPromise } from "@/utils";
import Emittery from "emittery";
import { storeToRefs } from "pinia";
@@ -28,7 +28,7 @@ const state = reactive<LocalState>({
});
const settingV1Store = useSettingV1Store();
-const aiSetting = computed(() => settingV1Store.getSettingByName("bb.ai")?.value?.aiSetting ?? AISetting.create());
+const aiSetting = computed(() => settingV1Store.getSettingByName(Setting_SettingName.AI)?.value?.aiSetting ?? AISetting.create());
const { instance, database } = useConnectionOfCurrentSQLEditorTab();
const databaseMetadata = useMetadata(
diff --git a/frontend/src/store/modules/auth.ts b/frontend/src/store/modules/auth.ts
index 9648ea4da1..0f19b412ac 100644
--- a/frontend/src/store/modules/auth.ts
+++ b/frontend/src/store/modules/auth.ts
@@ -21,7 +21,7 @@ import {
import { UNKNOWN_USER_NAME, unknownUser } from "@/types";
import type { LoginRequest } from "@/types/proto/v1/auth_service";
import { LoginResponse } from "@/types/proto/v1/auth_service";
-import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
+import { DatabaseChangeMode, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { User, UserType } from "@/types/proto/v1/user_service";
export const useAuthStore = defineStore("auth_v1", () => {
@@ -86,7 +86,7 @@ export const useAuthStore = defineStore("auth_v1", () => {
setRequireResetPassword(data.requireResetPassword);
await useSettingV1Store().getOrFetchSettingByName(
- "bb.workspace.profile",
+ Setting_SettingName.WORKSPACE_PROFILE,
true // silent
);
diff --git a/frontend/src/store/modules/v1/environment.ts b/frontend/src/store/modules/v1/environment.ts
index c9c69324a1..b76dec8879 100644
--- a/frontend/src/store/modules/v1/environment.ts
+++ b/frontend/src/store/modules/v1/environment.ts
@@ -4,6 +4,7 @@ import { unknownEnvironment } from "@/types";
import {
EnvironmentSetting,
EnvironmentSetting_Environment,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
import type { Environment } from "@/types/v1/environment";
import { orderBy } from "lodash-es";
@@ -62,7 +63,7 @@ const getEnvironmentSetting = async (
): Promise<Environment[]> => {
const setting = await settingServiceClient.getSetting(
{
- name: "settings/bb.workspace.environment",
+ name: `settings/${Setting_SettingName.ENVIRONMENT}`,
},
{ silent }
);
@@ -76,7 +77,7 @@ const updateEnvironmentSetting = async (
): Promise<Environment[]> => {
const setting = await settingServiceClient.updateSetting({
setting: {
- name: "settings/bb.workspace.environment",
+ name: `settings/${Setting_SettingName.ENVIRONMENT}`,
value: {
environmentSetting: environment,
},
diff --git a/frontend/src/store/modules/v1/setting.ts b/frontend/src/store/modules/v1/setting.ts
index 48a1a4cbcd..53731610f7 100644
--- a/frontend/src/store/modules/v1/setting.ts
+++ b/frontend/src/store/modules/v1/setting.ts
@@ -8,8 +8,7 @@ import type {
WorkspaceProfileSetting,
DataClassificationSetting_DataClassificationConfig,
} from "@/types/proto/v1/setting_service";
-import { PasswordRestrictionSetting } from "@/types/proto/v1/setting_service";
-import type { SettingName } from "@/types/setting";
+import { PasswordRestrictionSetting, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { useActuatorV1Store } from "./actuator";
interface SettingState {
@@ -23,25 +22,25 @@ export const useSettingV1Store = defineStore("setting_v1", {
getters: {
workspaceProfileSetting(state): WorkspaceProfileSetting | undefined {
const setting = state.settingMapByName.get(
- `${settingNamePrefix}bb.workspace.profile`
+ `${settingNamePrefix}${Setting_SettingName.WORKSPACE_PROFILE}`
);
return setting?.value?.workspaceProfileSettingValue;
},
brandingLogo(state): string | undefined {
const setting = state.settingMapByName.get(
- `${settingNamePrefix}bb.branding.logo`
+ `${settingNamePrefix}${Setting_SettingName.BRANDING_LOGO}`
);
return setting?.value?.stringValue;
},
classification(): DataClassificationSetting_DataClassificationConfig[] {
const setting = this.settingMapByName.get(
- `${settingNamePrefix}bb.workspace.data-classification`
+ `${settingNamePrefix}${Setting_SettingName.DATA_CLASSIFICATION}`
);
return setting?.value?.dataClassificationSettingValue?.configs ?? [];
},
passwordRestriction(): PasswordRestrictionSetting {
const setting = this.settingMapByName.get(
- `${settingNamePrefix}bb.workspace.password-restriction`
+ `${settingNamePrefix}${Setting_SettingName.PASSWORD_RESTRICTION}`
);
return (
setting?.value?.passwordRestrictionSetting ??
@@ -57,13 +56,13 @@ export const useSettingV1Store = defineStore("setting_v1", {
classificationId: string
): DataClassificationSetting_DataClassificationConfig | undefined {
const setting = this.settingMapByName.get(
- `${settingNamePrefix}bb.workspace.data-classification`
+ `${settingNamePrefix}${Setting_SettingName.DATA_CLASSIFICATION}`
);
return setting?.value?.dataClassificationSettingValue?.configs.find(
(config) => config.id === classificationId
);
},
- async fetchSettingByName(name: SettingName, silent = false) {
+ async fetchSettingByName(name: Setting_SettingName, silent = false) {
try {
const setting = await settingServiceClient.getSetting(
{
@@ -77,14 +76,14 @@ export const useSettingV1Store = defineStore("setting_v1", {
return;
}
},
- getOrFetchSettingByName(name: SettingName, silent = false) {
+ getOrFetchSettingByName(name: Setting_SettingName, silent = false) {
const setting = this.getSettingByName(name);
if (setting) {
return setting;
}
return this.fetchSettingByName(name, silent);
},
- getSettingByName(name: SettingName) {
+ getSettingByName(name: Setting_SettingName) {
return this.settingMapByName.get(`${settingNamePrefix}${name}`);
},
async fetchSettingList() {
@@ -99,7 +98,7 @@ export const useSettingV1Store = defineStore("setting_v1", {
validateOnly = false,
updateMask,
}: {
- name: SettingName;
+ name: Setting_SettingName;
value: SettingValue;
validateOnly?: boolean;
updateMask?: string[] | undefined;
@@ -131,7 +130,7 @@ export const useSettingV1Store = defineStore("setting_v1", {
...payload,
};
await this.upsertSetting({
- name: "bb.workspace.profile",
+ name: Setting_SettingName.WORKSPACE_PROFILE,
value: {
workspaceProfileSettingValue: profileSetting,
},
@@ -143,7 +142,7 @@ export const useSettingV1Store = defineStore("setting_v1", {
},
});
-export const useSettingByName = (name: SettingName) => {
+export const useSettingByName = (name: Setting_SettingName) => {
const store = useSettingV1Store();
const setting = computed(() => store.getSettingByName(name));
store.getOrFetchSettingByName(name, /* silent */ true);
diff --git a/frontend/src/store/modules/v1/subscription.ts b/frontend/src/store/modules/v1/subscription.ts
index 8b9341f9e8..f38519b030 100644
--- a/frontend/src/store/modules/v1/subscription.ts
+++ b/frontend/src/store/modules/v1/subscription.ts
@@ -1,7 +1,3 @@
-import dayjs from "dayjs";
-import { defineStore } from "pinia";
-import type { Ref } from "vue";
-import { computed } from "vue";
import { subscriptionServiceClient } from "@/grpcweb";
import type { FeatureType } from "@/types";
import { PLANS, getDateForPbTimestamp, instanceLimitFeature } from "@/types";
@@ -15,7 +11,10 @@ import {
planTypeFromJSON,
planTypeToNumber,
} from "@/types/proto/v1/subscription_service";
-import { useSettingV1Store } from "./setting";
+import dayjs from "dayjs";
+import { defineStore } from "pinia";
+import type { Ref } from "vue";
+import { computed } from "vue";
// The threshold of days before the license expiration date to show the warning.
// Default is 7 days.
@@ -146,16 +145,12 @@ export const useSubscriptionV1Store = defineStore("subscription_v1", {
return daysBeforeExpire / total < 0.5;
},
existTrialLicense(): boolean {
- const settingStore = useSettingV1Store();
- return !!settingStore.getSettingByName("bb.enterprise.trial");
+ return false;
},
canTrial(state): boolean {
if (!this.isSelfHostLicense) {
return false;
}
- if (this.existTrialLicense) {
- return false;
- }
if (!state.subscription || this.isFreePlan) {
return true;
}
diff --git a/frontend/src/store/modules/workspaceApprovalSetting.ts b/frontend/src/store/modules/workspaceApprovalSetting.ts
index 0823e70ce3..1f189d8bf4 100644
--- a/frontend/src/store/modules/workspaceApprovalSetting.ts
+++ b/frontend/src/store/modules/workspaceApprovalSetting.ts
@@ -5,6 +5,7 @@ import { settingServiceClient } from "@/grpcweb";
import { type LocalApprovalConfig, type LocalApprovalRule } from "@/types";
import type { Risk_Source } from "@/types/proto/v1/risk_service";
import type { Setting } from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import {
resolveLocalApprovalConfig,
buildWorkspaceApprovalSetting,
@@ -12,7 +13,7 @@ import {
} from "@/utils";
import { useGracefulRequest } from "./utils";
-const SETTING_NAME = "settings/bb.workspace.approval";
+const SETTING_NAME = `settings/${Setting_SettingName.WORKSPACE_APPROVAL}`;
export const useWorkspaceApprovalSettingStore = defineStore(
"workspaceApprovalSetting",
diff --git a/frontend/src/store/modules/workspaceMailDeliverySetting.ts b/frontend/src/store/modules/workspaceMailDeliverySetting.ts
index 58b84c9f20..55925027af 100644
--- a/frontend/src/store/modules/workspaceMailDeliverySetting.ts
+++ b/frontend/src/store/modules/workspaceMailDeliverySetting.ts
@@ -5,8 +5,9 @@ import type {
SMTPMailDeliverySettingValue,
Setting,
} from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
-const SETTING_NAME = "settings/bb.workspace.mail-delivery";
+const SETTING_NAME = `settings/${Setting_SettingName.WORKSPACE_MAIL_DELIVERY}`;
export const useWorkspaceMailDeliverySettingStore = defineStore(
"workspaceMailDeliverySetting",
diff --git a/frontend/src/types/proto/v1/setting_service.ts b/frontend/src/types/proto/v1/setting_service.ts
index 17f4943940..0e124dfca7 100644
--- a/frontend/src/types/proto/v1/setting_service.ts
+++ b/frontend/src/types/proto/v1/setting_service.ts
@@ -146,6 +146,195 @@ export interface Setting {
value: Value | undefined;
}
+export enum Setting_SettingName {
+ SETTING_NAME_UNSPECIFIED = "SETTING_NAME_UNSPECIFIED",
+ AUTH_SECRET = "AUTH_SECRET",
+ BRANDING_LOGO = "BRANDING_LOGO",
+ WORKSPACE_ID = "WORKSPACE_ID",
+ WORKSPACE_PROFILE = "WORKSPACE_PROFILE",
+ WORKSPACE_APPROVAL = "WORKSPACE_APPROVAL",
+ WORKSPACE_EXTERNAL_APPROVAL = "WORKSPACE_EXTERNAL_APPROVAL",
+ ENTERPRISE_LICENSE = "ENTERPRISE_LICENSE",
+ APP_IM = "APP_IM",
+ WATERMARK = "WATERMARK",
+ AI = "AI",
+ PLUGIN_AGENT = "PLUGIN_AGENT",
+ WORKSPACE_MAIL_DELIVERY = "WORKSPACE_MAIL_DELIVERY",
+ SCHEMA_TEMPLATE = "SCHEMA_TEMPLATE",
+ DATA_CLASSIFICATION = "DATA_CLASSIFICATION",
+ SEMANTIC_TYPES = "SEMANTIC_TYPES",
+ SQL_RESULT_SIZE_LIMIT = "SQL_RESULT_SIZE_LIMIT",
+ SCIM = "SCIM",
+ PASSWORD_RESTRICTION = "PASSWORD_RESTRICTION",
+ ENVIRONMENT = "ENVIRONMENT",
+ UNRECOGNIZED = "UNRECOGNIZED",
+}
+
+export function setting_SettingNameFromJSON(object: any): Setting_SettingName {
+ switch (object) {
+ case 0:
+ case "SETTING_NAME_UNSPECIFIED":
+ return Setting_SettingName.SETTING_NAME_UNSPECIFIED;
+ case 1:
+ case "AUTH_SECRET":
+ return Setting_SettingName.AUTH_SECRET;
+ case 2:
+ case "BRANDING_LOGO":
+ return Setting_SettingName.BRANDING_LOGO;
+ case 3:
+ case "WORKSPACE_ID":
+ return Setting_SettingName.WORKSPACE_ID;
+ case 4:
+ case "WORKSPACE_PROFILE":
+ return Setting_SettingName.WORKSPACE_PROFILE;
+ case 5:
+ case "WORKSPACE_APPROVAL":
+ return Setting_SettingName.WORKSPACE_APPROVAL;
+ case 6:
+ case "WORKSPACE_EXTERNAL_APPROVAL":
+ return Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL;
+ case 7:
+ case "ENTERPRISE_LICENSE":
+ return Setting_SettingName.ENTERPRISE_LICENSE;
+ case 8:
+ case "APP_IM":
+ return Setting_SettingName.APP_IM;
+ case 9:
+ case "WATERMARK":
+ return Setting_SettingName.WATERMARK;
+ case 10:
+ case "AI":
+ return Setting_SettingName.AI;
+ case 11:
+ case "PLUGIN_AGENT":
+ return Setting_SettingName.PLUGIN_AGENT;
+ case 12:
+ case "WORKSPACE_MAIL_DELIVERY":
+ return Setting_SettingName.WORKSPACE_MAIL_DELIVERY;
+ case 13:
+ case "SCHEMA_TEMPLATE":
+ return Setting_SettingName.SCHEMA_TEMPLATE;
+ case 14:
+ case "DATA_CLASSIFICATION":
+ return Setting_SettingName.DATA_CLASSIFICATION;
+ case 15:
+ case "SEMANTIC_TYPES":
+ return Setting_SettingName.SEMANTIC_TYPES;
+ case 16:
+ case "SQL_RESULT_SIZE_LIMIT":
+ return Setting_SettingName.SQL_RESULT_SIZE_LIMIT;
+ case 17:
+ case "SCIM":
+ return Setting_SettingName.SCIM;
+ case 18:
+ case "PASSWORD_RESTRICTION":
+ return Setting_SettingName.PASSWORD_RESTRICTION;
+ case 19:
+ case "ENVIRONMENT":
+ return Setting_SettingName.ENVIRONMENT;
+ case -1:
+ case "UNRECOGNIZED":
+ default:
+ return Setting_SettingName.UNRECOGNIZED;
+ }
+}
+
+export function setting_SettingNameToJSON(object: Setting_SettingName): string {
+ switch (object) {
+ case Setting_SettingName.SETTING_NAME_UNSPECIFIED:
+ return "SETTING_NAME_UNSPECIFIED";
+ case Setting_SettingName.AUTH_SECRET:
+ return "AUTH_SECRET";
+ case Setting_SettingName.BRANDING_LOGO:
+ return "BRANDING_LOGO";
+ case Setting_SettingName.WORKSPACE_ID:
+ return "WORKSPACE_ID";
+ case Setting_SettingName.WORKSPACE_PROFILE:
+ return "WORKSPACE_PROFILE";
+ case Setting_SettingName.WORKSPACE_APPROVAL:
+ return "WORKSPACE_APPROVAL";
+ case Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL:
+ return "WORKSPACE_EXTERNAL_APPROVAL";
+ case Setting_SettingName.ENTERPRISE_LICENSE:
+ return "ENTERPRISE_LICENSE";
+ case Setting_SettingName.APP_IM:
+ return "APP_IM";
+ case Setting_SettingName.WATERMARK:
+ return "WATERMARK";
+ case Setting_SettingName.AI:
+ return "AI";
+ case Setting_SettingName.PLUGIN_AGENT:
+ return "PLUGIN_AGENT";
+ case Setting_SettingName.WORKSPACE_MAIL_DELIVERY:
+ return "WORKSPACE_MAIL_DELIVERY";
+ case Setting_SettingName.SCHEMA_TEMPLATE:
+ return "SCHEMA_TEMPLATE";
+ case Setting_SettingName.DATA_CLASSIFICATION:
+ return "DATA_CLASSIFICATION";
+ case Setting_SettingName.SEMANTIC_TYPES:
+ return "SEMANTIC_TYPES";
+ case Setting_SettingName.SQL_RESULT_SIZE_LIMIT:
+ return "SQL_RESULT_SIZE_LIMIT";
+ case Setting_SettingName.SCIM:
+ return "SCIM";
+ case Setting_SettingName.PASSWORD_RESTRICTION:
+ return "PASSWORD_RESTRICTION";
+ case Setting_SettingName.ENVIRONMENT:
+ return "ENVIRONMENT";
+ case Setting_SettingName.UNRECOGNIZED:
+ default:
+ return "UNRECOGNIZED";
+ }
+}
+
+export function setting_SettingNameToNumber(object: Setting_SettingName): number {
+ switch (object) {
+ case Setting_SettingName.SETTING_NAME_UNSPECIFIED:
+ return 0;
+ case Setting_SettingName.AUTH_SECRET:
+ return 1;
+ case Setting_SettingName.BRANDING_LOGO:
+ return 2;
+ case Setting_SettingName.WORKSPACE_ID:
+ return 3;
+ case Setting_SettingName.WORKSPACE_PROFILE:
+ return 4;
+ case Setting_SettingName.WORKSPACE_APPROVAL:
+ return 5;
+ case Setting_SettingName.WORKSPACE_EXTERNAL_APPROVAL:
+ return 6;
+ case Setting_SettingName.ENTERPRISE_LICENSE:
+ return 7;
+ case Setting_SettingName.APP_IM:
+ return 8;
+ case Setting_SettingName.WATERMARK:
+ return 9;
+ case Setting_SettingName.AI:
+ return 10;
+ case Setting_SettingName.PLUGIN_AGENT:
+ return 11;
+ case Setting_SettingName.WORKSPACE_MAIL_DELIVERY:
+ return 12;
+ case Setting_SettingName.SCHEMA_TEMPLATE:
+ return 13;
+ case Setting_SettingName.DATA_CLASSIFICATION:
+ return 14;
+ case Setting_SettingName.SEMANTIC_TYPES:
+ return 15;
+ case Setting_SettingName.SQL_RESULT_SIZE_LIMIT:
+ return 16;
+ case Setting_SettingName.SCIM:
+ return 17;
+ case Setting_SettingName.PASSWORD_RESTRICTION:
+ return 18;
+ case Setting_SettingName.ENVIRONMENT:
+ return 19;
+ case Setting_SettingName.UNRECOGNIZED:
+ default:
+ return -1;
+ }
+}
+
/** The data in setting value. */
export interface Value {
/** Defines this value as being a string value. */
diff --git a/frontend/src/types/setting.ts b/frontend/src/types/setting.ts
index 21e77b8e3c..1d89781e0c 100644
--- a/frontend/src/types/setting.ts
+++ b/frontend/src/types/setting.ts
@@ -1,18 +1 @@
-export type SettingName =
- | "bb.branding.logo"
- | "bb.workspace.id"
- | "bb.app.im"
- | "bb.workspace.watermark"
- | "bb.workspace.profile"
- | "bb.workspace.approval"
- | "bb.workspace.approval.external"
- | "bb.ai"
- | "bb.enterprise.trial"
- | "bb.workspace.schema-template"
- | "bb.workspace.data-classification"
- | "bb.workspace.semantic-types"
- | "bb.workspace.maximum-sql-result-size"
- | "bb.workspace.scim"
- | "bb.workspace.password-restriction";
-
export const defaultTokenDurationInHours = 7 * 24;
diff --git a/frontend/src/views/SchemaTemplate/ColumnTypes.vue b/frontend/src/views/SchemaTemplate/ColumnTypes.vue
index c8218a33fb..35130c07f8 100644
--- a/frontend/src/views/SchemaTemplate/ColumnTypes.vue
+++ b/frontend/src/views/SchemaTemplate/ColumnTypes.vue
@@ -126,6 +126,7 @@ import type { SchemaTemplateSetting_FieldTemplate } from "@/types/proto/v1/setti
import {
SchemaTemplateSetting,
SchemaTemplateSetting_ColumnType,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
import { getDataTypeSuggestionList } from "@/utils";
import ColumnTypesUpdateFailedModal from "./ColumnTypesUpdateFailedModal.vue";
@@ -153,7 +154,7 @@ const allowToUpdateColumnTypeTemplateForMySQL = computed(() => {
if (props.readonly) {
return false;
}
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
const columnTypes =
setting?.value?.schemaTemplateSettingValue?.columnTypes || [];
const originTemplate = SchemaTemplateSetting_ColumnType.fromPartial({
@@ -183,7 +184,7 @@ const allowToUpdateColumnTypeTemplateForPostgreSQL = computed(() => {
if (props.readonly) {
return false;
}
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
const columnTypes =
setting?.value?.schemaTemplateSettingValue?.columnTypes || [];
const originTemplate = SchemaTemplateSetting_ColumnType.fromPartial({
@@ -211,7 +212,7 @@ const allowToUpdateColumnTypeTemplateForPostgreSQL = computed(() => {
const getOrFetchSchemaTemplate = async () => {
const setting = await settingStore.getOrFetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const columnTypes =
setting?.value?.schemaTemplateSettingValue?.columnTypes || [];
@@ -415,7 +416,7 @@ const upsertSchemaTemplateSetting = async (
columnType: SchemaTemplateSetting_ColumnType
) => {
const setting = await settingStore.getOrFetchSettingByName(
- "bb.workspace.schema-template"
+ Setting_SettingName.SCHEMA_TEMPLATE
);
const schemaTemplateSettingValue = SchemaTemplateSetting.fromPartial({
...setting?.value?.schemaTemplateSettingValue,
@@ -428,7 +429,7 @@ const upsertSchemaTemplateSetting = async (
),
});
await settingStore.upsertSetting({
- name: "bb.workspace.schema-template",
+ name: Setting_SettingName.SCHEMA_TEMPLATE,
value: {
schemaTemplateSettingValue,
},
diff --git a/frontend/src/views/SchemaTemplate/FieldTemplates.vue b/frontend/src/views/SchemaTemplate/FieldTemplates.vue
index 38430c2465..1330befe9d 100644
--- a/frontend/src/views/SchemaTemplate/FieldTemplates.vue
+++ b/frontend/src/views/SchemaTemplate/FieldTemplates.vue
@@ -84,6 +84,7 @@ import {
ColumnCatalog,
} from "@/types/proto/v1/database_catalog_service";
import type { SchemaTemplateSetting_FieldTemplate } from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
interface LocalState {
template: SchemaTemplateSetting_FieldTemplate;
@@ -152,7 +153,7 @@ const toggleEngineCheck = (engine: Engine) => {
const settingStore = useSettingV1Store();
const schemaTemplateList = computed(() => {
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
return setting?.value?.schemaTemplateSettingValue?.fieldTemplates ?? [];
});
diff --git a/frontend/src/views/SchemaTemplate/TableTemplates.vue b/frontend/src/views/SchemaTemplate/TableTemplates.vue
index 4704d55148..06006ecf7d 100644
--- a/frontend/src/views/SchemaTemplate/TableTemplates.vue
+++ b/frontend/src/views/SchemaTemplate/TableTemplates.vue
@@ -80,6 +80,7 @@ import { Engine } from "@/types/proto/v1/common";
import { TableMetadata } from "@/types/proto/v1/database_service";
import { TableCatalog } from "@/types/proto/v1/database_catalog_service";
import type { SchemaTemplateSetting_TableTemplate } from "@/types/proto/v1/setting_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
interface LocalState {
template: SchemaTemplateSetting_TableTemplate;
@@ -144,7 +145,7 @@ const toggleEngineCheck = (engine: Engine) => {
const settingStore = useSettingV1Store();
const schemaTemplateList = computed(() => {
- const setting = settingStore.getSettingByName("bb.workspace.schema-template");
+ const setting = settingStore.getSettingByName(Setting_SettingName.SCHEMA_TEMPLATE);
return setting?.value?.schemaTemplateSettingValue?.tableTemplates ?? [];
});
diff --git a/frontend/src/views/SettingWorkspaceIM.vue b/frontend/src/views/SettingWorkspaceIM.vue
index 6aee2880cc..0110df6f97 100644
--- a/frontend/src/views/SettingWorkspaceIM.vue
+++ b/frontend/src/views/SettingWorkspaceIM.vue
@@ -64,6 +64,7 @@ import {
AppIMSetting_Lark,
AppIMSetting_Wecom,
AppIMSetting_DingTalk,
+ Setting_SettingName,
} from "@/types/proto/v1/setting_service";
interface LocalState {
@@ -87,7 +88,7 @@ const settingStore = useSettingV1Store();
const imSetting = computed(
() =>
- settingStore.getSettingByName("bb.app.im")?.value?.appImSettingValue ??
+ settingStore.getSettingByName(Setting_SettingName.APP_IM)?.value?.appImSettingValue ??
AppIMSetting.fromPartial({})
);
@@ -418,7 +419,7 @@ const onSave = async () => {
try {
const setting = await settingStore.upsertSetting({
- name: "bb.app.im",
+ name: Setting_SettingName.APP_IM,
value: {
appImSettingValue: data,
},
diff --git a/frontend/src/views/SettingWorkspaceSubscription.vue b/frontend/src/views/SettingWorkspaceSubscription.vue
index 7e2cdb3dc7..4384a53cc3 100644
--- a/frontend/src/views/SettingWorkspaceSubscription.vue
+++ b/frontend/src/views/SettingWorkspaceSubscription.vue
@@ -174,6 +174,7 @@ import {
} from "@/store";
import { ENTERPRISE_INQUIRE_LINK } from "@/types";
import { PlanType } from "@/types/proto/v1/subscription_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
import { hasWorkspacePermissionV2 } from "@/utils";
interface LocalState {
@@ -219,7 +220,7 @@ const workspaceIdField = ref<HTMLInputElement | null>(null);
const workspaceId = computed(() => {
return (
- settingV1Store.getSettingByName("bb.workspace.id")?.value?.stringValue ?? ""
+ settingV1Store.getSettingByName(Setting_SettingName.WORKSPACE_ID)?.value?.stringValue ?? ""
);
});
diff --git a/frontend/src/views/Setup/AdminSetup.vue b/frontend/src/views/Setup/AdminSetup.vue
index 4efd430d57..d22c35479c 100644
--- a/frontend/src/views/Setup/AdminSetup.vue
+++ b/frontend/src/views/Setup/AdminSetup.vue
@@ -114,7 +114,7 @@ import {
import { projectNamePrefix } from "@/store/modules/v1/common";
import { emptyProject } from "@/types";
import type { Project } from "@/types/proto/v1/project_service";
-import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
+import { DatabaseChangeMode, Setting_SettingName } from "@/types/proto/v1/setting_service";
import WorkspaceMode from "./WorkspaceMode.vue";
interface LocalState {
@@ -226,7 +226,7 @@ const tryFinishSetup = async () => {
onMounted(async () => {
if (!actuatorV1Store.onboardingState.isOnboarding) {
const profileSetting = await settingStore.fetchSettingByName(
- "bb.workspace.profile"
+ Setting_SettingName.WORKSPACE_PROFILE
);
return onCancel(
getHomePageByMode(
diff --git a/frontend/src/views/auth/PasswordReset.vue b/frontend/src/views/auth/PasswordReset.vue
index 8182462f5c..61656c611f 100644
--- a/frontend/src/views/auth/PasswordReset.vue
+++ b/frontend/src/views/auth/PasswordReset.vue
@@ -47,6 +47,7 @@ import {
useCurrentUserV1,
} from "@/store";
import { UpdateUserRequest, User } from "@/types/proto/v1/user_service";
+import { Setting_SettingName } from "@/types/proto/v1/setting_service";
interface LocalState {
password: string;
@@ -81,7 +82,7 @@ onMounted(async () => {
return;
}
await settingV1Store.getOrFetchSettingByName(
- "bb.workspace.password-restriction"
+ Setting_SettingName.PASSWORD_RESTRICTION
);
});
diff --git a/frontend/src/views/sql-editor/EditorCommon/OpenAIButton/OpenAIButton.vue b/frontend/src/views/sql-editor/EditorCommon/OpenAIButton/OpenAIButton.vue
index cd833662b9..31936d91c1 100644
--- a/frontend/src/views/sql-editor/EditorCommon/OpenAIButton/OpenAIButton.vue
+++ b/frontend/src/views/sql-editor/EditorCommon/OpenAIButton/OpenAIButton.vue
@@ -65,7 +65,7 @@ import {
useSettingV1Store,
useSQLEditorTabStore,
} from "@/store";
-import { DatabaseChangeMode } from "@/types/proto/v1/setting_service";
+import { DatabaseChangeMode, Setting_SettingName } from "@/types/proto/v1/setting_service";
import { hasWorkspacePermissionV2, nextAnimationFrame } from "@/utils";
import { useSQLEditorContext } from "../../context";
import Button from "./Button.vue";
@@ -87,7 +87,7 @@ const databaseChangeMode = useAppFeature("bb.feature.database-change-mode");
const openAIEnabled = computed(
() =>
- settingV1Store.getSettingByName("bb.ai")?.value?.aiSetting?.enabled ?? false
+ settingV1Store.getSettingByName(Setting_SettingName.AI)?.value?.aiSetting?.enabled ?? false
);
const { showAIPanel } = useSQLEditorContext();
diff --git a/proto/gen/grpc-doc/store/README.md b/proto/gen/grpc-doc/store/README.md
index 4c966b9f2d..9fac5c7a9e 100644
--- a/proto/gen/grpc-doc/store/README.md
+++ b/proto/gen/grpc-doc/store/README.md
@@ -286,6 +286,7 @@
- [DatabaseChangeMode](#bytebase-store-DatabaseChangeMode)
- [SMTPMailDeliverySetting.Authentication](#bytebase-store-SMTPMailDeliverySetting-Authentication)
- [SMTPMailDeliverySetting.Encryption](#bytebase-store-SMTPMailDeliverySetting-Encryption)
+ - [SettingName](#bytebase-store-SettingName)
- [store/sheet.proto](#store_sheet-proto)
- [SheetCommand](#bytebase-store-SheetCommand)
@@ -4544,6 +4545,36 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
| ENCRYPTION_SSL_TLS | 3 | |
+
+<a name="bytebase-store-SettingName"></a>
+
+### SettingName
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| SETTING_NAME_UNSPECIFIED | 0 | |
+| AUTH_SECRET | 1 | |
+| BRANDING_LOGO | 2 | |
+| WORKSPACE_ID | 3 | |
+| WORKSPACE_PROFILE | 4 | |
+| WORKSPACE_APPROVAL | 5 | |
+| WORKSPACE_EXTERNAL_APPROVAL | 6 | |
+| ENTERPRISE_LICENSE | 7 | |
+| APP_IM | 8 | |
+| WATERMARK | 9 | |
+| AI | 10 | |
+| PLUGIN_AGENT | 11 | |
+| WORKSPACE_MAIL_DELIVERY | 12 | |
+| SCHEMA_TEMPLATE | 13 | |
+| DATA_CLASSIFICATION | 14 | |
+| SEMANTIC_TYPES | 15 | |
+| SQL_RESULT_SIZE_LIMIT | 16 | |
+| SCIM | 17 | |
+| PASSWORD_RESTRICTION | 18 | |
+| ENVIRONMENT | 19 | |
+
+
diff --git a/proto/gen/grpc-doc/store/index.html b/proto/gen/grpc-doc/store/index.html
index 0e64acb2a9..72cfbb0c8c 100644
--- a/proto/gen/grpc-doc/store/index.html
+++ b/proto/gen/grpc-doc/store/index.html
@@ -1325,6 +1325,10 @@
<a href="#bytebase.store.SMTPMailDeliverySetting.Encryption"><span class="badge">E</span>SMTPMailDeliverySetting.Encryption</a>
</li>
+ <li>
+ <a href="#bytebase.store.SettingName"><span class="badge">E</span>SettingName</a>
+ </li>
+
</ul>
@@ -11799,6 +11803,137 @@ Default to this mode.</p></td>
</tbody>
</table>
+ <h3 id="bytebase.store.SettingName">SettingName</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SETTING_NAME_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>AUTH_SECRET</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>BRANDING_LOGO</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_ID</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_PROFILE</td>
+ <td>4</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_APPROVAL</td>
+ <td>5</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_EXTERNAL_APPROVAL</td>
+ <td>6</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENTERPRISE_LICENSE</td>
+ <td>7</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>APP_IM</td>
+ <td>8</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WATERMARK</td>
+ <td>9</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>AI</td>
+ <td>10</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PLUGIN_AGENT</td>
+ <td>11</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_MAIL_DELIVERY</td>
+ <td>12</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SCHEMA_TEMPLATE</td>
+ <td>13</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>DATA_CLASSIFICATION</td>
+ <td>14</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SEMANTIC_TYPES</td>
+ <td>15</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SQL_RESULT_SIZE_LIMIT</td>
+ <td>16</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SCIM</td>
+ <td>17</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PASSWORD_RESTRICTION</td>
+ <td>18</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT</td>
+ <td>19</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
diff --git a/proto/gen/grpc-doc/v1/README.md b/proto/gen/grpc-doc/v1/README.md
index 694ac9bc7e..4b987d6d2b 100644
--- a/proto/gen/grpc-doc/v1/README.md
+++ b/proto/gen/grpc-doc/v1/README.md
@@ -271,6 +271,7 @@
- [DatabaseChangeMode](#bytebase-v1-DatabaseChangeMode)
- [SMTPMailDeliverySettingValue.Authentication](#bytebase-v1-SMTPMailDeliverySettingValue-Authentication)
- [SMTPMailDeliverySettingValue.Encryption](#bytebase-v1-SMTPMailDeliverySettingValue-Encryption)
+ - [Setting.SettingName](#bytebase-v1-Setting-SettingName)
- [SettingService](#bytebase-v1-SettingService)
@@ -4948,6 +4949,36 @@ We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
| ENCRYPTION_SSL_TLS | 3 | |
+
+<a name="bytebase-v1-Setting-SettingName"></a>
+
+### Setting.SettingName
+
+
+| Name | Number | Description |
+| ---- | ------ | ----------- |
+| SETTING_NAME_UNSPECIFIED | 0 | |
+| AUTH_SECRET | 1 | |
+| BRANDING_LOGO | 2 | |
+| WORKSPACE_ID | 3 | |
+| WORKSPACE_PROFILE | 4 | |
+| WORKSPACE_APPROVAL | 5 | |
+| WORKSPACE_EXTERNAL_APPROVAL | 6 | |
+| ENTERPRISE_LICENSE | 7 | |
+| APP_IM | 8 | |
+| WATERMARK | 9 | |
+| AI | 10 | |
+| PLUGIN_AGENT | 11 | |
+| WORKSPACE_MAIL_DELIVERY | 12 | |
+| SCHEMA_TEMPLATE | 13 | |
+| DATA_CLASSIFICATION | 14 | |
+| SEMANTIC_TYPES | 15 | |
+| SQL_RESULT_SIZE_LIMIT | 16 | |
+| SCIM | 17 | |
+| PASSWORD_RESTRICTION | 18 | |
+| ENVIRONMENT | 19 | |
+
+
diff --git a/proto/gen/grpc-doc/v1/index.html b/proto/gen/grpc-doc/v1/index.html
index 454d69122f..68f6876739 100644
--- a/proto/gen/grpc-doc/v1/index.html
+++ b/proto/gen/grpc-doc/v1/index.html
@@ -1215,6 +1215,10 @@
<a href="#bytebase.v1.SMTPMailDeliverySettingValue.Encryption"><span class="badge">E</span>SMTPMailDeliverySettingValue.Encryption</a>
</li>
+ <li>
+ <a href="#bytebase.v1.Setting.SettingName"><span class="badge">E</span>Setting.SettingName</a>
+ </li>
+
<li>
@@ -14253,6 +14257,137 @@ Default to this mode.</p></td>
</tbody>
</table>
+ <h3 id="bytebase.v1.Setting.SettingName">Setting.SettingName</h3>
+ <p></p>
+ <table class="enum-table">
+ <thead>
+ <tr><td>Name</td><td>Number</td><td>Description</td></tr>
+ </thead>
+ <tbody>
+
+ <tr>
+ <td>SETTING_NAME_UNSPECIFIED</td>
+ <td>0</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>AUTH_SECRET</td>
+ <td>1</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>BRANDING_LOGO</td>
+ <td>2</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_ID</td>
+ <td>3</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_PROFILE</td>
+ <td>4</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_APPROVAL</td>
+ <td>5</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_EXTERNAL_APPROVAL</td>
+ <td>6</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENTERPRISE_LICENSE</td>
+ <td>7</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>APP_IM</td>
+ <td>8</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WATERMARK</td>
+ <td>9</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>AI</td>
+ <td>10</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PLUGIN_AGENT</td>
+ <td>11</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>WORKSPACE_MAIL_DELIVERY</td>
+ <td>12</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SCHEMA_TEMPLATE</td>
+ <td>13</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>DATA_CLASSIFICATION</td>
+ <td>14</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SEMANTIC_TYPES</td>
+ <td>15</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SQL_RESULT_SIZE_LIMIT</td>
+ <td>16</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>SCIM</td>
+ <td>17</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>PASSWORD_RESTRICTION</td>
+ <td>18</td>
+ <td><p></p></td>
+ </tr>
+
+ <tr>
+ <td>ENVIRONMENT</td>
+ <td>19</td>
+ <td><p></p></td>
+ </tr>
+
+ </tbody>
+ </table>
+
diff --git a/proto/generated-go/store/setting.pb.go b/proto/generated-go/store/setting.pb.go
index f86ff6b8d5..b9ed3c806c 100644
--- a/proto/generated-go/store/setting.pb.go
+++ b/proto/generated-go/store/setting.pb.go
@@ -24,6 +24,106 @@ const (
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
)
+type SettingName int32
+
+const (
+ SettingName_SETTING_NAME_UNSPECIFIED SettingName = 0
+ SettingName_AUTH_SECRET SettingName = 1
+ SettingName_BRANDING_LOGO SettingName = 2
+ SettingName_WORKSPACE_ID SettingName = 3
+ SettingName_WORKSPACE_PROFILE SettingName = 4
+ SettingName_WORKSPACE_APPROVAL SettingName = 5
+ SettingName_WORKSPACE_EXTERNAL_APPROVAL SettingName = 6
+ SettingName_ENTERPRISE_LICENSE SettingName = 7
+ SettingName_APP_IM SettingName = 8
+ SettingName_WATERMARK SettingName = 9
+ SettingName_AI SettingName = 10
+ SettingName_PLUGIN_AGENT SettingName = 11
+ SettingName_WORKSPACE_MAIL_DELIVERY SettingName = 12
+ SettingName_SCHEMA_TEMPLATE SettingName = 13
+ SettingName_DATA_CLASSIFICATION SettingName = 14
+ SettingName_SEMANTIC_TYPES SettingName = 15
+ SettingName_SQL_RESULT_SIZE_LIMIT SettingName = 16
+ SettingName_SCIM SettingName = 17
+ SettingName_PASSWORD_RESTRICTION SettingName = 18
+ SettingName_ENVIRONMENT SettingName = 19
+)
+
+// Enum value maps for SettingName.
+var (
+ SettingName_name = map[int32]string{
+ 0: "SETTING_NAME_UNSPECIFIED",
+ 1: "AUTH_SECRET",
+ 2: "BRANDING_LOGO",
+ 3: "WORKSPACE_ID",
+ 4: "WORKSPACE_PROFILE",
+ 5: "WORKSPACE_APPROVAL",
+ 6: "WORKSPACE_EXTERNAL_APPROVAL",
+ 7: "ENTERPRISE_LICENSE",
+ 8: "APP_IM",
+ 9: "WATERMARK",
+ 10: "AI",
+ 11: "PLUGIN_AGENT",
+ 12: "WORKSPACE_MAIL_DELIVERY",
+ 13: "SCHEMA_TEMPLATE",
+ 14: "DATA_CLASSIFICATION",
+ 15: "SEMANTIC_TYPES",
+ 16: "SQL_RESULT_SIZE_LIMIT",
+ 17: "SCIM",
+ 18: "PASSWORD_RESTRICTION",
+ 19: "ENVIRONMENT",
+ }
+ SettingName_value = map[string]int32{
+ "SETTING_NAME_UNSPECIFIED": 0,
+ "AUTH_SECRET": 1,
+ "BRANDING_LOGO": 2,
+ "WORKSPACE_ID": 3,
+ "WORKSPACE_PROFILE": 4,
+ "WORKSPACE_APPROVAL": 5,
+ "WORKSPACE_EXTERNAL_APPROVAL": 6,
+ "ENTERPRISE_LICENSE": 7,
+ "APP_IM": 8,
+ "WATERMARK": 9,
+ "AI": 10,
+ "PLUGIN_AGENT": 11,
+ "WORKSPACE_MAIL_DELIVERY": 12,
+ "SCHEMA_TEMPLATE": 13,
+ "DATA_CLASSIFICATION": 14,
+ "SEMANTIC_TYPES": 15,
+ "SQL_RESULT_SIZE_LIMIT": 16,
+ "SCIM": 17,
+ "PASSWORD_RESTRICTION": 18,
+ "ENVIRONMENT": 19,
+ }
+)
+
+func (x SettingName) Enum() *SettingName {
+ p := new(SettingName)
+ *p = x
+ return p
+}
+
+func (x SettingName) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (SettingName) Descriptor() protoreflect.EnumDescriptor {
+ return file_store_setting_proto_enumTypes[0].Descriptor()
+}
+
+func (SettingName) Type() protoreflect.EnumType {
+ return &file_store_setting_proto_enumTypes[0]
+}
+
+func (x SettingName) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use SettingName.Descriptor instead.
+func (SettingName) EnumDescriptor() ([]byte, []int) {
+ return file_store_setting_proto_rawDescGZIP(), []int{0}
+}
+
type DatabaseChangeMode int32
const (
@@ -60,11 +160,11 @@ func (x DatabaseChangeMode) String() string {
}
func (DatabaseChangeMode) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[0].Descriptor()
+ return file_store_setting_proto_enumTypes[1].Descriptor()
}
func (DatabaseChangeMode) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[0]
+ return &file_store_setting_proto_enumTypes[1]
}
func (x DatabaseChangeMode) Number() protoreflect.EnumNumber {
@@ -73,7 +173,7 @@ func (x DatabaseChangeMode) Number() protoreflect.EnumNumber {
// Deprecated: Use DatabaseChangeMode.Descriptor instead.
func (DatabaseChangeMode) EnumDescriptor() ([]byte, []int) {
- return file_store_setting_proto_rawDescGZIP(), []int{0}
+ return file_store_setting_proto_rawDescGZIP(), []int{1}
}
// We support three levels of AlertLevel: INFO, WARNING, and ERROR.
@@ -113,11 +213,11 @@ func (x Announcement_AlertLevel) String() string {
}
func (Announcement_AlertLevel) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[1].Descriptor()
+ return file_store_setting_proto_enumTypes[2].Descriptor()
}
func (Announcement_AlertLevel) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[1]
+ return &file_store_setting_proto_enumTypes[2]
}
func (x Announcement_AlertLevel) Number() protoreflect.EnumNumber {
@@ -166,11 +266,11 @@ func (x SMTPMailDeliverySetting_Encryption) String() string {
}
func (SMTPMailDeliverySetting_Encryption) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[2].Descriptor()
+ return file_store_setting_proto_enumTypes[3].Descriptor()
}
func (SMTPMailDeliverySetting_Encryption) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[2]
+ return &file_store_setting_proto_enumTypes[3]
}
func (x SMTPMailDeliverySetting_Encryption) Number() protoreflect.EnumNumber {
@@ -223,11 +323,11 @@ func (x SMTPMailDeliverySetting_Authentication) String() string {
}
func (SMTPMailDeliverySetting_Authentication) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[3].Descriptor()
+ return file_store_setting_proto_enumTypes[4].Descriptor()
}
func (SMTPMailDeliverySetting_Authentication) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[3]
+ return &file_store_setting_proto_enumTypes[4]
}
func (x SMTPMailDeliverySetting_Authentication) Number() protoreflect.EnumNumber {
@@ -272,11 +372,11 @@ func (x Algorithm_InnerOuterMask_MaskType) String() string {
}
func (Algorithm_InnerOuterMask_MaskType) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[4].Descriptor()
+ return file_store_setting_proto_enumTypes[5].Descriptor()
}
func (Algorithm_InnerOuterMask_MaskType) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[4]
+ return &file_store_setting_proto_enumTypes[5]
}
func (x Algorithm_InnerOuterMask_MaskType) Number() protoreflect.EnumNumber {
@@ -327,11 +427,11 @@ func (x AISetting_Provider) String() string {
}
func (AISetting_Provider) Descriptor() protoreflect.EnumDescriptor {
- return file_store_setting_proto_enumTypes[5].Descriptor()
+ return file_store_setting_proto_enumTypes[6].Descriptor()
}
func (AISetting_Provider) Type() protoreflect.EnumType {
- return &file_store_setting_proto_enumTypes[5]
+ return &file_store_setting_proto_enumTypes[6]
}
func (x AISetting_Provider) Number() protoreflect.EnumNumber {
@@ -2830,7 +2930,30 @@ const file_store_setting_proto_rawDesc = "" +
"\x05color\x18\x04 \x01(\tR\x05color\x1a7\n" +
"\tTagsEntry\x12\x10\n" +
"\x03key\x18\x01 \x01(\tR\x03key\x12\x14\n" +
- "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*T\n" +
+ "\x05value\x18\x02 \x01(\tR\x05value:\x028\x01*\xad\x03\n" +
+ "\vSettingName\x12\x1c\n" +
+ "\x18SETTING_NAME_UNSPECIFIED\x10\x00\x12\x0f\n" +
+ "\vAUTH_SECRET\x10\x01\x12\x11\n" +
+ "\rBRANDING_LOGO\x10\x02\x12\x10\n" +
+ "\fWORKSPACE_ID\x10\x03\x12\x15\n" +
+ "\x11WORKSPACE_PROFILE\x10\x04\x12\x16\n" +
+ "\x12WORKSPACE_APPROVAL\x10\x05\x12\x1f\n" +
+ "\x1bWORKSPACE_EXTERNAL_APPROVAL\x10\x06\x12\x16\n" +
+ "\x12ENTERPRISE_LICENSE\x10\a\x12\n" +
+ "\n" +
+ "\x06APP_IM\x10\b\x12\r\n" +
+ "\tWATERMARK\x10\t\x12\x06\n" +
+ "\x02AI\x10\n" +
+ "\x12\x10\n" +
+ "\fPLUGIN_AGENT\x10\v\x12\x1b\n" +
+ "\x17WORKSPACE_MAIL_DELIVERY\x10\f\x12\x13\n" +
+ "\x0fSCHEMA_TEMPLATE\x10\r\x12\x17\n" +
+ "\x13DATA_CLASSIFICATION\x10\x0e\x12\x12\n" +
+ "\x0eSEMANTIC_TYPES\x10\x0f\x12\x19\n" +
+ "\x15SQL_RESULT_SIZE_LIMIT\x10\x10\x12\b\n" +
+ "\x04SCIM\x10\x11\x12\x18\n" +
+ "\x14PASSWORD_RESTRICTION\x10\x12\x12\x0f\n" +
+ "\vENVIRONMENT\x10\x13*T\n" +
"\x12DatabaseChangeMode\x12$\n" +
" DATABASE_CHANGE_MODE_UNSPECIFIED\x10\x00\x12\f\n" +
"\bPIPELINE\x10\x01\x12\n" +
@@ -2849,104 +2972,105 @@ func file_store_setting_proto_rawDescGZIP() []byte {
return file_store_setting_proto_rawDescData
}
-var file_store_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
+var file_store_setting_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
var file_store_setting_proto_msgTypes = make([]protoimpl.MessageInfo, 36)
var file_store_setting_proto_goTypes = []any{
- (DatabaseChangeMode)(0), // 0: bytebase.store.DatabaseChangeMode
- (Announcement_AlertLevel)(0), // 1: bytebase.store.Announcement.AlertLevel
- (SMTPMailDeliverySetting_Encryption)(0), // 2: bytebase.store.SMTPMailDeliverySetting.Encryption
- (SMTPMailDeliverySetting_Authentication)(0), // 3: bytebase.store.SMTPMailDeliverySetting.Authentication
- (Algorithm_InnerOuterMask_MaskType)(0), // 4: bytebase.store.Algorithm.InnerOuterMask.MaskType
- (AISetting_Provider)(0), // 5: bytebase.store.AISetting.Provider
- (*WorkspaceProfileSetting)(nil), // 6: bytebase.store.WorkspaceProfileSetting
- (*Announcement)(nil), // 7: bytebase.store.Announcement
- (*AgentPluginSetting)(nil), // 8: bytebase.store.AgentPluginSetting
- (*WorkspaceApprovalSetting)(nil), // 9: bytebase.store.WorkspaceApprovalSetting
- (*SMTPMailDeliverySetting)(nil), // 10: bytebase.store.SMTPMailDeliverySetting
- (*SchemaTemplateSetting)(nil), // 11: bytebase.store.SchemaTemplateSetting
- (*DataClassificationSetting)(nil), // 12: bytebase.store.DataClassificationSetting
- (*SemanticTypeSetting)(nil), // 13: bytebase.store.SemanticTypeSetting
- (*Algorithm)(nil), // 14: bytebase.store.Algorithm
- (*AppIMSetting)(nil), // 15: bytebase.store.AppIMSetting
- (*MaximumSQLResultSizeSetting)(nil), // 16: bytebase.store.MaximumSQLResultSizeSetting
- (*SCIMSetting)(nil), // 17: bytebase.store.SCIMSetting
- (*PasswordRestrictionSetting)(nil), // 18: bytebase.store.PasswordRestrictionSetting
- (*AISetting)(nil), // 19: bytebase.store.AISetting
- (*EnvironmentSetting)(nil), // 20: bytebase.store.EnvironmentSetting
- (*WorkspaceApprovalSetting_Rule)(nil), // 21: bytebase.store.WorkspaceApprovalSetting.Rule
- (*SchemaTemplateSetting_FieldTemplate)(nil), // 22: bytebase.store.SchemaTemplateSetting.FieldTemplate
- (*SchemaTemplateSetting_ColumnType)(nil), // 23: bytebase.store.SchemaTemplateSetting.ColumnType
- (*SchemaTemplateSetting_TableTemplate)(nil), // 24: bytebase.store.SchemaTemplateSetting.TableTemplate
- (*DataClassificationSetting_DataClassificationConfig)(nil), // 25: bytebase.store.DataClassificationSetting.DataClassificationConfig
- (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 26: bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
- (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 27: bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
- nil, // 28: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- (*SemanticTypeSetting_SemanticType)(nil), // 29: bytebase.store.SemanticTypeSetting.SemanticType
- (*Algorithm_FullMask)(nil), // 30: bytebase.store.Algorithm.FullMask
- (*Algorithm_RangeMask)(nil), // 31: bytebase.store.Algorithm.RangeMask
- (*Algorithm_MD5Mask)(nil), // 32: bytebase.store.Algorithm.MD5Mask
- (*Algorithm_InnerOuterMask)(nil), // 33: bytebase.store.Algorithm.InnerOuterMask
- (*Algorithm_RangeMask_Slice)(nil), // 34: bytebase.store.Algorithm.RangeMask.Slice
- (*AppIMSetting_Slack)(nil), // 35: bytebase.store.AppIMSetting.Slack
- (*AppIMSetting_Feishu)(nil), // 36: bytebase.store.AppIMSetting.Feishu
- (*AppIMSetting_Wecom)(nil), // 37: bytebase.store.AppIMSetting.Wecom
- (*AppIMSetting_Lark)(nil), // 38: bytebase.store.AppIMSetting.Lark
- (*AppIMSetting_DingTalk)(nil), // 39: bytebase.store.AppIMSetting.DingTalk
- (*EnvironmentSetting_Environment)(nil), // 40: bytebase.store.EnvironmentSetting.Environment
- nil, // 41: bytebase.store.EnvironmentSetting.Environment.TagsEntry
- (*durationpb.Duration)(nil), // 42: google.protobuf.Duration
- (*v1alpha1.Expr)(nil), // 43: google.api.expr.v1alpha1.Expr
- (*ApprovalTemplate)(nil), // 44: bytebase.store.ApprovalTemplate
- (*expr.Expr)(nil), // 45: google.type.Expr
- (Engine)(0), // 46: bytebase.store.Engine
- (*ColumnMetadata)(nil), // 47: bytebase.store.ColumnMetadata
- (*ColumnCatalog)(nil), // 48: bytebase.store.ColumnCatalog
- (*TableMetadata)(nil), // 49: bytebase.store.TableMetadata
- (*TableCatalog)(nil), // 50: bytebase.store.TableCatalog
+ (SettingName)(0), // 0: bytebase.store.SettingName
+ (DatabaseChangeMode)(0), // 1: bytebase.store.DatabaseChangeMode
+ (Announcement_AlertLevel)(0), // 2: bytebase.store.Announcement.AlertLevel
+ (SMTPMailDeliverySetting_Encryption)(0), // 3: bytebase.store.SMTPMailDeliverySetting.Encryption
+ (SMTPMailDeliverySetting_Authentication)(0), // 4: bytebase.store.SMTPMailDeliverySetting.Authentication
+ (Algorithm_InnerOuterMask_MaskType)(0), // 5: bytebase.store.Algorithm.InnerOuterMask.MaskType
+ (AISetting_Provider)(0), // 6: bytebase.store.AISetting.Provider
+ (*WorkspaceProfileSetting)(nil), // 7: bytebase.store.WorkspaceProfileSetting
+ (*Announcement)(nil), // 8: bytebase.store.Announcement
+ (*AgentPluginSetting)(nil), // 9: bytebase.store.AgentPluginSetting
+ (*WorkspaceApprovalSetting)(nil), // 10: bytebase.store.WorkspaceApprovalSetting
+ (*SMTPMailDeliverySetting)(nil), // 11: bytebase.store.SMTPMailDeliverySetting
+ (*SchemaTemplateSetting)(nil), // 12: bytebase.store.SchemaTemplateSetting
+ (*DataClassificationSetting)(nil), // 13: bytebase.store.DataClassificationSetting
+ (*SemanticTypeSetting)(nil), // 14: bytebase.store.SemanticTypeSetting
+ (*Algorithm)(nil), // 15: bytebase.store.Algorithm
+ (*AppIMSetting)(nil), // 16: bytebase.store.AppIMSetting
+ (*MaximumSQLResultSizeSetting)(nil), // 17: bytebase.store.MaximumSQLResultSizeSetting
+ (*SCIMSetting)(nil), // 18: bytebase.store.SCIMSetting
+ (*PasswordRestrictionSetting)(nil), // 19: bytebase.store.PasswordRestrictionSetting
+ (*AISetting)(nil), // 20: bytebase.store.AISetting
+ (*EnvironmentSetting)(nil), // 21: bytebase.store.EnvironmentSetting
+ (*WorkspaceApprovalSetting_Rule)(nil), // 22: bytebase.store.WorkspaceApprovalSetting.Rule
+ (*SchemaTemplateSetting_FieldTemplate)(nil), // 23: bytebase.store.SchemaTemplateSetting.FieldTemplate
+ (*SchemaTemplateSetting_ColumnType)(nil), // 24: bytebase.store.SchemaTemplateSetting.ColumnType
+ (*SchemaTemplateSetting_TableTemplate)(nil), // 25: bytebase.store.SchemaTemplateSetting.TableTemplate
+ (*DataClassificationSetting_DataClassificationConfig)(nil), // 26: bytebase.store.DataClassificationSetting.DataClassificationConfig
+ (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 27: bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
+ (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 28: bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
+ nil, // 29: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ (*SemanticTypeSetting_SemanticType)(nil), // 30: bytebase.store.SemanticTypeSetting.SemanticType
+ (*Algorithm_FullMask)(nil), // 31: bytebase.store.Algorithm.FullMask
+ (*Algorithm_RangeMask)(nil), // 32: bytebase.store.Algorithm.RangeMask
+ (*Algorithm_MD5Mask)(nil), // 33: bytebase.store.Algorithm.MD5Mask
+ (*Algorithm_InnerOuterMask)(nil), // 34: bytebase.store.Algorithm.InnerOuterMask
+ (*Algorithm_RangeMask_Slice)(nil), // 35: bytebase.store.Algorithm.RangeMask.Slice
+ (*AppIMSetting_Slack)(nil), // 36: bytebase.store.AppIMSetting.Slack
+ (*AppIMSetting_Feishu)(nil), // 37: bytebase.store.AppIMSetting.Feishu
+ (*AppIMSetting_Wecom)(nil), // 38: bytebase.store.AppIMSetting.Wecom
+ (*AppIMSetting_Lark)(nil), // 39: bytebase.store.AppIMSetting.Lark
+ (*AppIMSetting_DingTalk)(nil), // 40: bytebase.store.AppIMSetting.DingTalk
+ (*EnvironmentSetting_Environment)(nil), // 41: bytebase.store.EnvironmentSetting.Environment
+ nil, // 42: bytebase.store.EnvironmentSetting.Environment.TagsEntry
+ (*durationpb.Duration)(nil), // 43: google.protobuf.Duration
+ (*v1alpha1.Expr)(nil), // 44: google.api.expr.v1alpha1.Expr
+ (*ApprovalTemplate)(nil), // 45: bytebase.store.ApprovalTemplate
+ (*expr.Expr)(nil), // 46: google.type.Expr
+ (Engine)(0), // 47: bytebase.store.Engine
+ (*ColumnMetadata)(nil), // 48: bytebase.store.ColumnMetadata
+ (*ColumnCatalog)(nil), // 49: bytebase.store.ColumnCatalog
+ (*TableMetadata)(nil), // 50: bytebase.store.TableMetadata
+ (*TableCatalog)(nil), // 51: bytebase.store.TableCatalog
}
var file_store_setting_proto_depIdxs = []int32{
- 42, // 0: bytebase.store.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
- 7, // 1: bytebase.store.WorkspaceProfileSetting.announcement:type_name -> bytebase.store.Announcement
- 42, // 2: bytebase.store.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
- 0, // 3: bytebase.store.WorkspaceProfileSetting.database_change_mode:type_name -> bytebase.store.DatabaseChangeMode
- 1, // 4: bytebase.store.Announcement.level:type_name -> bytebase.store.Announcement.AlertLevel
- 21, // 5: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule
- 2, // 6: bytebase.store.SMTPMailDeliverySetting.encryption:type_name -> bytebase.store.SMTPMailDeliverySetting.Encryption
- 3, // 7: bytebase.store.SMTPMailDeliverySetting.authentication:type_name -> bytebase.store.SMTPMailDeliverySetting.Authentication
- 22, // 8: bytebase.store.SchemaTemplateSetting.field_templates:type_name -> bytebase.store.SchemaTemplateSetting.FieldTemplate
- 23, // 9: bytebase.store.SchemaTemplateSetting.column_types:type_name -> bytebase.store.SchemaTemplateSetting.ColumnType
- 24, // 10: bytebase.store.SchemaTemplateSetting.table_templates:type_name -> bytebase.store.SchemaTemplateSetting.TableTemplate
- 25, // 11: bytebase.store.DataClassificationSetting.configs:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig
- 29, // 12: bytebase.store.SemanticTypeSetting.types:type_name -> bytebase.store.SemanticTypeSetting.SemanticType
- 30, // 13: bytebase.store.Algorithm.full_mask:type_name -> bytebase.store.Algorithm.FullMask
- 31, // 14: bytebase.store.Algorithm.range_mask:type_name -> bytebase.store.Algorithm.RangeMask
- 32, // 15: bytebase.store.Algorithm.md5_mask:type_name -> bytebase.store.Algorithm.MD5Mask
- 33, // 16: bytebase.store.Algorithm.inner_outer_mask:type_name -> bytebase.store.Algorithm.InnerOuterMask
- 35, // 17: bytebase.store.AppIMSetting.slack:type_name -> bytebase.store.AppIMSetting.Slack
- 36, // 18: bytebase.store.AppIMSetting.feishu:type_name -> bytebase.store.AppIMSetting.Feishu
- 37, // 19: bytebase.store.AppIMSetting.wecom:type_name -> bytebase.store.AppIMSetting.Wecom
- 38, // 20: bytebase.store.AppIMSetting.lark:type_name -> bytebase.store.AppIMSetting.Lark
- 39, // 21: bytebase.store.AppIMSetting.dingtalk:type_name -> bytebase.store.AppIMSetting.DingTalk
- 42, // 22: bytebase.store.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
- 5, // 23: bytebase.store.AISetting.provider:type_name -> bytebase.store.AISetting.Provider
- 40, // 24: bytebase.store.EnvironmentSetting.environments:type_name -> bytebase.store.EnvironmentSetting.Environment
- 43, // 25: bytebase.store.WorkspaceApprovalSetting.Rule.expression:type_name -> google.api.expr.v1alpha1.Expr
- 44, // 26: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate
- 45, // 27: bytebase.store.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
- 46, // 28: bytebase.store.SchemaTemplateSetting.FieldTemplate.engine:type_name -> bytebase.store.Engine
- 47, // 29: bytebase.store.SchemaTemplateSetting.FieldTemplate.column:type_name -> bytebase.store.ColumnMetadata
- 48, // 30: bytebase.store.SchemaTemplateSetting.FieldTemplate.catalog:type_name -> bytebase.store.ColumnCatalog
- 46, // 31: bytebase.store.SchemaTemplateSetting.ColumnType.engine:type_name -> bytebase.store.Engine
- 46, // 32: bytebase.store.SchemaTemplateSetting.TableTemplate.engine:type_name -> bytebase.store.Engine
- 49, // 33: bytebase.store.SchemaTemplateSetting.TableTemplate.table:type_name -> bytebase.store.TableMetadata
- 50, // 34: bytebase.store.SchemaTemplateSetting.TableTemplate.catalog:type_name -> bytebase.store.TableCatalog
- 26, // 35: bytebase.store.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
- 28, // 36: bytebase.store.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- 27, // 37: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
- 14, // 38: bytebase.store.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.store.Algorithm
- 34, // 39: bytebase.store.Algorithm.RangeMask.slices:type_name -> bytebase.store.Algorithm.RangeMask.Slice
- 4, // 40: bytebase.store.Algorithm.InnerOuterMask.type:type_name -> bytebase.store.Algorithm.InnerOuterMask.MaskType
- 41, // 41: bytebase.store.EnvironmentSetting.Environment.tags:type_name -> bytebase.store.EnvironmentSetting.Environment.TagsEntry
+ 43, // 0: bytebase.store.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
+ 8, // 1: bytebase.store.WorkspaceProfileSetting.announcement:type_name -> bytebase.store.Announcement
+ 43, // 2: bytebase.store.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
+ 1, // 3: bytebase.store.WorkspaceProfileSetting.database_change_mode:type_name -> bytebase.store.DatabaseChangeMode
+ 2, // 4: bytebase.store.Announcement.level:type_name -> bytebase.store.Announcement.AlertLevel
+ 22, // 5: bytebase.store.WorkspaceApprovalSetting.rules:type_name -> bytebase.store.WorkspaceApprovalSetting.Rule
+ 3, // 6: bytebase.store.SMTPMailDeliverySetting.encryption:type_name -> bytebase.store.SMTPMailDeliverySetting.Encryption
+ 4, // 7: bytebase.store.SMTPMailDeliverySetting.authentication:type_name -> bytebase.store.SMTPMailDeliverySetting.Authentication
+ 23, // 8: bytebase.store.SchemaTemplateSetting.field_templates:type_name -> bytebase.store.SchemaTemplateSetting.FieldTemplate
+ 24, // 9: bytebase.store.SchemaTemplateSetting.column_types:type_name -> bytebase.store.SchemaTemplateSetting.ColumnType
+ 25, // 10: bytebase.store.SchemaTemplateSetting.table_templates:type_name -> bytebase.store.SchemaTemplateSetting.TableTemplate
+ 26, // 11: bytebase.store.DataClassificationSetting.configs:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig
+ 30, // 12: bytebase.store.SemanticTypeSetting.types:type_name -> bytebase.store.SemanticTypeSetting.SemanticType
+ 31, // 13: bytebase.store.Algorithm.full_mask:type_name -> bytebase.store.Algorithm.FullMask
+ 32, // 14: bytebase.store.Algorithm.range_mask:type_name -> bytebase.store.Algorithm.RangeMask
+ 33, // 15: bytebase.store.Algorithm.md5_mask:type_name -> bytebase.store.Algorithm.MD5Mask
+ 34, // 16: bytebase.store.Algorithm.inner_outer_mask:type_name -> bytebase.store.Algorithm.InnerOuterMask
+ 36, // 17: bytebase.store.AppIMSetting.slack:type_name -> bytebase.store.AppIMSetting.Slack
+ 37, // 18: bytebase.store.AppIMSetting.feishu:type_name -> bytebase.store.AppIMSetting.Feishu
+ 38, // 19: bytebase.store.AppIMSetting.wecom:type_name -> bytebase.store.AppIMSetting.Wecom
+ 39, // 20: bytebase.store.AppIMSetting.lark:type_name -> bytebase.store.AppIMSetting.Lark
+ 40, // 21: bytebase.store.AppIMSetting.dingtalk:type_name -> bytebase.store.AppIMSetting.DingTalk
+ 43, // 22: bytebase.store.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
+ 6, // 23: bytebase.store.AISetting.provider:type_name -> bytebase.store.AISetting.Provider
+ 41, // 24: bytebase.store.EnvironmentSetting.environments:type_name -> bytebase.store.EnvironmentSetting.Environment
+ 44, // 25: bytebase.store.WorkspaceApprovalSetting.Rule.expression:type_name -> google.api.expr.v1alpha1.Expr
+ 45, // 26: bytebase.store.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.store.ApprovalTemplate
+ 46, // 27: bytebase.store.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
+ 47, // 28: bytebase.store.SchemaTemplateSetting.FieldTemplate.engine:type_name -> bytebase.store.Engine
+ 48, // 29: bytebase.store.SchemaTemplateSetting.FieldTemplate.column:type_name -> bytebase.store.ColumnMetadata
+ 49, // 30: bytebase.store.SchemaTemplateSetting.FieldTemplate.catalog:type_name -> bytebase.store.ColumnCatalog
+ 47, // 31: bytebase.store.SchemaTemplateSetting.ColumnType.engine:type_name -> bytebase.store.Engine
+ 47, // 32: bytebase.store.SchemaTemplateSetting.TableTemplate.engine:type_name -> bytebase.store.Engine
+ 50, // 33: bytebase.store.SchemaTemplateSetting.TableTemplate.table:type_name -> bytebase.store.TableMetadata
+ 51, // 34: bytebase.store.SchemaTemplateSetting.TableTemplate.catalog:type_name -> bytebase.store.TableCatalog
+ 27, // 35: bytebase.store.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.Level
+ 29, // 36: bytebase.store.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ 28, // 37: bytebase.store.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.store.DataClassificationSetting.DataClassificationConfig.DataClassification
+ 15, // 38: bytebase.store.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.store.Algorithm
+ 35, // 39: bytebase.store.Algorithm.RangeMask.slices:type_name -> bytebase.store.Algorithm.RangeMask.Slice
+ 5, // 40: bytebase.store.Algorithm.InnerOuterMask.type:type_name -> bytebase.store.Algorithm.InnerOuterMask.MaskType
+ 42, // 41: bytebase.store.EnvironmentSetting.Environment.tags:type_name -> bytebase.store.EnvironmentSetting.Environment.TagsEntry
42, // [42:42] is the sub-list for method output_type
42, // [42:42] is the sub-list for method input_type
42, // [42:42] is the sub-list for extension type_name
@@ -2974,7 +3098,7 @@ func file_store_setting_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_store_setting_proto_rawDesc), len(file_store_setting_proto_rawDesc)),
- NumEnums: 6,
+ NumEnums: 7,
NumMessages: 36,
NumExtensions: 0,
NumServices: 0,
diff --git a/proto/generated-go/v1/setting_service.pb.go b/proto/generated-go/v1/setting_service.pb.go
index 7ac909af36..ba34d3c313 100644
--- a/proto/generated-go/v1/setting_service.pb.go
+++ b/proto/generated-go/v1/setting_service.pb.go
@@ -78,6 +78,106 @@ func (DatabaseChangeMode) EnumDescriptor() ([]byte, []int) {
return file_v1_setting_service_proto_rawDescGZIP(), []int{0}
}
+type Setting_SettingName int32
+
+const (
+ Setting_SETTING_NAME_UNSPECIFIED Setting_SettingName = 0
+ Setting_AUTH_SECRET Setting_SettingName = 1
+ Setting_BRANDING_LOGO Setting_SettingName = 2
+ Setting_WORKSPACE_ID Setting_SettingName = 3
+ Setting_WORKSPACE_PROFILE Setting_SettingName = 4
+ Setting_WORKSPACE_APPROVAL Setting_SettingName = 5
+ Setting_WORKSPACE_EXTERNAL_APPROVAL Setting_SettingName = 6
+ Setting_ENTERPRISE_LICENSE Setting_SettingName = 7
+ Setting_APP_IM Setting_SettingName = 8
+ Setting_WATERMARK Setting_SettingName = 9
+ Setting_AI Setting_SettingName = 10
+ Setting_PLUGIN_AGENT Setting_SettingName = 11
+ Setting_WORKSPACE_MAIL_DELIVERY Setting_SettingName = 12
+ Setting_SCHEMA_TEMPLATE Setting_SettingName = 13
+ Setting_DATA_CLASSIFICATION Setting_SettingName = 14
+ Setting_SEMANTIC_TYPES Setting_SettingName = 15
+ Setting_SQL_RESULT_SIZE_LIMIT Setting_SettingName = 16
+ Setting_SCIM Setting_SettingName = 17
+ Setting_PASSWORD_RESTRICTION Setting_SettingName = 18
+ Setting_ENVIRONMENT Setting_SettingName = 19
+)
+
+// Enum value maps for Setting_SettingName.
+var (
+ Setting_SettingName_name = map[int32]string{
+ 0: "SETTING_NAME_UNSPECIFIED",
+ 1: "AUTH_SECRET",
+ 2: "BRANDING_LOGO",
+ 3: "WORKSPACE_ID",
+ 4: "WORKSPACE_PROFILE",
+ 5: "WORKSPACE_APPROVAL",
+ 6: "WORKSPACE_EXTERNAL_APPROVAL",
+ 7: "ENTERPRISE_LICENSE",
+ 8: "APP_IM",
+ 9: "WATERMARK",
+ 10: "AI",
+ 11: "PLUGIN_AGENT",
+ 12: "WORKSPACE_MAIL_DELIVERY",
+ 13: "SCHEMA_TEMPLATE",
+ 14: "DATA_CLASSIFICATION",
+ 15: "SEMANTIC_TYPES",
+ 16: "SQL_RESULT_SIZE_LIMIT",
+ 17: "SCIM",
+ 18: "PASSWORD_RESTRICTION",
+ 19: "ENVIRONMENT",
+ }
+ Setting_SettingName_value = map[string]int32{
+ "SETTING_NAME_UNSPECIFIED": 0,
+ "AUTH_SECRET": 1,
+ "BRANDING_LOGO": 2,
+ "WORKSPACE_ID": 3,
+ "WORKSPACE_PROFILE": 4,
+ "WORKSPACE_APPROVAL": 5,
+ "WORKSPACE_EXTERNAL_APPROVAL": 6,
+ "ENTERPRISE_LICENSE": 7,
+ "APP_IM": 8,
+ "WATERMARK": 9,
+ "AI": 10,
+ "PLUGIN_AGENT": 11,
+ "WORKSPACE_MAIL_DELIVERY": 12,
+ "SCHEMA_TEMPLATE": 13,
+ "DATA_CLASSIFICATION": 14,
+ "SEMANTIC_TYPES": 15,
+ "SQL_RESULT_SIZE_LIMIT": 16,
+ "SCIM": 17,
+ "PASSWORD_RESTRICTION": 18,
+ "ENVIRONMENT": 19,
+ }
+)
+
+func (x Setting_SettingName) Enum() *Setting_SettingName {
+ p := new(Setting_SettingName)
+ *p = x
+ return p
+}
+
+func (x Setting_SettingName) String() string {
+ return protoimpl.X.EnumStringOf(x.Descriptor(), protoreflect.EnumNumber(x))
+}
+
+func (Setting_SettingName) Descriptor() protoreflect.EnumDescriptor {
+ return file_v1_setting_service_proto_enumTypes[1].Descriptor()
+}
+
+func (Setting_SettingName) Type() protoreflect.EnumType {
+ return &file_v1_setting_service_proto_enumTypes[1]
+}
+
+func (x Setting_SettingName) Number() protoreflect.EnumNumber {
+ return protoreflect.EnumNumber(x)
+}
+
+// Deprecated: Use Setting_SettingName.Descriptor instead.
+func (Setting_SettingName) EnumDescriptor() ([]byte, []int) {
+ return file_v1_setting_service_proto_rawDescGZIP(), []int{5, 0}
+}
+
// We support three types of SMTP encryption: NONE, STARTTLS, and SSL/TLS.
type SMTPMailDeliverySettingValue_Encryption int32
@@ -115,11 +215,11 @@ func (x SMTPMailDeliverySettingValue_Encryption) String() string {
}
func (SMTPMailDeliverySettingValue_Encryption) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_setting_service_proto_enumTypes[1].Descriptor()
+ return file_v1_setting_service_proto_enumTypes[2].Descriptor()
}
func (SMTPMailDeliverySettingValue_Encryption) Type() protoreflect.EnumType {
- return &file_v1_setting_service_proto_enumTypes[1]
+ return &file_v1_setting_service_proto_enumTypes[2]
}
func (x SMTPMailDeliverySettingValue_Encryption) Number() protoreflect.EnumNumber {
@@ -171,11 +271,11 @@ func (x SMTPMailDeliverySettingValue_Authentication) String() string {
}
func (SMTPMailDeliverySettingValue_Authentication) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_setting_service_proto_enumTypes[2].Descriptor()
+ return file_v1_setting_service_proto_enumTypes[3].Descriptor()
}
func (SMTPMailDeliverySettingValue_Authentication) Type() protoreflect.EnumType {
- return &file_v1_setting_service_proto_enumTypes[2]
+ return &file_v1_setting_service_proto_enumTypes[3]
}
func (x SMTPMailDeliverySettingValue_Authentication) Number() protoreflect.EnumNumber {
@@ -224,11 +324,11 @@ func (x Announcement_AlertLevel) String() string {
}
func (Announcement_AlertLevel) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_setting_service_proto_enumTypes[3].Descriptor()
+ return file_v1_setting_service_proto_enumTypes[4].Descriptor()
}
func (Announcement_AlertLevel) Type() protoreflect.EnumType {
- return &file_v1_setting_service_proto_enumTypes[3]
+ return &file_v1_setting_service_proto_enumTypes[4]
}
func (x Announcement_AlertLevel) Number() protoreflect.EnumNumber {
@@ -273,11 +373,11 @@ func (x Algorithm_InnerOuterMask_MaskType) String() string {
}
func (Algorithm_InnerOuterMask_MaskType) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_setting_service_proto_enumTypes[4].Descriptor()
+ return file_v1_setting_service_proto_enumTypes[5].Descriptor()
}
func (Algorithm_InnerOuterMask_MaskType) Type() protoreflect.EnumType {
- return &file_v1_setting_service_proto_enumTypes[4]
+ return &file_v1_setting_service_proto_enumTypes[5]
}
func (x Algorithm_InnerOuterMask_MaskType) Number() protoreflect.EnumNumber {
@@ -328,11 +428,11 @@ func (x AISetting_Provider) String() string {
}
func (AISetting_Provider) Descriptor() protoreflect.EnumDescriptor {
- return file_v1_setting_service_proto_enumTypes[5].Descriptor()
+ return file_v1_setting_service_proto_enumTypes[6].Descriptor()
}
func (AISetting_Provider) Type() protoreflect.EnumType {
- return &file_v1_setting_service_proto_enumTypes[5]
+ return &file_v1_setting_service_proto_enumTypes[6]
}
func (x AISetting_Provider) Number() protoreflect.EnumNumber {
@@ -3382,10 +3482,33 @@ const file_v1_setting_service_proto_rawDesc = "" +
"\rvalidate_only\x18\x02 \x01(\bR\fvalidateOnly\x12#\n" +
"\rallow_missing\x18\x03 \x01(\bR\fallowMissing\x12;\n" +
"\vupdate_mask\x18\x04 \x01(\v2\x1a.google.protobuf.FieldMaskR\n" +
- "updateMask\"v\n" +
+ "updateMask\"\xa6\x04\n" +
"\aSetting\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name\x12(\n" +
- "\x05value\x18\x02 \x01(\v2\x12.bytebase.v1.ValueR\x05value:-\xeaA*\n" +
+ "\x05value\x18\x02 \x01(\v2\x12.bytebase.v1.ValueR\x05value\"\xad\x03\n" +
+ "\vSettingName\x12\x1c\n" +
+ "\x18SETTING_NAME_UNSPECIFIED\x10\x00\x12\x0f\n" +
+ "\vAUTH_SECRET\x10\x01\x12\x11\n" +
+ "\rBRANDING_LOGO\x10\x02\x12\x10\n" +
+ "\fWORKSPACE_ID\x10\x03\x12\x15\n" +
+ "\x11WORKSPACE_PROFILE\x10\x04\x12\x16\n" +
+ "\x12WORKSPACE_APPROVAL\x10\x05\x12\x1f\n" +
+ "\x1bWORKSPACE_EXTERNAL_APPROVAL\x10\x06\x12\x16\n" +
+ "\x12ENTERPRISE_LICENSE\x10\a\x12\n" +
+ "\n" +
+ "\x06APP_IM\x10\b\x12\r\n" +
+ "\tWATERMARK\x10\t\x12\x06\n" +
+ "\x02AI\x10\n" +
+ "\x12\x10\n" +
+ "\fPLUGIN_AGENT\x10\v\x12\x1b\n" +
+ "\x17WORKSPACE_MAIL_DELIVERY\x10\f\x12\x13\n" +
+ "\x0fSCHEMA_TEMPLATE\x10\r\x12\x17\n" +
+ "\x13DATA_CLASSIFICATION\x10\x0e\x12\x12\n" +
+ "\x0eSEMANTIC_TYPES\x10\x0f\x12\x19\n" +
+ "\x15SQL_RESULT_SIZE_LIMIT\x10\x10\x12\b\n" +
+ "\x04SCIM\x10\x11\x12\x18\n" +
+ "\x14PASSWORD_RESTRICTION\x10\x12\x12\x0f\n" +
+ "\vENVIRONMENT\x10\x13:-\xeaA*\n" +
"\x14bytebase.com/Setting\x12\x12settings/{setting}\"\x8e\v\n" +
"\x05Value\x12#\n" +
"\fstring_value\x18\x01 \x01(\tH\x00R\vstringValue\x12s\n" +
@@ -3647,141 +3770,142 @@ func file_v1_setting_service_proto_rawDescGZIP() []byte {
return file_v1_setting_service_proto_rawDescData
}
-var file_v1_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 6)
+var file_v1_setting_service_proto_enumTypes = make([]protoimpl.EnumInfo, 7)
var file_v1_setting_service_proto_msgTypes = make([]protoimpl.MessageInfo, 44)
var file_v1_setting_service_proto_goTypes = []any{
(DatabaseChangeMode)(0), // 0: bytebase.v1.DatabaseChangeMode
- (SMTPMailDeliverySettingValue_Encryption)(0), // 1: bytebase.v1.SMTPMailDeliverySettingValue.Encryption
- (SMTPMailDeliverySettingValue_Authentication)(0), // 2: bytebase.v1.SMTPMailDeliverySettingValue.Authentication
- (Announcement_AlertLevel)(0), // 3: bytebase.v1.Announcement.AlertLevel
- (Algorithm_InnerOuterMask_MaskType)(0), // 4: bytebase.v1.Algorithm.InnerOuterMask.MaskType
- (AISetting_Provider)(0), // 5: bytebase.v1.AISetting.Provider
- (*ListSettingsRequest)(nil), // 6: bytebase.v1.ListSettingsRequest
- (*ListSettingsResponse)(nil), // 7: bytebase.v1.ListSettingsResponse
- (*GetSettingRequest)(nil), // 8: bytebase.v1.GetSettingRequest
- (*GetSettingResponse)(nil), // 9: bytebase.v1.GetSettingResponse
- (*UpdateSettingRequest)(nil), // 10: bytebase.v1.UpdateSettingRequest
- (*Setting)(nil), // 11: bytebase.v1.Setting
- (*Value)(nil), // 12: bytebase.v1.Value
- (*SMTPMailDeliverySettingValue)(nil), // 13: bytebase.v1.SMTPMailDeliverySettingValue
- (*AppIMSetting)(nil), // 14: bytebase.v1.AppIMSetting
- (*AgentPluginSetting)(nil), // 15: bytebase.v1.AgentPluginSetting
- (*WorkspaceProfileSetting)(nil), // 16: bytebase.v1.WorkspaceProfileSetting
- (*Announcement)(nil), // 17: bytebase.v1.Announcement
- (*WorkspaceApprovalSetting)(nil), // 18: bytebase.v1.WorkspaceApprovalSetting
- (*SchemaTemplateSetting)(nil), // 19: bytebase.v1.SchemaTemplateSetting
- (*WorkspaceTrialSetting)(nil), // 20: bytebase.v1.WorkspaceTrialSetting
- (*DataClassificationSetting)(nil), // 21: bytebase.v1.DataClassificationSetting
- (*SemanticTypeSetting)(nil), // 22: bytebase.v1.SemanticTypeSetting
- (*Algorithm)(nil), // 23: bytebase.v1.Algorithm
- (*MaximumSQLResultSizeSetting)(nil), // 24: bytebase.v1.MaximumSQLResultSizeSetting
- (*SCIMSetting)(nil), // 25: bytebase.v1.SCIMSetting
- (*PasswordRestrictionSetting)(nil), // 26: bytebase.v1.PasswordRestrictionSetting
- (*AISetting)(nil), // 27: bytebase.v1.AISetting
- (*EnvironmentSetting)(nil), // 28: bytebase.v1.EnvironmentSetting
- (*AppIMSetting_Slack)(nil), // 29: bytebase.v1.AppIMSetting.Slack
- (*AppIMSetting_Feishu)(nil), // 30: bytebase.v1.AppIMSetting.Feishu
- (*AppIMSetting_Wecom)(nil), // 31: bytebase.v1.AppIMSetting.Wecom
- (*AppIMSetting_Lark)(nil), // 32: bytebase.v1.AppIMSetting.Lark
- (*AppIMSetting_DingTalk)(nil), // 33: bytebase.v1.AppIMSetting.DingTalk
- (*WorkspaceApprovalSetting_Rule)(nil), // 34: bytebase.v1.WorkspaceApprovalSetting.Rule
- (*SchemaTemplateSetting_FieldTemplate)(nil), // 35: bytebase.v1.SchemaTemplateSetting.FieldTemplate
- (*SchemaTemplateSetting_ColumnType)(nil), // 36: bytebase.v1.SchemaTemplateSetting.ColumnType
- (*SchemaTemplateSetting_TableTemplate)(nil), // 37: bytebase.v1.SchemaTemplateSetting.TableTemplate
- (*DataClassificationSetting_DataClassificationConfig)(nil), // 38: bytebase.v1.DataClassificationSetting.DataClassificationConfig
- (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 39: bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level
- (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 40: bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification
- nil, // 41: bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- (*SemanticTypeSetting_SemanticType)(nil), // 42: bytebase.v1.SemanticTypeSetting.SemanticType
- (*Algorithm_FullMask)(nil), // 43: bytebase.v1.Algorithm.FullMask
- (*Algorithm_RangeMask)(nil), // 44: bytebase.v1.Algorithm.RangeMask
- (*Algorithm_MD5Mask)(nil), // 45: bytebase.v1.Algorithm.MD5Mask
- (*Algorithm_InnerOuterMask)(nil), // 46: bytebase.v1.Algorithm.InnerOuterMask
- (*Algorithm_RangeMask_Slice)(nil), // 47: bytebase.v1.Algorithm.RangeMask.Slice
- (*EnvironmentSetting_Environment)(nil), // 48: bytebase.v1.EnvironmentSetting.Environment
- nil, // 49: bytebase.v1.EnvironmentSetting.Environment.TagsEntry
- (*fieldmaskpb.FieldMask)(nil), // 50: google.protobuf.FieldMask
- (*durationpb.Duration)(nil), // 51: google.protobuf.Duration
- (*timestamppb.Timestamp)(nil), // 52: google.protobuf.Timestamp
- (PlanType)(0), // 53: bytebase.v1.PlanType
- (*ApprovalTemplate)(nil), // 54: bytebase.v1.ApprovalTemplate
- (*expr.Expr)(nil), // 55: google.type.Expr
- (Engine)(0), // 56: bytebase.v1.Engine
- (*ColumnMetadata)(nil), // 57: bytebase.v1.ColumnMetadata
- (*ColumnCatalog)(nil), // 58: bytebase.v1.ColumnCatalog
- (*TableMetadata)(nil), // 59: bytebase.v1.TableMetadata
- (*TableCatalog)(nil), // 60: bytebase.v1.TableCatalog
+ (Setting_SettingName)(0), // 1: bytebase.v1.Setting.SettingName
+ (SMTPMailDeliverySettingValue_Encryption)(0), // 2: bytebase.v1.SMTPMailDeliverySettingValue.Encryption
+ (SMTPMailDeliverySettingValue_Authentication)(0), // 3: bytebase.v1.SMTPMailDeliverySettingValue.Authentication
+ (Announcement_AlertLevel)(0), // 4: bytebase.v1.Announcement.AlertLevel
+ (Algorithm_InnerOuterMask_MaskType)(0), // 5: bytebase.v1.Algorithm.InnerOuterMask.MaskType
+ (AISetting_Provider)(0), // 6: bytebase.v1.AISetting.Provider
+ (*ListSettingsRequest)(nil), // 7: bytebase.v1.ListSettingsRequest
+ (*ListSettingsResponse)(nil), // 8: bytebase.v1.ListSettingsResponse
+ (*GetSettingRequest)(nil), // 9: bytebase.v1.GetSettingRequest
+ (*GetSettingResponse)(nil), // 10: bytebase.v1.GetSettingResponse
+ (*UpdateSettingRequest)(nil), // 11: bytebase.v1.UpdateSettingRequest
+ (*Setting)(nil), // 12: bytebase.v1.Setting
+ (*Value)(nil), // 13: bytebase.v1.Value
+ (*SMTPMailDeliverySettingValue)(nil), // 14: bytebase.v1.SMTPMailDeliverySettingValue
+ (*AppIMSetting)(nil), // 15: bytebase.v1.AppIMSetting
+ (*AgentPluginSetting)(nil), // 16: bytebase.v1.AgentPluginSetting
+ (*WorkspaceProfileSetting)(nil), // 17: bytebase.v1.WorkspaceProfileSetting
+ (*Announcement)(nil), // 18: bytebase.v1.Announcement
+ (*WorkspaceApprovalSetting)(nil), // 19: bytebase.v1.WorkspaceApprovalSetting
+ (*SchemaTemplateSetting)(nil), // 20: bytebase.v1.SchemaTemplateSetting
+ (*WorkspaceTrialSetting)(nil), // 21: bytebase.v1.WorkspaceTrialSetting
+ (*DataClassificationSetting)(nil), // 22: bytebase.v1.DataClassificationSetting
+ (*SemanticTypeSetting)(nil), // 23: bytebase.v1.SemanticTypeSetting
+ (*Algorithm)(nil), // 24: bytebase.v1.Algorithm
+ (*MaximumSQLResultSizeSetting)(nil), // 25: bytebase.v1.MaximumSQLResultSizeSetting
+ (*SCIMSetting)(nil), // 26: bytebase.v1.SCIMSetting
+ (*PasswordRestrictionSetting)(nil), // 27: bytebase.v1.PasswordRestrictionSetting
+ (*AISetting)(nil), // 28: bytebase.v1.AISetting
+ (*EnvironmentSetting)(nil), // 29: bytebase.v1.EnvironmentSetting
+ (*AppIMSetting_Slack)(nil), // 30: bytebase.v1.AppIMSetting.Slack
+ (*AppIMSetting_Feishu)(nil), // 31: bytebase.v1.AppIMSetting.Feishu
+ (*AppIMSetting_Wecom)(nil), // 32: bytebase.v1.AppIMSetting.Wecom
+ (*AppIMSetting_Lark)(nil), // 33: bytebase.v1.AppIMSetting.Lark
+ (*AppIMSetting_DingTalk)(nil), // 34: bytebase.v1.AppIMSetting.DingTalk
+ (*WorkspaceApprovalSetting_Rule)(nil), // 35: bytebase.v1.WorkspaceApprovalSetting.Rule
+ (*SchemaTemplateSetting_FieldTemplate)(nil), // 36: bytebase.v1.SchemaTemplateSetting.FieldTemplate
+ (*SchemaTemplateSetting_ColumnType)(nil), // 37: bytebase.v1.SchemaTemplateSetting.ColumnType
+ (*SchemaTemplateSetting_TableTemplate)(nil), // 38: bytebase.v1.SchemaTemplateSetting.TableTemplate
+ (*DataClassificationSetting_DataClassificationConfig)(nil), // 39: bytebase.v1.DataClassificationSetting.DataClassificationConfig
+ (*DataClassificationSetting_DataClassificationConfig_Level)(nil), // 40: bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level
+ (*DataClassificationSetting_DataClassificationConfig_DataClassification)(nil), // 41: bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification
+ nil, // 42: bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ (*SemanticTypeSetting_SemanticType)(nil), // 43: bytebase.v1.SemanticTypeSetting.SemanticType
+ (*Algorithm_FullMask)(nil), // 44: bytebase.v1.Algorithm.FullMask
+ (*Algorithm_RangeMask)(nil), // 45: bytebase.v1.Algorithm.RangeMask
+ (*Algorithm_MD5Mask)(nil), // 46: bytebase.v1.Algorithm.MD5Mask
+ (*Algorithm_InnerOuterMask)(nil), // 47: bytebase.v1.Algorithm.InnerOuterMask
+ (*Algorithm_RangeMask_Slice)(nil), // 48: bytebase.v1.Algorithm.RangeMask.Slice
+ (*EnvironmentSetting_Environment)(nil), // 49: bytebase.v1.EnvironmentSetting.Environment
+ nil, // 50: bytebase.v1.EnvironmentSetting.Environment.TagsEntry
+ (*fieldmaskpb.FieldMask)(nil), // 51: google.protobuf.FieldMask
+ (*durationpb.Duration)(nil), // 52: google.protobuf.Duration
+ (*timestamppb.Timestamp)(nil), // 53: google.protobuf.Timestamp
+ (PlanType)(0), // 54: bytebase.v1.PlanType
+ (*ApprovalTemplate)(nil), // 55: bytebase.v1.ApprovalTemplate
+ (*expr.Expr)(nil), // 56: google.type.Expr
+ (Engine)(0), // 57: bytebase.v1.Engine
+ (*ColumnMetadata)(nil), // 58: bytebase.v1.ColumnMetadata
+ (*ColumnCatalog)(nil), // 59: bytebase.v1.ColumnCatalog
+ (*TableMetadata)(nil), // 60: bytebase.v1.TableMetadata
+ (*TableCatalog)(nil), // 61: bytebase.v1.TableCatalog
}
var file_v1_setting_service_proto_depIdxs = []int32{
- 11, // 0: bytebase.v1.ListSettingsResponse.settings:type_name -> bytebase.v1.Setting
- 11, // 1: bytebase.v1.GetSettingResponse.setting:type_name -> bytebase.v1.Setting
- 11, // 2: bytebase.v1.UpdateSettingRequest.setting:type_name -> bytebase.v1.Setting
- 50, // 3: bytebase.v1.UpdateSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
- 12, // 4: bytebase.v1.Setting.value:type_name -> bytebase.v1.Value
- 13, // 5: bytebase.v1.Value.smtp_mail_delivery_setting_value:type_name -> bytebase.v1.SMTPMailDeliverySettingValue
- 14, // 6: bytebase.v1.Value.app_im_setting_value:type_name -> bytebase.v1.AppIMSetting
- 15, // 7: bytebase.v1.Value.agent_plugin_setting_value:type_name -> bytebase.v1.AgentPluginSetting
- 16, // 8: bytebase.v1.Value.workspace_profile_setting_value:type_name -> bytebase.v1.WorkspaceProfileSetting
- 18, // 9: bytebase.v1.Value.workspace_approval_setting_value:type_name -> bytebase.v1.WorkspaceApprovalSetting
- 20, // 10: bytebase.v1.Value.workspace_trial_setting_value:type_name -> bytebase.v1.WorkspaceTrialSetting
- 19, // 11: bytebase.v1.Value.schema_template_setting_value:type_name -> bytebase.v1.SchemaTemplateSetting
- 21, // 12: bytebase.v1.Value.data_classification_setting_value:type_name -> bytebase.v1.DataClassificationSetting
- 22, // 13: bytebase.v1.Value.semantic_type_setting_value:type_name -> bytebase.v1.SemanticTypeSetting
- 24, // 14: bytebase.v1.Value.maximum_sql_result_size_setting:type_name -> bytebase.v1.MaximumSQLResultSizeSetting
- 25, // 15: bytebase.v1.Value.scim_setting:type_name -> bytebase.v1.SCIMSetting
- 26, // 16: bytebase.v1.Value.password_restriction_setting:type_name -> bytebase.v1.PasswordRestrictionSetting
- 27, // 17: bytebase.v1.Value.ai_setting:type_name -> bytebase.v1.AISetting
- 28, // 18: bytebase.v1.Value.environment_setting:type_name -> bytebase.v1.EnvironmentSetting
- 1, // 19: bytebase.v1.SMTPMailDeliverySettingValue.encryption:type_name -> bytebase.v1.SMTPMailDeliverySettingValue.Encryption
- 2, // 20: bytebase.v1.SMTPMailDeliverySettingValue.authentication:type_name -> bytebase.v1.SMTPMailDeliverySettingValue.Authentication
- 29, // 21: bytebase.v1.AppIMSetting.slack:type_name -> bytebase.v1.AppIMSetting.Slack
- 30, // 22: bytebase.v1.AppIMSetting.feishu:type_name -> bytebase.v1.AppIMSetting.Feishu
- 31, // 23: bytebase.v1.AppIMSetting.wecom:type_name -> bytebase.v1.AppIMSetting.Wecom
- 32, // 24: bytebase.v1.AppIMSetting.lark:type_name -> bytebase.v1.AppIMSetting.Lark
- 33, // 25: bytebase.v1.AppIMSetting.dingtalk:type_name -> bytebase.v1.AppIMSetting.DingTalk
- 51, // 26: bytebase.v1.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
- 17, // 27: bytebase.v1.WorkspaceProfileSetting.announcement:type_name -> bytebase.v1.Announcement
- 51, // 28: bytebase.v1.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
+ 12, // 0: bytebase.v1.ListSettingsResponse.settings:type_name -> bytebase.v1.Setting
+ 12, // 1: bytebase.v1.GetSettingResponse.setting:type_name -> bytebase.v1.Setting
+ 12, // 2: bytebase.v1.UpdateSettingRequest.setting:type_name -> bytebase.v1.Setting
+ 51, // 3: bytebase.v1.UpdateSettingRequest.update_mask:type_name -> google.protobuf.FieldMask
+ 13, // 4: bytebase.v1.Setting.value:type_name -> bytebase.v1.Value
+ 14, // 5: bytebase.v1.Value.smtp_mail_delivery_setting_value:type_name -> bytebase.v1.SMTPMailDeliverySettingValue
+ 15, // 6: bytebase.v1.Value.app_im_setting_value:type_name -> bytebase.v1.AppIMSetting
+ 16, // 7: bytebase.v1.Value.agent_plugin_setting_value:type_name -> bytebase.v1.AgentPluginSetting
+ 17, // 8: bytebase.v1.Value.workspace_profile_setting_value:type_name -> bytebase.v1.WorkspaceProfileSetting
+ 19, // 9: bytebase.v1.Value.workspace_approval_setting_value:type_name -> bytebase.v1.WorkspaceApprovalSetting
+ 21, // 10: bytebase.v1.Value.workspace_trial_setting_value:type_name -> bytebase.v1.WorkspaceTrialSetting
+ 20, // 11: bytebase.v1.Value.schema_template_setting_value:type_name -> bytebase.v1.SchemaTemplateSetting
+ 22, // 12: bytebase.v1.Value.data_classification_setting_value:type_name -> bytebase.v1.DataClassificationSetting
+ 23, // 13: bytebase.v1.Value.semantic_type_setting_value:type_name -> bytebase.v1.SemanticTypeSetting
+ 25, // 14: bytebase.v1.Value.maximum_sql_result_size_setting:type_name -> bytebase.v1.MaximumSQLResultSizeSetting
+ 26, // 15: bytebase.v1.Value.scim_setting:type_name -> bytebase.v1.SCIMSetting
+ 27, // 16: bytebase.v1.Value.password_restriction_setting:type_name -> bytebase.v1.PasswordRestrictionSetting
+ 28, // 17: bytebase.v1.Value.ai_setting:type_name -> bytebase.v1.AISetting
+ 29, // 18: bytebase.v1.Value.environment_setting:type_name -> bytebase.v1.EnvironmentSetting
+ 2, // 19: bytebase.v1.SMTPMailDeliverySettingValue.encryption:type_name -> bytebase.v1.SMTPMailDeliverySettingValue.Encryption
+ 3, // 20: bytebase.v1.SMTPMailDeliverySettingValue.authentication:type_name -> bytebase.v1.SMTPMailDeliverySettingValue.Authentication
+ 30, // 21: bytebase.v1.AppIMSetting.slack:type_name -> bytebase.v1.AppIMSetting.Slack
+ 31, // 22: bytebase.v1.AppIMSetting.feishu:type_name -> bytebase.v1.AppIMSetting.Feishu
+ 32, // 23: bytebase.v1.AppIMSetting.wecom:type_name -> bytebase.v1.AppIMSetting.Wecom
+ 33, // 24: bytebase.v1.AppIMSetting.lark:type_name -> bytebase.v1.AppIMSetting.Lark
+ 34, // 25: bytebase.v1.AppIMSetting.dingtalk:type_name -> bytebase.v1.AppIMSetting.DingTalk
+ 52, // 26: bytebase.v1.WorkspaceProfileSetting.token_duration:type_name -> google.protobuf.Duration
+ 18, // 27: bytebase.v1.WorkspaceProfileSetting.announcement:type_name -> bytebase.v1.Announcement
+ 52, // 28: bytebase.v1.WorkspaceProfileSetting.maximum_role_expiration:type_name -> google.protobuf.Duration
0, // 29: bytebase.v1.WorkspaceProfileSetting.database_change_mode:type_name -> bytebase.v1.DatabaseChangeMode
- 3, // 30: bytebase.v1.Announcement.level:type_name -> bytebase.v1.Announcement.AlertLevel
- 34, // 31: bytebase.v1.WorkspaceApprovalSetting.rules:type_name -> bytebase.v1.WorkspaceApprovalSetting.Rule
- 35, // 32: bytebase.v1.SchemaTemplateSetting.field_templates:type_name -> bytebase.v1.SchemaTemplateSetting.FieldTemplate
- 36, // 33: bytebase.v1.SchemaTemplateSetting.column_types:type_name -> bytebase.v1.SchemaTemplateSetting.ColumnType
- 37, // 34: bytebase.v1.SchemaTemplateSetting.table_templates:type_name -> bytebase.v1.SchemaTemplateSetting.TableTemplate
- 52, // 35: bytebase.v1.WorkspaceTrialSetting.expire_time:type_name -> google.protobuf.Timestamp
- 52, // 36: bytebase.v1.WorkspaceTrialSetting.issued_time:type_name -> google.protobuf.Timestamp
- 53, // 37: bytebase.v1.WorkspaceTrialSetting.plan:type_name -> bytebase.v1.PlanType
- 38, // 38: bytebase.v1.DataClassificationSetting.configs:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig
- 42, // 39: bytebase.v1.SemanticTypeSetting.types:type_name -> bytebase.v1.SemanticTypeSetting.SemanticType
- 43, // 40: bytebase.v1.Algorithm.full_mask:type_name -> bytebase.v1.Algorithm.FullMask
- 44, // 41: bytebase.v1.Algorithm.range_mask:type_name -> bytebase.v1.Algorithm.RangeMask
- 45, // 42: bytebase.v1.Algorithm.md5_mask:type_name -> bytebase.v1.Algorithm.MD5Mask
- 46, // 43: bytebase.v1.Algorithm.inner_outer_mask:type_name -> bytebase.v1.Algorithm.InnerOuterMask
- 51, // 44: bytebase.v1.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
- 5, // 45: bytebase.v1.AISetting.provider:type_name -> bytebase.v1.AISetting.Provider
- 48, // 46: bytebase.v1.EnvironmentSetting.environments:type_name -> bytebase.v1.EnvironmentSetting.Environment
- 54, // 47: bytebase.v1.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.v1.ApprovalTemplate
- 55, // 48: bytebase.v1.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
- 56, // 49: bytebase.v1.SchemaTemplateSetting.FieldTemplate.engine:type_name -> bytebase.v1.Engine
- 57, // 50: bytebase.v1.SchemaTemplateSetting.FieldTemplate.column:type_name -> bytebase.v1.ColumnMetadata
- 58, // 51: bytebase.v1.SchemaTemplateSetting.FieldTemplate.catalog:type_name -> bytebase.v1.ColumnCatalog
- 56, // 52: bytebase.v1.SchemaTemplateSetting.ColumnType.engine:type_name -> bytebase.v1.Engine
- 56, // 53: bytebase.v1.SchemaTemplateSetting.TableTemplate.engine:type_name -> bytebase.v1.Engine
- 59, // 54: bytebase.v1.SchemaTemplateSetting.TableTemplate.table:type_name -> bytebase.v1.TableMetadata
- 60, // 55: bytebase.v1.SchemaTemplateSetting.TableTemplate.catalog:type_name -> bytebase.v1.TableCatalog
- 39, // 56: bytebase.v1.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level
- 41, // 57: bytebase.v1.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
- 40, // 58: bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification
- 23, // 59: bytebase.v1.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.v1.Algorithm
- 47, // 60: bytebase.v1.Algorithm.RangeMask.slices:type_name -> bytebase.v1.Algorithm.RangeMask.Slice
- 4, // 61: bytebase.v1.Algorithm.InnerOuterMask.type:type_name -> bytebase.v1.Algorithm.InnerOuterMask.MaskType
- 49, // 62: bytebase.v1.EnvironmentSetting.Environment.tags:type_name -> bytebase.v1.EnvironmentSetting.Environment.TagsEntry
- 6, // 63: bytebase.v1.SettingService.ListSettings:input_type -> bytebase.v1.ListSettingsRequest
- 8, // 64: bytebase.v1.SettingService.GetSetting:input_type -> bytebase.v1.GetSettingRequest
- 10, // 65: bytebase.v1.SettingService.UpdateSetting:input_type -> bytebase.v1.UpdateSettingRequest
- 7, // 66: bytebase.v1.SettingService.ListSettings:output_type -> bytebase.v1.ListSettingsResponse
- 11, // 67: bytebase.v1.SettingService.GetSetting:output_type -> bytebase.v1.Setting
- 11, // 68: bytebase.v1.SettingService.UpdateSetting:output_type -> bytebase.v1.Setting
+ 4, // 30: bytebase.v1.Announcement.level:type_name -> bytebase.v1.Announcement.AlertLevel
+ 35, // 31: bytebase.v1.WorkspaceApprovalSetting.rules:type_name -> bytebase.v1.WorkspaceApprovalSetting.Rule
+ 36, // 32: bytebase.v1.SchemaTemplateSetting.field_templates:type_name -> bytebase.v1.SchemaTemplateSetting.FieldTemplate
+ 37, // 33: bytebase.v1.SchemaTemplateSetting.column_types:type_name -> bytebase.v1.SchemaTemplateSetting.ColumnType
+ 38, // 34: bytebase.v1.SchemaTemplateSetting.table_templates:type_name -> bytebase.v1.SchemaTemplateSetting.TableTemplate
+ 53, // 35: bytebase.v1.WorkspaceTrialSetting.expire_time:type_name -> google.protobuf.Timestamp
+ 53, // 36: bytebase.v1.WorkspaceTrialSetting.issued_time:type_name -> google.protobuf.Timestamp
+ 54, // 37: bytebase.v1.WorkspaceTrialSetting.plan:type_name -> bytebase.v1.PlanType
+ 39, // 38: bytebase.v1.DataClassificationSetting.configs:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig
+ 43, // 39: bytebase.v1.SemanticTypeSetting.types:type_name -> bytebase.v1.SemanticTypeSetting.SemanticType
+ 44, // 40: bytebase.v1.Algorithm.full_mask:type_name -> bytebase.v1.Algorithm.FullMask
+ 45, // 41: bytebase.v1.Algorithm.range_mask:type_name -> bytebase.v1.Algorithm.RangeMask
+ 46, // 42: bytebase.v1.Algorithm.md5_mask:type_name -> bytebase.v1.Algorithm.MD5Mask
+ 47, // 43: bytebase.v1.Algorithm.inner_outer_mask:type_name -> bytebase.v1.Algorithm.InnerOuterMask
+ 52, // 44: bytebase.v1.PasswordRestrictionSetting.password_rotation:type_name -> google.protobuf.Duration
+ 6, // 45: bytebase.v1.AISetting.provider:type_name -> bytebase.v1.AISetting.Provider
+ 49, // 46: bytebase.v1.EnvironmentSetting.environments:type_name -> bytebase.v1.EnvironmentSetting.Environment
+ 55, // 47: bytebase.v1.WorkspaceApprovalSetting.Rule.template:type_name -> bytebase.v1.ApprovalTemplate
+ 56, // 48: bytebase.v1.WorkspaceApprovalSetting.Rule.condition:type_name -> google.type.Expr
+ 57, // 49: bytebase.v1.SchemaTemplateSetting.FieldTemplate.engine:type_name -> bytebase.v1.Engine
+ 58, // 50: bytebase.v1.SchemaTemplateSetting.FieldTemplate.column:type_name -> bytebase.v1.ColumnMetadata
+ 59, // 51: bytebase.v1.SchemaTemplateSetting.FieldTemplate.catalog:type_name -> bytebase.v1.ColumnCatalog
+ 57, // 52: bytebase.v1.SchemaTemplateSetting.ColumnType.engine:type_name -> bytebase.v1.Engine
+ 57, // 53: bytebase.v1.SchemaTemplateSetting.TableTemplate.engine:type_name -> bytebase.v1.Engine
+ 60, // 54: bytebase.v1.SchemaTemplateSetting.TableTemplate.table:type_name -> bytebase.v1.TableMetadata
+ 61, // 55: bytebase.v1.SchemaTemplateSetting.TableTemplate.catalog:type_name -> bytebase.v1.TableCatalog
+ 40, // 56: bytebase.v1.DataClassificationSetting.DataClassificationConfig.levels:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.Level
+ 42, // 57: bytebase.v1.DataClassificationSetting.DataClassificationConfig.classification:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry
+ 41, // 58: bytebase.v1.DataClassificationSetting.DataClassificationConfig.ClassificationEntry.value:type_name -> bytebase.v1.DataClassificationSetting.DataClassificationConfig.DataClassification
+ 24, // 59: bytebase.v1.SemanticTypeSetting.SemanticType.algorithm:type_name -> bytebase.v1.Algorithm
+ 48, // 60: bytebase.v1.Algorithm.RangeMask.slices:type_name -> bytebase.v1.Algorithm.RangeMask.Slice
+ 5, // 61: bytebase.v1.Algorithm.InnerOuterMask.type:type_name -> bytebase.v1.Algorithm.InnerOuterMask.MaskType
+ 50, // 62: bytebase.v1.EnvironmentSetting.Environment.tags:type_name -> bytebase.v1.EnvironmentSetting.Environment.TagsEntry
+ 7, // 63: bytebase.v1.SettingService.ListSettings:input_type -> bytebase.v1.ListSettingsRequest
+ 9, // 64: bytebase.v1.SettingService.GetSetting:input_type -> bytebase.v1.GetSettingRequest
+ 11, // 65: bytebase.v1.SettingService.UpdateSetting:input_type -> bytebase.v1.UpdateSettingRequest
+ 8, // 66: bytebase.v1.SettingService.ListSettings:output_type -> bytebase.v1.ListSettingsResponse
+ 12, // 67: bytebase.v1.SettingService.GetSetting:output_type -> bytebase.v1.Setting
+ 12, // 68: bytebase.v1.SettingService.UpdateSetting:output_type -> bytebase.v1.Setting
66, // [66:69] is the sub-list for method output_type
63, // [63:66] is the sub-list for method input_type
63, // [63:63] is the sub-list for extension type_name
@@ -3830,7 +3954,7 @@ func file_v1_setting_service_proto_init() {
File: protoimpl.DescBuilder{
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_v1_setting_service_proto_rawDesc), len(file_v1_setting_service_proto_rawDesc)),
- NumEnums: 6,
+ NumEnums: 7,
NumMessages: 44,
NumExtensions: 0,
NumServices: 1,
diff --git a/proto/store/store/setting.proto b/proto/store/store/setting.proto
index d808ac1e21..6f4bad2c7a 100644
--- a/proto/store/store/setting.proto
+++ b/proto/store/store/setting.proto
@@ -11,6 +11,29 @@ import "store/database.proto";
option go_package = "generated-go/store";
+enum SettingName {
+ SETTING_NAME_UNSPECIFIED = 0;
+ AUTH_SECRET = 1;
+ BRANDING_LOGO = 2;
+ WORKSPACE_ID = 3;
+ WORKSPACE_PROFILE = 4;
+ WORKSPACE_APPROVAL = 5;
+ WORKSPACE_EXTERNAL_APPROVAL = 6;
+ ENTERPRISE_LICENSE = 7;
+ APP_IM = 8;
+ WATERMARK = 9;
+ AI = 10;
+ PLUGIN_AGENT = 11;
+ WORKSPACE_MAIL_DELIVERY = 12;
+ SCHEMA_TEMPLATE = 13;
+ DATA_CLASSIFICATION = 14;
+ SEMANTIC_TYPES = 15;
+ SQL_RESULT_SIZE_LIMIT = 16;
+ SCIM = 17;
+ PASSWORD_RESTRICTION = 18;
+ ENVIRONMENT = 19;
+}
+
message WorkspaceProfileSetting {
// The external URL is used for sso authentication callback.
string external_url = 1;
diff --git a/proto/v1/v1/setting_service.proto b/proto/v1/v1/setting_service.proto
index 054b2497ff..506c473def 100644
--- a/proto/v1/v1/setting_service.proto
+++ b/proto/v1/v1/setting_service.proto
@@ -106,6 +106,29 @@ message Setting {
pattern: "settings/{setting}"
};
+ enum SettingName {
+ SETTING_NAME_UNSPECIFIED = 0;
+ AUTH_SECRET = 1;
+ BRANDING_LOGO = 2;
+ WORKSPACE_ID = 3;
+ WORKSPACE_PROFILE = 4;
+ WORKSPACE_APPROVAL = 5;
+ WORKSPACE_EXTERNAL_APPROVAL = 6;
+ ENTERPRISE_LICENSE = 7;
+ APP_IM = 8;
+ WATERMARK = 9;
+ AI = 10;
+ PLUGIN_AGENT = 11;
+ WORKSPACE_MAIL_DELIVERY = 12;
+ SCHEMA_TEMPLATE = 13;
+ DATA_CLASSIFICATION = 14;
+ SEMANTIC_TYPES = 15;
+ SQL_RESULT_SIZE_LIMIT = 16;
+ SCIM = 17;
+ PASSWORD_RESTRICTION = 18;
+ ENVIRONMENT = 19;
+ }
+
// The resource name of the setting. Must be one of the following forms:
//
// - `setting/{setting}`